aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test.c10
-rw-r--r--test/test.h2
-rw-r--r--test/testbmk.c28
-rw-r--r--test/testcond.c20
-rw-r--r--test/testdyn.c6
-rw-r--r--test/testmsg.c2
-rw-r--r--test/testmtx.c26
-rw-r--r--test/testpools.c2
-rw-r--r--test/testrdy.c20
-rw-r--r--test/testsem.c10
10 files changed, 63 insertions, 63 deletions
diff --git a/test/test.c b/test/test.c
index b603a20b8..83be7410a 100644
--- a/test/test.c
+++ b/test/test.c
@@ -83,11 +83,11 @@ static bool_t local_fail, global_fail;
static char *failmsg;
static char tokens_buffer[MAX_TOKENS];
static char *tokp;
-static WorkingArea(waT0, THREADS_STACK_SIZE);
-static WorkingArea(waT1, THREADS_STACK_SIZE);
-static WorkingArea(waT2, THREADS_STACK_SIZE);
-static WorkingArea(waT3, THREADS_STACK_SIZE);
-static WorkingArea(waT4, THREADS_STACK_SIZE);
+static WORKING_AREA(waT0, THREADS_STACK_SIZE);
+static WORKING_AREA(waT1, THREADS_STACK_SIZE);
+static WORKING_AREA(waT2, THREADS_STACK_SIZE);
+static WORKING_AREA(waT3, THREADS_STACK_SIZE);
+static WORKING_AREA(waT4, THREADS_STACK_SIZE);
void *wa[MAX_THREADS] = {waT0, waT1, waT2, waT3, waT4};
Thread *threads[MAX_THREADS];
diff --git a/test/test.h b/test/test.h
index 864b12e4f..fe850faf1 100644
--- a/test/test.h
+++ b/test/test.h
@@ -29,7 +29,7 @@
#else
#define THREADS_STACK_SIZE 128
#endif
-#define STKSIZE UserStackSize(THREADS_STACK_SIZE)
+#define WA_SIZE THD_WA_SIZE(THREADS_STACK_SIZE)
struct testcase {
char *(*gettest)(void);
diff --git a/test/testbmk.c b/test/testbmk.c
index 02b810e1f..19775a2d3 100644
--- a/test/testbmk.c
+++ b/test/testbmk.c
@@ -59,7 +59,7 @@ static char *bmk1_gettest(void) {
static void bmk1_execute(void) {
uint32_t n;
- threads[0] = chThdCreateFast(chThdGetPriority()-1, wa[0], STKSIZE, thread1);
+ threads[0] = chThdCreateFast(chThdGetPriority()-1, wa[0], WA_SIZE, thread1);
n = msg_loop_test(threads[0]);
chThdTerminate(threads[0]);
test_wait_threads();
@@ -85,7 +85,7 @@ static char *bmk2_gettest(void) {
static void bmk2_execute(void) {
uint32_t n;
- threads[0] = chThdCreateFast(chThdGetPriority()+1, wa[0], STKSIZE, thread1);
+ threads[0] = chThdCreateFast(chThdGetPriority()+1, wa[0], WA_SIZE, thread1);
n = msg_loop_test(threads[0]);
chThdTerminate(threads[0]);
test_wait_threads();
@@ -116,11 +116,11 @@ static char *bmk3_gettest(void) {
static void bmk3_execute(void) {
uint32_t n;
- threads[0] = chThdCreateFast(chThdGetPriority()+1, wa[0], STKSIZE, thread1);
- threads[1] = chThdCreateFast(chThdGetPriority()-2, wa[1], STKSIZE, thread2);
- threads[2] = chThdCreateFast(chThdGetPriority()-3, wa[2], STKSIZE, thread2);
- threads[3] = chThdCreateFast(chThdGetPriority()-4, wa[3], STKSIZE, thread2);
- threads[4] = chThdCreateFast(chThdGetPriority()-5, wa[4], STKSIZE, thread2);
+ threads[0] = chThdCreateFast(chThdGetPriority()+1, wa[0], WA_SIZE, thread1);
+ threads[1] = chThdCreateFast(chThdGetPriority()-2, wa[1], WA_SIZE, thread2);
+ threads[2] = chThdCreateFast(chThdGetPriority()-3, wa[2], WA_SIZE, thread2);
+ threads[3] = chThdCreateFast(chThdGetPriority()-4, wa[3], WA_SIZE, thread2);
+ threads[4] = chThdCreateFast(chThdGetPriority()-5, wa[4], WA_SIZE, thread2);
n = msg_loop_test(threads[0]);
chThdTerminate(threads[0]);
test_wait_threads();
@@ -151,7 +151,7 @@ static void bmk4_execute(void) {
test_wait_tick();
test_start_timer(1000);
do {
- chThdWait(chThdCreateFast(prio, wap, STKSIZE, thread2));
+ chThdWait(chThdCreateFast(prio, wap, WA_SIZE, thread2));
n++;
#if defined(WIN32)
ChkIntSources();
@@ -182,7 +182,7 @@ static void bmk5_execute(void) {
test_wait_tick();
test_start_timer(1000);
do {
- chThdCreateFast(prio, wap, STKSIZE, thread2);
+ chThdCreateFast(prio, wap, WA_SIZE, thread2);
n++;
#if defined(WIN32)
ChkIntSources();
@@ -220,11 +220,11 @@ static void bmk6_setup(void) {
static void bmk6_execute(void) {
uint32_t n;
- threads[0] = chThdCreateFast(chThdGetPriority()+1, wa[0], STKSIZE, thread3);
- threads[1] = chThdCreateFast(chThdGetPriority()+2, wa[1], STKSIZE, thread3);
- threads[2] = chThdCreateFast(chThdGetPriority()+3, wa[2], STKSIZE, thread3);
- threads[3] = chThdCreateFast(chThdGetPriority()+4, wa[3], STKSIZE, thread3);
- threads[4] = chThdCreateFast(chThdGetPriority()+5, wa[4], STKSIZE, thread3);
+ threads[0] = chThdCreateFast(chThdGetPriority()+1, wa[0], WA_SIZE, thread3);
+ threads[1] = chThdCreateFast(chThdGetPriority()+2, wa[1], WA_SIZE, thread3);
+ threads[2] = chThdCreateFast(chThdGetPriority()+3, wa[2], WA_SIZE, thread3);
+ threads[3] = chThdCreateFast(chThdGetPriority()+4, wa[3], WA_SIZE, thread3);
+ threads[4] = chThdCreateFast(chThdGetPriority()+5, wa[4], WA_SIZE, thread3);
n = 0;
test_wait_tick();
diff --git a/test/testcond.c b/test/testcond.c
index 07c2a441e..e202a0d15 100644
--- a/test/testcond.c
+++ b/test/testcond.c
@@ -53,11 +53,11 @@ static void cond1_execute(void) {
// Bacause priority inheritance.
tprio_t prio = chThdGetPriority();
- threads[0] = chThdCreate(prio+1, 0, wa[0], STKSIZE, thread1, "E");
- threads[1] = chThdCreate(prio+2, 0, wa[1], STKSIZE, thread1, "D");
- threads[2] = chThdCreate(prio+3, 0, wa[2], STKSIZE, thread1, "C");
- threads[3] = chThdCreate(prio+4, 0, wa[3], STKSIZE, thread1, "B");
- threads[4] = chThdCreate(prio+5, 0, wa[4], STKSIZE, thread1, "A");
+ threads[0] = chThdCreate(prio+1, 0, wa[0], WA_SIZE, thread1, "E");
+ threads[1] = chThdCreate(prio+2, 0, wa[1], WA_SIZE, thread1, "D");
+ threads[2] = chThdCreate(prio+3, 0, wa[2], WA_SIZE, thread1, "C");
+ threads[3] = chThdCreate(prio+4, 0, wa[3], WA_SIZE, thread1, "B");
+ threads[4] = chThdCreate(prio+5, 0, wa[4], WA_SIZE, thread1, "A");
test_assert(prio == chThdGetPriority(), "priority return failure");
chCondSignal(&c1);
chCondSignal(&c1);
@@ -84,11 +84,11 @@ static void cond2_execute(void) {
// Bacause priority inheritance.
tprio_t prio = chThdGetPriority();
- threads[0] = chThdCreate(prio+1, 0, wa[0], STKSIZE, thread1, "E");
- threads[1] = chThdCreate(prio+2, 0, wa[1], STKSIZE, thread1, "D");
- threads[2] = chThdCreate(prio+3, 0, wa[2], STKSIZE, thread1, "C");
- threads[3] = chThdCreate(prio+4, 0, wa[3], STKSIZE, thread1, "B");
- threads[4] = chThdCreate(prio+5, 0, wa[4], STKSIZE, thread1, "A");
+ threads[0] = chThdCreate(prio+1, 0, wa[0], WA_SIZE, thread1, "E");
+ threads[1] = chThdCreate(prio+2, 0, wa[1], WA_SIZE, thread1, "D");
+ threads[2] = chThdCreate(prio+3, 0, wa[2], WA_SIZE, thread1, "C");
+ threads[3] = chThdCreate(prio+4, 0, wa[3], WA_SIZE, thread1, "B");
+ threads[4] = chThdCreate(prio+5, 0, wa[4], WA_SIZE, thread1, "A");
test_assert(prio == chThdGetPriority(), "priority return failure");
chCondBroadcast(&c1);
test_wait_threads();
diff --git a/test/testdyn.c b/test/testdyn.c
index 0751e052a..37b6b9bc4 100644
--- a/test/testdyn.c
+++ b/test/testdyn.c
@@ -48,9 +48,9 @@ static void dyn1_execute(void) {
/* Test skipped if the heap is already fragmented. */
if ((n = chHeapStatus(&sz)) == 1) {
/* Starting threads from the heap. */
- threads[0] = chThdCreateFromHeap(UserStackSize(THREADS_STACK_SIZE),
+ threads[0] = chThdCreateFromHeap(THD_WA_SIZE(THREADS_STACK_SIZE),
prio-1, thread, "A");
- threads[1] = chThdCreateFromHeap(UserStackSize(THREADS_STACK_SIZE),
+ threads[1] = chThdCreateFromHeap(THD_WA_SIZE(THREADS_STACK_SIZE),
prio-2, thread, "B");
test_assert((threads[0] != NULL) &&
@@ -88,7 +88,7 @@ static char *dyn2_gettest(void) {
static void dyn2_setup(void) {
- chPoolInit(&mp1, UserStackSize(THREADS_STACK_SIZE));
+ chPoolInit(&mp1, THD_WA_SIZE(THREADS_STACK_SIZE));
}
static void dyn2_teardown(void) {
diff --git a/test/testmsg.c b/test/testmsg.c
index fcf811fa1..735375a16 100644
--- a/test/testmsg.c
+++ b/test/testmsg.c
@@ -47,7 +47,7 @@ static msg_t thread(void *p) {
static void msg1_execute(void) {
msg_t msg;
- threads[0] = chThdCreateStatic(wa[0], STKSIZE, chThdGetPriority()-1, thread, chThdSelf());
+ threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority()-1, thread, chThdSelf());
do {
chMsgRelease(msg = chMsgWait());
if (msg)
diff --git a/test/testmtx.c b/test/testmtx.c
index 0bf69cbf7..4d8df7d02 100644
--- a/test/testmtx.c
+++ b/test/testmtx.c
@@ -52,11 +52,11 @@ static void mtx1_execute(void) {
tprio_t prio = chThdGetPriority(); // Bacause priority inheritance.
chMtxLock(&m1);
- threads[0] = chThdCreateStatic(wa[0], STKSIZE, prio+1, thread1, "E");
- threads[1] = chThdCreateStatic(wa[1], STKSIZE, prio+2, thread1, "D");
- threads[2] = chThdCreateStatic(wa[2], STKSIZE, prio+3, thread1, "C");
- threads[3] = chThdCreateStatic(wa[3], STKSIZE, prio+4, thread1, "B");
- threads[4] = chThdCreateStatic(wa[4], STKSIZE, prio+5, thread1, "A");
+ threads[0] = chThdCreateStatic(wa[0], WA_SIZE, prio+1, thread1, "E");
+ threads[1] = chThdCreateStatic(wa[1], WA_SIZE, prio+2, thread1, "D");
+ threads[2] = chThdCreateStatic(wa[2], WA_SIZE, prio+3, thread1, "C");
+ threads[3] = chThdCreateStatic(wa[3], WA_SIZE, prio+4, thread1, "B");
+ threads[4] = chThdCreateStatic(wa[4], WA_SIZE, prio+5, thread1, "A");
chMtxUnlock();
test_wait_threads();
test_assert(prio == chThdGetPriority(), "priority return failure");
@@ -117,9 +117,9 @@ static msg_t thread4(void *p) {
*/
static void mtx2_execute(void) {
- threads[0] = chThdCreateStatic(wa[0], STKSIZE, chThdGetPriority()-1, thread2, "A");
- threads[1] = chThdCreateStatic(wa[1], STKSIZE, chThdGetPriority()-3, thread3, "C");
- threads[2] = chThdCreateStatic(wa[2], STKSIZE, chThdGetPriority()-2, thread4, "B");
+ threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority()-1, thread2, "A");
+ threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriority()-3, thread3, "C");
+ threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriority()-2, thread4, "B");
test_wait_threads();
test_assert_sequence("ABC");
}
@@ -206,11 +206,11 @@ static msg_t thread9(void *p) {
*/
static void mtx3_execute(void) {
- threads[0] = chThdCreateStatic(wa[0], STKSIZE, chThdGetPriority()-5, thread5, "E");
- threads[1] = chThdCreateStatic(wa[1], STKSIZE, chThdGetPriority()-4, thread6, "D");
- threads[2] = chThdCreateStatic(wa[2], STKSIZE, chThdGetPriority()-3, thread7, "C");
- threads[3] = chThdCreateStatic(wa[3], STKSIZE, chThdGetPriority()-2, thread8, "B");
- threads[4] = chThdCreateStatic(wa[4], STKSIZE, chThdGetPriority()-1, thread9, "A");
+ threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority()-5, thread5, "E");
+ threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriority()-4, thread6, "D");
+ threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriority()-3, thread7, "C");
+ threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriority()-2, thread8, "B");
+ threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriority()-1, thread9, "A");
test_wait_threads();
test_assert_sequence("ABCDE");
}
diff --git a/test/testpools.c b/test/testpools.c
index 2d3ee0f00..d3f451c73 100644
--- a/test/testpools.c
+++ b/test/testpools.c
@@ -32,7 +32,7 @@ static char *pools1_gettest(void) {
static void pools1_setup(void) {
- chPoolInit(&mp1, UserStackSize(THREADS_STACK_SIZE));
+ chPoolInit(&mp1, THD_WA_SIZE(THREADS_STACK_SIZE));
}
static void pools1_teardown(void) {
diff --git a/test/testrdy.c b/test/testrdy.c
index 2d39e5ff4..a9b52701e 100644
--- a/test/testrdy.c
+++ b/test/testrdy.c
@@ -40,11 +40,11 @@ static void rdy1_teardown(void) {
static void rdy1_execute(void) {
- threads[0] = chThdCreateStatic(wa[0], STKSIZE, chThdGetPriority()-5, thread, "E");
- threads[1] = chThdCreateStatic(wa[1], STKSIZE, chThdGetPriority()-4, thread, "D");
- threads[2] = chThdCreateStatic(wa[2], STKSIZE, chThdGetPriority()-3, thread, "C");
- threads[3] = chThdCreateStatic(wa[3], STKSIZE, chThdGetPriority()-2, thread, "B");
- threads[4] = chThdCreateStatic(wa[4], STKSIZE, chThdGetPriority()-1, thread, "A");
+ threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority()-5, thread, "E");
+ threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriority()-4, thread, "D");
+ threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriority()-3, thread, "C");
+ threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriority()-2, thread, "B");
+ threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriority()-1, thread, "A");
test_wait_threads();
test_assert_sequence("ABCDE");
}
@@ -69,11 +69,11 @@ static void rdy2_teardown(void) {
static void rdy2_execute(void) {
- threads[1] = chThdCreateStatic(wa[1], STKSIZE, chThdGetPriority()-4, thread, "D");
- threads[0] = chThdCreateStatic(wa[0], STKSIZE, chThdGetPriority()-5, thread, "E");
- threads[4] = chThdCreateStatic(wa[4], STKSIZE, chThdGetPriority()-1, thread, "A");
- threads[3] = chThdCreateStatic(wa[3], STKSIZE, chThdGetPriority()-2, thread, "B");
- threads[2] = chThdCreateStatic(wa[2], STKSIZE, chThdGetPriority()-3, thread, "C");
+ threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriority()-4, thread, "D");
+ threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority()-5, thread, "E");
+ threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriority()-1, thread, "A");
+ threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriority()-2, thread, "B");
+ threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriority()-3, thread, "C");
test_wait_threads();
test_assert_sequence("ABCDE");
}
diff --git a/test/testsem.c b/test/testsem.c
index 26c5556f5..72ed6126f 100644
--- a/test/testsem.c
+++ b/test/testsem.c
@@ -49,11 +49,11 @@ static msg_t thread(void *p) {
static void sem1_execute(void) {
- threads[0] = chThdCreateStatic(wa[0], STKSIZE, chThdGetPriority()+5, thread, "A");
- threads[1] = chThdCreateStatic(wa[1], STKSIZE, chThdGetPriority()+1, thread, "B");
- threads[2] = chThdCreateStatic(wa[2], STKSIZE, chThdGetPriority()+3, thread, "C");
- threads[3] = chThdCreateStatic(wa[3], STKSIZE, chThdGetPriority()+4, thread, "D");
- threads[4] = chThdCreateStatic(wa[4], STKSIZE, chThdGetPriority()+2, thread, "E");
+ threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority()+5, thread, "A");
+ threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriority()+1, thread, "B");
+ threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriority()+3, thread, "C");
+ threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriority()+4, thread, "D");
+ threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriority()+2, thread, "E");
chSemSignal(&sem1);
chSemSignal(&sem1);
chSemSignal(&sem1);