diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-12-01 10:29:36 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-12-01 10:29:36 +0000 |
commit | c7da76627c4c5479ed91bd6709e17abc22691b84 (patch) | |
tree | 9c04a05b9cb2900de8428e08bea6e179436956c1 /test | |
parent | 5b59f89d98bc8d4ae1a7269ab1e09a6d8f649d2f (diff) | |
download | ChibiOS-c7da76627c4c5479ed91bd6709e17abc22691b84.tar.gz ChibiOS-c7da76627c4c5479ed91bd6709e17abc22691b84.tar.bz2 ChibiOS-c7da76627c4c5479ed91bd6709e17abc22691b84.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7551 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'test')
-rw-r--r-- | test/rt/testsem.c | 6 | ||||
-rw-r--r-- | test/rt/testthd.c | 16 |
2 files changed, 15 insertions, 7 deletions
diff --git a/test/rt/testsem.c b/test/rt/testsem.c index cb7f13bc2..87e9b187f 100644 --- a/test/rt/testsem.c +++ b/test/rt/testsem.c @@ -49,7 +49,7 @@ #if CH_CFG_USE_SEMAPHORES || defined(__DOXYGEN__)
-#define ALLOWED_DELAY MS2ST(5)
+#define ALLOWED_DELAY MS2ST(2)
/*
* Note, the static initializers are not really required because the
@@ -170,10 +170,10 @@ static void sem2_execute(void) { * Testing timeout condition.
*/
test_wait_tick();
- target_time = chVTGetSystemTime() + MS2ST(5 * 500);
+ target_time = chVTGetSystemTime() + MS2ST(5 * 50);
for (i = 0; i < 5; i++) {
test_emit_token('A' + i);
- msg = chSemWaitTimeout(&sem1, MS2ST(500));
+ msg = chSemWaitTimeout(&sem1, MS2ST(50));
test_assert(7, msg == MSG_TIMEOUT, "wrong wake-up message");
test_assert(8, queue_isempty(&sem1.s_queue), "queue not empty");
test_assert(9, sem1.s_cnt == 0, "counter not zero");
diff --git a/test/rt/testthd.c b/test/rt/testthd.c index 522e54b9b..d4d148169 100644 --- a/test/rt/testthd.c +++ b/test/rt/testthd.c @@ -194,22 +194,30 @@ static void thd4_execute(void) { /* Timeouts in microseconds.*/
time = chVTGetSystemTime();
chThdSleepMicroseconds(100000);
- test_assert_time_window(1, time + US2ST(100000), time + US2ST(100000) + 1);
+ test_assert_time_window(1,
+ time + US2ST(100000),
+ time + US2ST(100000) + CH_CFG_ST_TIMEDELTA);
/* Timeouts in milliseconds.*/
time = chVTGetSystemTime();
chThdSleepMilliseconds(100);
- test_assert_time_window(2, time + MS2ST(100), time + MS2ST(100) + 1);
+ test_assert_time_window(2,
+ time + MS2ST(100),
+ time + MS2ST(100) + CH_CFG_ST_TIMEDELTA);
/* Timeouts in seconds.*/
time = chVTGetSystemTime();
chThdSleepSeconds(1);
- test_assert_time_window(3, time + S2ST(1), time + S2ST(1) + 1);
+ test_assert_time_window(3,
+ time + S2ST(1),
+ time + S2ST(1) + CH_CFG_ST_TIMEDELTA);
/* Absolute timelines.*/
time = chVTGetSystemTime() + MS2ST(100);
chThdSleepUntil(time);
- test_assert_time_window(4, time, time + 1);
+ test_assert_time_window(4,
+ time,
+ time + CH_CFG_ST_TIMEDELTA);
}
ROMCONST struct testcase testthd4 = {
|