Fixed test case on time ranges.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@13243 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
Giovanni Di Sirio 2019-12-31 11:40:58 +00:00
parent 7f05206fe9
commit 7c7ce454e3
4 changed files with 22 additions and 22 deletions

View File

@ -352,7 +352,7 @@ while (time == chVTGetSystemTimeX()) {
<steps>
<step>
<description>
<value>Checking case where start == end, it must always evaluate as in range.</value>
<value>Checking case where start == end, it must always evaluate as not in range.</value>
</description>
<tags>
<value />
@ -362,13 +362,13 @@ while (time == chVTGetSystemTimeX()) {
bool b;
b = chTimeIsInRangeX((systime_t)0, (systime_t)0, (systime_t)0);
test_assert(b == true, "not in range");
test_assert(b == false, "in range");
b = chTimeIsInRangeX((systime_t)-1, (systime_t)0, (systime_t)0);
test_assert(b == true, "not in range");
test_assert(b == false, "in range");
b = chTimeIsInRangeX((systime_t)0, (systime_t)-1, (systime_t)-1);
test_assert(b == true, "not in range");
test_assert(b == false, "in range");
b = chTimeIsInRangeX((systime_t)-1, (systime_t)-1, (systime_t)-1);
test_assert(b == true, "not in range");
test_assert(b == false, "in range");
]]></value>
</code>
</step>

View File

@ -85,7 +85,7 @@ static const testcase_t nil_test_002_001 = {
*
* <h2>Test Steps</h2>
* - [2.2.1] Checking case where start == end, it must always evaluate
* as in range.
* as not in range.
* - [2.2.2] Checking boundaries for start < end.
* - [2.2.3] Checking boundaries for start > end.
* .
@ -94,19 +94,19 @@ static const testcase_t nil_test_002_001 = {
static void nil_test_002_002_execute(void) {
/* [2.2.1] Checking case where start == end, it must always evaluate
as in range.*/
as not in range.*/
test_set_step(1);
{
bool b;
b = chTimeIsInRangeX((systime_t)0, (systime_t)0, (systime_t)0);
test_assert(b == true, "not in range");
test_assert(b == false, "in range");
b = chTimeIsInRangeX((systime_t)-1, (systime_t)0, (systime_t)0);
test_assert(b == true, "not in range");
test_assert(b == false, "in range");
b = chTimeIsInRangeX((systime_t)0, (systime_t)-1, (systime_t)-1);
test_assert(b == true, "not in range");
test_assert(b == false, "in range");
b = chTimeIsInRangeX((systime_t)-1, (systime_t)-1, (systime_t)-1);
test_assert(b == true, "not in range");
test_assert(b == false, "in range");
}
test_end_step(1);

View File

@ -717,7 +717,7 @@ while (time == chVTGetSystemTimeX()) {
<steps>
<step>
<description>
<value>Checking case where start == end, it must always evaluate as in range.</value>
<value>Checking case where start == end, it must always evaluate as not in range.</value>
</description>
<tags>
<value />
@ -727,13 +727,13 @@ while (time == chVTGetSystemTimeX()) {
bool b;
b = chTimeIsInRangeX((systime_t)0, (systime_t)0, (systime_t)0);
test_assert(b == true, "not in range");
test_assert(b == false, "in range");
b = chTimeIsInRangeX((systime_t)-1, (systime_t)0, (systime_t)0);
test_assert(b == true, "not in range");
test_assert(b == false, "in range");
b = chTimeIsInRangeX((systime_t)0, (systime_t)-1, (systime_t)-1);
test_assert(b == true, "not in range");
test_assert(b == false, "in range");
b = chTimeIsInRangeX((systime_t)-1, (systime_t)-1, (systime_t)-1);
test_assert(b == true, "not in range");
test_assert(b == false, "in range");
]]></value>
</code>
</step>

View File

@ -85,7 +85,7 @@ static const testcase_t rt_test_003_001 = {
*
* <h2>Test Steps</h2>
* - [3.2.1] Checking case where start == end, it must always evaluate
* as in range.
* as not in range.
* - [3.2.2] Checking boundaries for start < end.
* - [3.2.3] Checking boundaries for start > end.
* .
@ -94,19 +94,19 @@ static const testcase_t rt_test_003_001 = {
static void rt_test_003_002_execute(void) {
/* [3.2.1] Checking case where start == end, it must always evaluate
as in range.*/
as not in range.*/
test_set_step(1);
{
bool b;
b = chTimeIsInRangeX((systime_t)0, (systime_t)0, (systime_t)0);
test_assert(b == true, "not in range");
test_assert(b == false, "in range");
b = chTimeIsInRangeX((systime_t)-1, (systime_t)0, (systime_t)0);
test_assert(b == true, "not in range");
test_assert(b == false, "in range");
b = chTimeIsInRangeX((systime_t)0, (systime_t)-1, (systime_t)-1);
test_assert(b == true, "not in range");
test_assert(b == false, "in range");
b = chTimeIsInRangeX((systime_t)-1, (systime_t)-1, (systime_t)-1);
test_assert(b == true, "not in range");
test_assert(b == false, "in range");
}
test_end_step(1);