aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test.c4
-rw-r--r--test/testevt.c6
-rw-r--r--test/testmtx.c4
-rw-r--r--test/testsem.c2
-rw-r--r--test/testthd.c8
5 files changed, 12 insertions, 12 deletions
diff --git a/test/test.c b/test/test.c
index 1de688a28..b7c92ceaf 100644
--- a/test/test.c
+++ b/test/test.c
@@ -183,7 +183,7 @@ bool_t _test_assert_sequence(unsigned point, char *expected) {
bool_t _test_assert_time_window(unsigned point, systime_t start, systime_t end) {
- return _test_assert(point, chTimeIsWithin(start, end));
+ return _test_assert(point, chVTIsSystemTimeWithin(start, end));
}
/*
@@ -245,7 +245,7 @@ void test_cpu_pulse(unsigned duration) {
systime_t test_wait_tick(void) {
chThdSleep(1);
- return chTimeNow();
+ return chVTGetSystemTime();
}
/*
diff --git a/test/testevt.c b/test/testevt.c
index 0a014374e..d1291c406 100644
--- a/test/testevt.c
+++ b/test/testevt.c
@@ -166,7 +166,7 @@ static void evt2_execute(void) {
* Test on chEvtWaitOne() with wait.
*/
test_wait_tick();
- target_time = chTimeNow() + MS2ST(50);
+ target_time = chVTGetSystemTime() + MS2ST(50);
threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority() - 1,
thread1, chThdSelf());
m = chEvtWaitOne(ALL_EVENTS);
@@ -189,7 +189,7 @@ static void evt2_execute(void) {
* Test on chEvtWaitAny() with wait.
*/
test_wait_tick();
- target_time = chTimeNow() + MS2ST(50);
+ target_time = chVTGetSystemTime() + MS2ST(50);
threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority() - 1,
thread1, chThdSelf());
m = chEvtWaitAny(ALL_EVENTS);
@@ -207,7 +207,7 @@ static void evt2_execute(void) {
chEvtRegisterMask(&es1, &el1, 1);
chEvtRegisterMask(&es2, &el2, 4);
test_wait_tick();
- target_time = chTimeNow() + MS2ST(50);
+ target_time = chVTGetSystemTime() + MS2ST(50);
threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority() - 1,
thread2, "A");
m = chEvtWaitAll(5);
diff --git a/test/testmtx.c b/test/testmtx.c
index 149f47d11..f83a9744a 100644
--- a/test/testmtx.c
+++ b/test/testmtx.c
@@ -191,7 +191,7 @@ static void mtx2_execute(void) {
systime_t time;
test_wait_tick();
- time = chTimeNow();
+ time = chVTGetSystemTime();
threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority()-1, thread2H, 0);
threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriority()-2, thread2M, 0);
threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriority()-3, thread2L, 0);
@@ -309,7 +309,7 @@ static void mtx3_execute(void) {
systime_t time;
test_wait_tick();
- time = chTimeNow();
+ time = chVTGetSystemTime();
threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority()-5, thread3LL, 0);
threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriority()-4, thread3L, 0);
threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriority()-3, thread3M, 0);
diff --git a/test/testsem.c b/test/testsem.c
index d4b990797..20774b618 100644
--- a/test/testsem.c
+++ b/test/testsem.c
@@ -169,7 +169,7 @@ static void sem2_execute(void) {
* Testing timeout condition.
*/
test_wait_tick();
- target_time = chTimeNow() + MS2ST(5 * 500);
+ target_time = chVTGetSystemTime() + MS2ST(5 * 500);
for (i = 0; i < 5; i++) {
test_emit_token('A' + i);
msg = chSemWaitTimeout(&sem1, MS2ST(500));
diff --git a/test/testthd.c b/test/testthd.c
index 35b413acf..9916ca253 100644
--- a/test/testthd.c
+++ b/test/testthd.c
@@ -192,22 +192,22 @@ static void thd4_execute(void) {
test_wait_tick();
/* Timeouts in microseconds.*/
- time = chTimeNow();
+ time = chVTGetSystemTime();
chThdSleepMicroseconds(100000);
test_assert_time_window(1, time + US2ST(100000), time + US2ST(100000) + 1);
/* Timeouts in milliseconds.*/
- time = chTimeNow();
+ time = chVTGetSystemTime();
chThdSleepMilliseconds(100);
test_assert_time_window(2, time + MS2ST(100), time + MS2ST(100) + 1);
/* Timeouts in seconds.*/
- time = chTimeNow();
+ time = chVTGetSystemTime();
chThdSleepSeconds(1);
test_assert_time_window(3, time + S2ST(1), time + S2ST(1) + 1);
/* Absolute timelines.*/
- time = chTimeNow() + MS2ST(100);
+ time = chVTGetSystemTime() + MS2ST(100);
chThdSleepUntil(time);
test_assert_time_window(4, time, time + 1);
}