aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test.c13
-rw-r--r--test/test.h2
-rw-r--r--test/testserial.c6
3 files changed, 16 insertions, 5 deletions
diff --git a/test/test.c b/test/test.c
index abbc1f0eb..8d709a5b2 100644
--- a/test/test.c
+++ b/test/test.c
@@ -57,16 +57,27 @@ 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.
*/
static BaseChannel *chp;
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");