aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-04-02 07:11:56 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-04-02 07:11:56 +0000
commitaed82faf72f86bfdca6568102953239116ba90c1 (patch)
tree412c703359718ceef438e04632a6fc1d8a7e7082 /test
parent109a347ca42435bc1c0e1ddd509dfff4ff6dad9d (diff)
downloadChibiOS-aed82faf72f86bfdca6568102953239116ba90c1.tar.gz
ChibiOS-aed82faf72f86bfdca6568102953239116ba90c1.tar.bz2
ChibiOS-aed82faf72f86bfdca6568102953239116ba90c1.zip
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
Diffstat (limited to 'test')
-rw-r--r--test/lib/ch_test.c24
-rw-r--r--test/lib/ch_test.h1
2 files changed, 15 insertions, 10 deletions
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