diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test.c | 8 | ||||
-rw-r--r-- | test/test.h | 1 | ||||
-rw-r--r-- | test/testbmk.c | 6 |
3 files changed, 10 insertions, 5 deletions
diff --git a/test/test.c b/test/test.c index 3f2cc9514..2c180ba4b 100644 --- a/test/test.c +++ b/test/test.c @@ -148,6 +148,14 @@ void test_assert_time_window(systime_t start, systime_t end) { /*
* Threads utils.
*/
+void test_terminate_threads(void) {
+ int i;
+
+ for (i = 0; i < MAX_THREADS; i++)
+ if (threads[i])
+ chThdTerminate(threads[i]);
+}
+
void test_wait_threads(void) {
int i;
diff --git a/test/test.h b/test/test.h index 7a2e86f0b..3bee948cd 100644 --- a/test/test.h +++ b/test/test.h @@ -50,6 +50,7 @@ extern "C" { void test_assert(bool_t condition, char * msg);
void test_assert_sequence(char *expected);
void test_assert_time_window(systime_t start, systime_t end);
+ void test_terminate_threads(void);
void test_wait_threads(void);
systime_t test_wait_tick(void);
void test_cpu_pulse(systime_t ms);
diff --git a/test/testbmk.c b/test/testbmk.c index f2fcb94dc..acdfa50e8 100644 --- a/test/testbmk.c +++ b/test/testbmk.c @@ -236,11 +236,7 @@ static void bmk6_execute(void) { ChkIntSources();
#endif
} while (!test_timer_done);
- chThdTerminate(threads[0]);
- chThdTerminate(threads[1]);
- chThdTerminate(threads[2]);
- chThdTerminate(threads[3]);
- chThdTerminate(threads[4]);
+ test_terminate_threads();
chSemReset(&sem1, 0);
test_wait_threads();
|