Do not return test execution status. The information is already available in the test object, and it becomes possible for test function to easily clean up state allocated during the test by putting such code after UNIT_TEST_END.

This commit is contained in:
Nicolas Tsiftes 2011-11-23 13:37:07 +01:00
parent e38f008b9b
commit a81cbbbd80

View File

@ -88,7 +88,7 @@ typedef struct unit_test {
*
* \param name The name of the unit test.
*/
#define UNIT_TEST(name) unit_test_result_t unit_test_function_##name(unit_test_t *utp)
#define UNIT_TEST(name) static void unit_test_function_##name(unit_test_t *utp)
/**
* Mark the starting point of the unit test function.
@ -103,8 +103,7 @@ typedef struct unit_test {
*/
#define UNIT_TEST_END() UNIT_TEST_SUCCEED(); \
unit_test_end: \
utp->end = RTIMER_NOW(); \
return utp->result;
utp->end = RTIMER_NOW()
/*
* The test result is printed with a function that is selected by