tests: Call TEST_PASS macro like a function, ie TEST_PASS()
This commit is contained in:
parent
f95c1391f8
commit
c5abd71404
3 changed files with 5 additions and 5 deletions
|
@ -36,7 +36,7 @@ static void a_01_scheduler_basic()
|
||||||
TEST_ASSERT_TRUE_MESSAGE(a, "task set_a should have run");
|
TEST_ASSERT_TRUE_MESSAGE(a, "task set_a should have run");
|
||||||
TEST_ASSERT_TRUE_MESSAGE(b, "task set_b should have run");
|
TEST_ASSERT_TRUE_MESSAGE(b, "task set_b should have run");
|
||||||
TEST_ASSERT_TRUE_MESSAGE(c, "task set_c should have run");
|
TEST_ASSERT_TRUE_MESSAGE(c, "task set_c should have run");
|
||||||
TEST_PASS;
|
TEST_PASS();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Verify that a high-priority task will starve a lower priority task */
|
/* Verify that a high-priority task will starve a lower priority task */
|
||||||
|
@ -67,5 +67,5 @@ static void a_01_scheduler_priorities()
|
||||||
vTaskDelay(1);
|
vTaskDelay(1);
|
||||||
|
|
||||||
TEST_ASSERT_TRUE_MESSAGE(lower, "lower prio task should have run");
|
TEST_ASSERT_TRUE_MESSAGE(lower, "lower prio task should have run");
|
||||||
TEST_PASS;
|
TEST_PASS();
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ static void a_02_heap_simple()
|
||||||
after = xPortGetFreeHeapSize();
|
after = xPortGetFreeHeapSize();
|
||||||
printf("after freeing xPortGetFreeHeapSize = %d bytes\n", after);
|
printf("after freeing xPortGetFreeHeapSize = %d bytes\n", after);
|
||||||
TEST_ASSERT_UINT32_WITHIN_MESSAGE(100, freeheap, after, "Free heap size after freeing buffer should be close to initial");
|
TEST_ASSERT_UINT32_WITHIN_MESSAGE(100, freeheap, after, "Free heap size after freeing buffer should be close to initial");
|
||||||
TEST_PASS;
|
TEST_PASS();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ensure malloc behaves when out of memory */
|
/* Ensure malloc behaves when out of memory */
|
||||||
|
@ -52,5 +52,5 @@ static void a_02_heap_full()
|
||||||
free(y);
|
free(y);
|
||||||
z = malloc(32768);
|
z = malloc(32768);
|
||||||
TEST_ASSERT_NOT_NULL_MESSAGE(z, "Allocating 32kB should succeed after first block freed");
|
TEST_ASSERT_NOT_NULL_MESSAGE(z, "Allocating 32kB should succeed after first block freed");
|
||||||
TEST_PASS;
|
TEST_PASS();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
|
|
||||||
/* Need to explicitly flag once a test has completed successfully. */
|
/* Need to explicitly flag once a test has completed successfully. */
|
||||||
#define TEST_PASS do { UnityConcludeTest(); while(1) { } } while (0)
|
#define TEST_PASS() do { UnityConcludeTest(); while(1) { } } while (0)
|
||||||
|
|
||||||
/* Types of test, defined by hardware requirements */
|
/* Types of test, defined by hardware requirements */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|
Loading…
Reference in a new issue