From dfb876b3a1263c627465dfc6e3b76d5bab6c052e Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 16 Sep 2012 08:41:45 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4670 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- test/testevt.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/testevt.c b/test/testevt.c index 9ad9906d2..cc42167a0 100644 --- a/test/testevt.c +++ b/test/testevt.c @@ -78,7 +78,7 @@ static EVENTSOURCE_DECL(es2); static void evt1_setup(void) { - chEvtClearFlags(ALL_EVENTS); + chEvtGetAndClearEvents(ALL_EVENTS); } static void h1(eventid_t id) {(void)id;test_emit_token('A');} @@ -131,7 +131,7 @@ ROMCONST struct testcase testevt1 = { static void evt2_setup(void) { - chEvtClearFlags(ALL_EVENTS); + chEvtGetAndClearEvents(ALL_EVENTS); } static msg_t thread1(void *p) { @@ -158,12 +158,12 @@ static void evt2_execute(void) { /* * Test on chEvtWaitOne() without wait. */ - chEvtAddFlags(5); + chEvtAddEvents(5); m = chEvtWaitOne(ALL_EVENTS); test_assert(1, m == 1, "single event error"); m = chEvtWaitOne(ALL_EVENTS); test_assert(2, m == 4, "single event error"); - m = chEvtClearFlags(ALL_EVENTS); + m = chEvtGetAndClearEvents(ALL_EVENTS); test_assert(3, m == 0, "stuck event"); /* @@ -176,17 +176,17 @@ static void evt2_execute(void) { m = chEvtWaitOne(ALL_EVENTS); test_assert_time_window(4, target_time, target_time + ALLOWED_DELAY); test_assert(5, m == 1, "single event error"); - m = chEvtClearFlags(ALL_EVENTS); + m = chEvtGetAndClearEvents(ALL_EVENTS); test_assert(6, m == 0, "stuck event"); test_wait_threads(); /* * Test on chEvtWaitAny() without wait. */ - chEvtAddFlags(5); + chEvtAddEvents(5); m = chEvtWaitAny(ALL_EVENTS); test_assert(7, m == 5, "unexpected pending bit"); - m = chEvtClearFlags(ALL_EVENTS); + m = chEvtGetAndClearEvents(ALL_EVENTS); test_assert(8, m == 0, "stuck event"); /* @@ -199,7 +199,7 @@ static void evt2_execute(void) { m = chEvtWaitAny(ALL_EVENTS); test_assert_time_window(9, target_time, target_time + ALLOWED_DELAY); test_assert(10, m == 1, "single event error"); - m = chEvtClearFlags(ALL_EVENTS); + m = chEvtGetAndClearEvents(ALL_EVENTS); test_assert(11, m == 0, "stuck event"); test_wait_threads(); @@ -216,7 +216,7 @@ static void evt2_execute(void) { thread2, "A"); m = chEvtWaitAll(5); test_assert_time_window(12, target_time, target_time + ALLOWED_DELAY); - m = chEvtClearFlags(ALL_EVENTS); + m = chEvtGetAndClearEvents(ALL_EVENTS); test_assert(13, m == 0, "stuck event"); test_wait_threads(); chEvtUnregister(&es1, &el1); @@ -250,7 +250,7 @@ ROMCONST struct testcase testevt2 = { static void evt3_setup(void) { - chEvtClearFlags(ALL_EVENTS); + chEvtGetAndClearEvents(ALL_EVENTS); } static void evt3_execute(void) {