From b20088a8cb72e3f3e694e309671cd7f96fb552dc Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 16 May 2009 12:37:01 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@977 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- test/test.c | 13 ++++++++++++- test/test.h | 2 +- test/testserial.c | 6 +++--- todo.txt | 2 +- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/test/test.c b/test/test.c index abbc1f0eb..8d709a5b2 100644 --- a/test/test.c +++ b/test/test.c @@ -57,15 +57,26 @@ static unsigned failpoint; static char tokens_buffer[MAX_TOKENS]; static char *tokp; +/* + * Static working areas, the following areas can be used for threads or + * used as temporary buffers. + */ WORKING_AREA(waT0, THREADS_STACK_SIZE); WORKING_AREA(waT1, THREADS_STACK_SIZE); WORKING_AREA(waT2, THREADS_STACK_SIZE); WORKING_AREA(waT3, THREADS_STACK_SIZE); WORKING_AREA(waT4, THREADS_STACK_SIZE); -void *wa[MAX_THREADS] = {waT0, waT1, waT2, waT3, waT4}; +/* + * Pointers to the spawned threads. + */ Thread *threads[MAX_THREADS]; +/* + * Pointers to the working areas. + */ +void * const wa[5] = {waT0, waT1, waT2, waT3, waT4}; + /* * Console output. */ diff --git a/test/test.h b/test/test.h index 17972b5c6..fca9da8b1 100644 --- a/test/test.h +++ b/test/test.h @@ -94,12 +94,12 @@ extern "C" { } extern Thread *threads[MAX_THREADS]; -extern void *wa[MAX_THREADS]; extern WORKING_AREA(waT0, THREADS_STACK_SIZE); extern WORKING_AREA(waT1, THREADS_STACK_SIZE); extern WORKING_AREA(waT2, THREADS_STACK_SIZE); extern WORKING_AREA(waT3, THREADS_STACK_SIZE); extern WORKING_AREA(waT4, THREADS_STACK_SIZE); +extern void * const wa[]; extern bool_t test_timer_done; #endif /* _TEST_H_ */ diff --git a/test/testserial.c b/test/testserial.c index ca9174698..6781a3785 100644 --- a/test/testserial.c +++ b/test/testserial.c @@ -196,7 +196,7 @@ static void serial2_execute(void) { dflags_t flags; /* Asynchronous test using the direct APIs.*/ - n = chFDDWrite(&fdd, "ABCDEFGH", TEST_QUEUES_SIZE); + n = chFDDWrite(&fdd, (uint8_t *)"ABCDEFGH", TEST_QUEUES_SIZE); test_assert(1, n == TEST_QUEUES_SIZE, "unexpected write condition"); n = chFDDRead(&fdd, wa[1], TEST_QUEUES_SIZE); test_assert(2, n == TEST_QUEUES_SIZE, "unexpected read condition"); @@ -206,7 +206,7 @@ static void serial2_execute(void) { test_assert(4, flags == 0, "unexpected error condition"); /* Input overflow testing.*/ - n = chFDDWrite(&fdd, "ABCDEFGH", TEST_QUEUES_SIZE); + n = chFDDWrite(&fdd, (uint8_t *)"ABCDEFGH", TEST_QUEUES_SIZE); test_assert(5, n == TEST_QUEUES_SIZE, "unexpected write condition"); /* The following operation will fail to loopback because the input queue * is full.*/ @@ -217,7 +217,7 @@ static void serial2_execute(void) { test_assert(7, n == TEST_QUEUES_SIZE, "unexpected read condition"); /* Asynchronous test using the channel APIs.*/ - n = chIOWrite(&fdd, "ABCDEFGH", TEST_QUEUES_SIZE); + n = chIOWrite(&fdd, (uint8_t *)"ABCDEFGH", TEST_QUEUES_SIZE); test_assert(8, n == TEST_QUEUES_SIZE, "unexpected write condition"); n = chIORead(&fdd, wa[1], TEST_QUEUES_SIZE); test_assert(9, n == TEST_QUEUES_SIZE, "unexpected read condition"); diff --git a/todo.txt b/todo.txt index e9628ec12..1d674618a 100644 --- a/todo.txt +++ b/todo.txt @@ -9,7 +9,7 @@ After 1.2.0: ? Move the serial drivers implementations in library. Better keep the core as compact as possible. * Add tests documentation to the general documentation via doxygen. -* Static object initializers. +X Static object initializers. - Remove any instance of unnamed structures/unions. - Objects registry in the kernel. - OSEK-style simple tasks within the idle thread.