aboutsummaryrefslogtreecommitdiffstats
path: root/test/rt/configuration.xml
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-03-31 14:57:58 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-03-31 14:57:58 +0000
commite783e741f5951c0907ce0debec86cd266899a185 (patch)
tree85c6d12122d2669c8b58d4a8360d846c498a0b2e /test/rt/configuration.xml
parent7c20551c988918cdad797a343d2126820cd75e8f (diff)
downloadChibiOS-e783e741f5951c0907ce0debec86cd266899a185.tar.gz
ChibiOS-e783e741f5951c0907ce0debec86cd266899a185.tar.bz2
ChibiOS-e783e741f5951c0907ce0debec86cd266899a185.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9190 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'test/rt/configuration.xml')
-rw-r--r--test/rt/configuration.xml141
1 files changed, 140 insertions, 1 deletions
diff --git a/test/rt/configuration.xml b/test/rt/configuration.xml
index 607b4e474..a87534371 100644
--- a/test/rt/configuration.xml
+++ b/test/rt/configuration.xml
@@ -2402,7 +2402,7 @@ static THD_FUNCTION(evt_thread3, p) {
chEvtSignal((thread_t *)p, 1);
}
-static THD_FUNCTION(evt_thread4, p) {
+static THD_FUNCTION(evt_thread7, p) {
(void)p;
chEvtBroadcast(&es1);
@@ -2775,6 +2775,145 @@ test_wait_threads();]]></value>
</step>
</steps>
</case>
+ <case>
+ <brief>
+ <value>Events Flags wait timeouts.</value>
+ </brief>
+ <description>
+ <value>Timeout functionality is tested for chEvtWaitOneTimeout(), chEvtWaitAnyTimeout() and chEvtWaitAllTimeout().</value>
+ </description>
+ <condition>
+ <value />
+ </condition>
+ <various_code>
+ <setup_code>
+ <value><![CDATA[chEvtGetAndClearEvents(ALL_EVENTS);]]></value>
+ </setup_code>
+ <teardown_code>
+ <value />
+ </teardown_code>
+ <local_variables>
+ <value><![CDATA[eventmask_t m;]]></value>
+ </local_variables>
+ </various_code>
+ <steps>
+ <step>
+ <description>
+ <value>The functions are invoked first with TIME_IMMEDIATE timeout, the timeout condition is tested.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[m = chEvtWaitOneTimeout(ALL_EVENTS, TIME_IMMEDIATE);
+test_assert(m == 0, "spurious event");
+m = chEvtWaitAnyTimeout(ALL_EVENTS, TIME_IMMEDIATE);
+test_assert(m == 0, "spurious event");
+m = chEvtWaitAllTimeout(ALL_EVENTS, TIME_IMMEDIATE);
+test_assert(m == 0, "spurious event");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>The functions are invoked first with a 50mS timeout, the timeout condition is tested.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[m = chEvtWaitOneTimeout(ALL_EVENTS, MS2ST(50));
+test_assert(m == 0, "spurious event");
+m = chEvtWaitAnyTimeout(ALL_EVENTS, MS2ST(50));
+test_assert(m == 0, "spurious event");
+m = chEvtWaitAllTimeout(ALL_EVENTS, MS2ST(50));
+test_assert(m == 0, "spurious event");]]></value>
+ </code>
+ </step>
+ </steps>
+ </case>
+ <case>
+ <brief>
+ <value>Broadcasting using chEvtBroadcast().</value>
+ </brief>
+ <description>
+ <value>Functionality of chEvtBroadcast() is tested.</value>
+ </description>
+ <condition>
+ <value />
+ </condition>
+ <various_code>
+ <setup_code>
+ <value><![CDATA[chEvtGetAndClearEvents(ALL_EVENTS);
+chEvtObjectInit(&es1);
+chEvtObjectInit(&es2);]]></value>
+ </setup_code>
+ <teardown_code>
+ <value />
+ </teardown_code>
+ <local_variables>
+ <value><![CDATA[eventmask_t m;
+event_listener_t el1, el2;
+systime_t target_time;]]></value>
+ </local_variables>
+ </various_code>
+ <steps>
+ <step>
+ <description>
+ <value>Registering on two event sources associating them with flags 1 and 4.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[chEvtRegisterMask(&es1, &el1, 1);
+chEvtRegisterMask(&es2, &el2, 4);]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>Getting current time and starting a broadcaster thread, the thread broadcast the first Event Source immediately and the other after 50mS.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[target_time = test_wait_tick() + MS2ST(50);
+threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() - 1,
+ evt_thread7, "A");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>Calling chEvtWaitAll() then verifying that both event flags have been received after 50mS and that the event flags mask has been emptied.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[m = chEvtWaitAll(5);
+test_assert_time_window(target_time, target_time + ALLOWED_DELAY,
+ "out of time window");
+m = chEvtGetAndClearEvents(ALL_EVENTS);
+test_assert(m == 0, "stuck event");
+test_wait_threads();]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>Unregistering from the Event Sources.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[chEvtUnregister(&es1, &el1);
+chEvtUnregister(&es2, &el2);
+test_assert(!chEvtIsListeningI(&es1), "stuck listener");
+test_assert(!chEvtIsListeningI(&es2), "stuck listener");]]></value>
+ </code>
+ </step>
+ </steps>
+ </case>
</cases>
</sequence>
<sequence>