From baf05fcff5b16a2b8f182d7ac8b10c544e6d0f6e Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Mon, 19 Dec 2022 08:57:20 +0000 Subject: [PATCH] Fixed another test case failing with 16bits system time. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15895 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- test/rt/configuration.xml | 8 ++++---- test/rt/source/test/rt_test_sequence_006.c | 6 +++--- test/rt/source/test/rt_test_sequence_008.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/rt/configuration.xml b/test/rt/configuration.xml index 3478cf11d..bb6441e37 100644 --- a/test/rt/configuration.xml +++ b/test/rt/configuration.xml @@ -1323,10 +1323,10 @@ test_wait_threads();]]> @@ -1879,7 +1879,7 @@ static CONDVAR_DECL(c1); * * @param[in] duration CPU pulse duration in milliseconds */ -void test_cpu_pulse(unsigned duration) { +void test_cpu_pulse(time_msecs_t duration) { systime_t start, end, now; start = chThdGetTicksX(chThdGetSelfX()); diff --git a/test/rt/source/test/rt_test_sequence_006.c b/test/rt/source/test/rt_test_sequence_006.c index 3c89d6c08..32cdb9ad7 100644 --- a/test/rt/source/test/rt_test_sequence_006.c +++ b/test/rt/source/test/rt_test_sequence_006.c @@ -100,10 +100,10 @@ static void rt_test_006_001_execute(void) { { chSysLock(); time = chVTGetSystemTimeX(); - msg = chThdSuspendTimeoutS(&tr1, TIME_MS2I(1000)); + msg = chThdSuspendTimeoutS(&tr1, TIME_MS2I(10)); chSysUnlock(); - test_assert_time_window(chTimeAddX(time, TIME_MS2I(1000)), - chTimeAddX(time, TIME_MS2I(1000) + CH_CFG_ST_TIMEDELTA + 1), + test_assert_time_window(chTimeAddX(time, TIME_MS2I(10)), + chTimeAddX(time, TIME_MS2I(10) + CH_CFG_ST_TIMEDELTA + 1), "out of time window"); test_assert(NULL == tr1, "not NULL"); test_assert(MSG_TIMEOUT == msg, "wrong returned message"); diff --git a/test/rt/source/test/rt_test_sequence_008.c b/test/rt/source/test/rt_test_sequence_008.c index 5b7a7b371..f9845cf5e 100644 --- a/test/rt/source/test/rt_test_sequence_008.c +++ b/test/rt/source/test/rt_test_sequence_008.c @@ -67,7 +67,7 @@ static CONDVAR_DECL(c1); * * @param[in] duration CPU pulse duration in milliseconds */ -void test_cpu_pulse(unsigned duration) { +void test_cpu_pulse(time_msecs_t duration) { systime_t start, end, now; start = chThdGetTicksX(chThdGetSelfX());