From 0d96f5c78e54d267ef1ca230fe20af1ca090e1d6 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 16 Jun 2013 12:21:30 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@5859 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- test/test.c | 4 ++-- test/testevt.c | 6 +++--- test/testmtx.c | 4 ++-- test/testsem.c | 2 +- test/testthd.c | 8 ++++---- 5 files changed, 12 insertions(+), 12 deletions(-) (limited to 'test') 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); } -- cgit v1.2.3