diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-07-30 14:23:37 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-07-30 14:23:37 +0000 |
commit | 64403d8f188725bc5814813371382bc148956a83 (patch) | |
tree | d6bdfcc69266e383071e50645a1ecee3e08df786 /test | |
parent | 9cd24294b8b5c32af4f64762eb99868b1a5c7b75 (diff) | |
download | ChibiOS-64403d8f188725bc5814813371382bc148956a83.tar.gz ChibiOS-64403d8f188725bc5814813371382bc148956a83.tar.bz2 ChibiOS-64403d8f188725bc5814813371382bc148956a83.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6048 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'test')
-rw-r--r-- | test/testbmk.c | 3 | ||||
-rw-r--r-- | test/testmbox.c | 2 | ||||
-rw-r--r-- | test/testsem.c | 18 |
3 files changed, 12 insertions, 11 deletions
diff --git a/test/testbmk.c b/test/testbmk.c index 293dbd607..c04239817 100644 --- a/test/testbmk.c +++ b/test/testbmk.c @@ -218,7 +218,8 @@ static void bmk4_execute(void) { thread_t *tp;
uint32_t n;
- tp = threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority()+1, thread4, NULL);
+ tp = threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority()+1,
+ thread4, NULL);
n = 0;
test_wait_tick();
test_start_timer(1000);
diff --git a/test/testmbox.c b/test/testmbox.c index 0ba52aa09..1ca34dadc 100644 --- a/test/testmbox.c +++ b/test/testmbox.c @@ -80,7 +80,7 @@ static void mbox1_execute(void) { /*
* Testing initial space.
*/
- test_assert(1, chMBGetFreeCountI(&mb1) == MB_SIZE, "wrong size");
+ test_assert_lock(1, chMBGetFreeCountI(&mb1) == MB_SIZE, "wrong size");
/*
* Testing enqueuing and backward circularity.
diff --git a/test/testsem.c b/test/testsem.c index d73a5e11b..0810300ea 100644 --- a/test/testsem.c +++ b/test/testsem.c @@ -104,7 +104,7 @@ static void sem1_execute(void) { chSemAddCounterI(&sem1, 2);
chSysUnlock();
test_wait_threads();
- test_assert(2, chSemGetCounterI(&sem1) == 1, "invalid counter");
+ test_assert_lock(2, chSemGetCounterI(&sem1) == 1, "invalid counter");
}
ROMCONST struct testcase testsem1 = {
@@ -252,7 +252,7 @@ static void sem4_execute(void) { /* Creates a taken binary semaphore.*/
chBSemObjectInit(&bsem, TRUE);
chBSemReset(&bsem, TRUE);
- test_assert(1, chBSemGetStateI(&bsem) == TRUE, "not taken");
+ test_assert_lock(1, chBSemGetStateI(&bsem) == TRUE, "not taken");
/* Starts a signaler thread at a lower priority.*/
threads[0] = chThdCreateStatic(wa[0], WA_SIZE,
@@ -262,18 +262,18 @@ static void sem4_execute(void) { chBSemWait(&bsem);
/* The binary semaphore is expected to be taken.*/
- test_assert(2, chBSemGetStateI(&bsem) == TRUE, "not taken");
-
+ test_assert_lock(2, chBSemGetStateI(&bsem) == TRUE, "not taken");
+
/* Releasing it, check both the binary semaphore state and the underlying
counter semaphore state..*/
chBSemSignal(&bsem);
- test_assert(3, chBSemGetStateI(&bsem) == FALSE, "still taken");
- test_assert(4, chSemGetCounterI(&bsem.bs_sem) == 1, "unexpected counter");
-
+ test_assert_lock(3, chBSemGetStateI(&bsem) == FALSE, "still taken");
+ test_assert_lock(4, chSemGetCounterI(&bsem.bs_sem) == 1, "unexpected counter");
+
/* Checking signaling overflow, the counter must not go beyond 1.*/
chBSemSignal(&bsem);
- test_assert(3, chBSemGetStateI(&bsem) == FALSE, "taken");
- test_assert(5, chSemGetCounterI(&bsem.bs_sem) == 1, "unexpected counter");
+ test_assert_lock(3, chBSemGetStateI(&bsem) == FALSE, "taken");
+ test_assert_lock(5, chSemGetCounterI(&bsem.bs_sem) == 1, "unexpected counter");
}
ROMCONST struct testcase testsem4 = {
|