From aed82faf72f86bfdca6568102953239116ba90c1 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 2 Apr 2016 07:11:56 +0000 Subject: Fixed calls to test suite in all applications. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9202 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- test/lib/ch_test.c | 24 ++++++++++++++---------- test/lib/ch_test.h | 1 + 2 files changed, 15 insertions(+), 10 deletions(-) (limited to 'test/lib') diff --git a/test/lib/ch_test.c b/test/lib/ch_test.c index 65f9ec9af..8dd166278 100644 --- a/test/lib/ch_test.c +++ b/test/lib/ch_test.c @@ -39,6 +39,11 @@ */ unsigned test_step; +/** + * @brief Test result flag. + */ +bool test_global_fail; + /*===========================================================================*/ /* Module local types. */ /*===========================================================================*/ @@ -48,7 +53,6 @@ unsigned test_step; /*===========================================================================*/ static bool test_local_fail; -static bool test_global_fail; static const char *test_failure_message; static char test_tokens_buffer[TEST_MAX_TOKENS]; static char *test_tokp; @@ -74,7 +78,7 @@ static void execute_test(const testcase_t *tcp) { /* Initialization */ clear_tokens(); - test_local_fail = FALSE; + test_local_fail = false; if (tcp->setup != NULL) tcp->setup(); @@ -97,17 +101,17 @@ static void print_line(void) { bool _test_fail(const char *msg) { - test_local_fail = TRUE; - test_global_fail = TRUE; + test_local_fail = true; + test_global_fail = true; test_failure_message = msg; - return TRUE; + return true; } bool _test_assert(bool condition, const char *msg) { if (!condition) return _test_fail(msg); - return FALSE; + return false; } bool _test_assert_sequence(char *expected, const char *msg) { @@ -123,7 +127,7 @@ bool _test_assert_sequence(char *expected, const char *msg) { clear_tokens(); - return FALSE; + return false; } bool _test_assert_time_window(systime_t start, @@ -215,8 +219,8 @@ void test_emit_token_i(char token) { * @param[in] stream pointer to a @p BaseSequentialStream object for test * output * @return A failure boolean value casted to @p msg_t. - * @retval FALSE if no errors occurred. - * @retval TRUE if one or more tests failed. + * @retval false if no errors occurred. + * @retval true if one or more tests failed. * * @api */ @@ -246,7 +250,7 @@ msg_t test_execute(BaseSequentialStream *stream) { #endif test_println(""); - test_global_fail = FALSE; + test_global_fail = false; i = 0; while (test_suite[i]) { j = 0; diff --git a/test/lib/ch_test.h b/test/lib/ch_test.h index 1fc78bb33..6ecdb4af8 100644 --- a/test/lib/ch_test.h +++ b/test/lib/ch_test.h @@ -156,6 +156,7 @@ typedef struct { #if !defined(__DOXYGEN__) extern unsigned test_step; +extern bool test_global_fail; #endif #ifdef __cplusplus -- cgit v1.2.3