From da290782934b7038dfccd5f76b2b75a792e7304f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 30 Jul 2008 14:56:35 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@379 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- readme.txt | 1 + test/test.c | 8 ++++++++ test/test.h | 1 + test/testbmk.c | 6 +----- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/readme.txt b/readme.txt index a272b62d2..dc89f5fe6 100644 --- a/readme.txt +++ b/readme.txt @@ -89,6 +89,7 @@ Win32-MinGW - ChibiOS/RT simulator and demo into a WIN32 process, collide with external libraries. - Added a benchmark to the test suit that measures the mass reschedulation performance. +- Added a test_terminate_threads() function to the test framework. - Made the Cortex-M3 port preemption code more readable. *** 0.6.8 *** 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();