diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-03-07 15:32:40 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-03-07 15:32:40 +0000 |
commit | d9ff829a71d7b5723206e4923bcab6cbe3f5b715 (patch) | |
tree | 5911229eb2c3234ecafc48eefda439814c986f5a /test | |
parent | d785c8a7e5e58dc2ef41afdfee47e605ef1216f5 (diff) | |
download | ChibiOS-d9ff829a71d7b5723206e4923bcab6cbe3f5b715.tar.gz ChibiOS-d9ff829a71d7b5723206e4923bcab6cbe3f5b715.tar.bz2 ChibiOS-d9ff829a71d7b5723206e4923bcab6cbe3f5b715.zip |
Fixes to the zero timeout. Added a test case.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@813 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'test')
-rw-r--r-- | test/testsem.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/testsem.c b/test/testsem.c index 4f2943964..07fd40840 100644 --- a/test/testsem.c +++ b/test/testsem.c @@ -81,13 +81,18 @@ static void sem2_setup(void) { static void sem2_execute(void) {
int i;
systime_t target_time;
+ msg_t msg;
+
+ msg= chSemWaitTimeout(&sem1, TIME_ZERO);
+ test_assert(msg == RDY_TIMEOUT, "#1");
target_time = chSysGetTime() + MS2ST(5 * 500);
for (i = 0; i < 5; i++) {
test_emit_token('A' + i);
- chSemWaitTimeout(&sem1, MS2ST(500));
- test_assert(isempty(&sem1.s_queue), "#1"); /* Queue not empty */
- test_assert(&sem1.s_cnt != 0, "#2"); /* Counter not zero */
+ msg = chSemWaitTimeout(&sem1, MS2ST(500));
+ test_assert(msg == RDY_TIMEOUT, "#2");
+ test_assert(isempty(&sem1.s_queue), "#3"); /* Queue not empty */
+ test_assert(&sem1.s_cnt != 0, "#4"); /* Counter not zero */
}
test_assert_sequence("ABCDE");
test_assert_time_window(target_time, target_time + ALLOWED_DELAY);
|