aboutsummaryrefslogtreecommitdiffstats
path: root/test/nil/configuration.xml
diff options
context:
space:
mode:
Diffstat (limited to 'test/nil/configuration.xml')
-rw-r--r--test/nil/configuration.xml165
1 files changed, 119 insertions, 46 deletions
diff --git a/test/nil/configuration.xml b/test/nil/configuration.xml
index 55003af45..e5cc2c075 100644
--- a/test/nil/configuration.xml
+++ b/test/nil/configuration.xml
@@ -65,7 +65,7 @@ THD_FUNCTION(test_support, arg) {
<value>Internal Tests</value>
</type>
<brief>
- <value>Threads Functionality</value>
+ <value>Threads Functionality.</value>
</brief>
<description>
<value>This sequence tests the ChibiOS/NIL functionalities related to threading.</value>
@@ -217,7 +217,7 @@ test_assert_time_window(time + 100,
<value>Internal Tests</value>
</type>
<brief>
- <value>Semaphores</value>
+ <value>Semaphores.</value>
</brief>
<description>
<value>This sequence tests the ChibiOS/NIL functionalities related to counter semaphores.</value>
@@ -236,7 +236,7 @@ static semaphore_t sem1;]]></value>
<value>Wait, Signal and Reset primitives are tested. The testing thread does not trigger a state change.</value>
</description>
<condition>
- <value />
+ <value>CH_CFG_USE_SEMAPHORES</value>
</condition>
<various_code>
<setup_code>
@@ -299,7 +299,7 @@ test_assert_lock(chSemGetCounterI(&sem1) == 2, "wrong counter value");]]></value
<value>Wait, Signal and Reset primitives are tested. The testing thread triggers a state change.</value>
</description>
<condition>
- <value />
+ <value>CH_CFG_USE_SEMAPHORES</value>
</condition>
<various_code>
<setup_code>
@@ -353,7 +353,7 @@ test_assert(MSG_RESET == msg, "wrong returned message");]]></value>
<value>Timeout on semaphores is tested.</value>
</description>
<condition>
- <value />
+ <value>CH_CFG_USE_SEMAPHORES</value>
</condition>
<various_code>
<setup_code>
@@ -363,7 +363,7 @@ test_assert(MSG_RESET == msg, "wrong returned message");]]></value>
<value><![CDATA[chSemReset(&sem1, 0);]]></value>
</teardown_code>
<local_variables>
- <value><![CDATA[systime_t time;
+ <value><![CDATA[systime_t time;
msg_t msg;]]></value>
</local_variables>
</various_code>
@@ -376,12 +376,12 @@ msg_t msg;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[time = chVTGetSystemTimeX();
-msg = chSemWaitTimeout(&sem1, MS2ST(1000));
-test_assert_time_window(time + MS2ST(1000),
- time + MS2ST(1000) + 1,
- "out of time window");
-test_assert_lock(chSemGetCounterI(&sem1) == 0, "wrong counter value");
+ <value><![CDATA[time = chVTGetSystemTimeX();
+msg = chSemWaitTimeout(&sem1, MS2ST(1000));
+test_assert_time_window(time + MS2ST(1000),
+ time + MS2ST(1000) + 1,
+ "out of time window");
+test_assert_lock(chSemGetCounterI(&sem1) == 0, "wrong counter value");
test_assert(MSG_TIMEOUT == msg, "wrong timeout message");]]></value>
</code>
</step>
@@ -393,12 +393,12 @@ test_assert(MSG_TIMEOUT == msg, "wrong timeout message");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[time = chVTGetSystemTimeX();
-msg = chSemWaitTimeout(&sem1, MS2ST(1000));
-test_assert_time_window(time + MS2ST(1000),
- time + MS2ST(1000) + 1,
- "out of time window");
-test_assert_lock(chSemGetCounterI(&sem1) == 0, "wrong counter value");
+ <value><![CDATA[time = chVTGetSystemTimeX();
+msg = chSemWaitTimeout(&sem1, MS2ST(1000));
+test_assert_time_window(time + MS2ST(1000),
+ time + MS2ST(1000) + 1,
+ "out of time window");
+test_assert_lock(chSemGetCounterI(&sem1) == 0, "wrong counter value");
test_assert(MSG_TIMEOUT == msg, "wrong timeout message");]]></value>
</code>
</step>
@@ -438,7 +438,7 @@ test_assert(MSG_TIMEOUT == msg, "wrong timeout message");]]></value>
<value />
</teardown_code>
<local_variables>
- <value><![CDATA[systime_t time;
+ <value><![CDATA[systime_t time;
msg_t msg;]]></value>
</local_variables>
</various_code>
@@ -451,10 +451,10 @@ msg_t msg;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chSysLock();
-msg = chThdSuspendTimeoutS(&gtr1, TIME_INFINITE);
-chSysUnlock();
-test_assert(NULL == gtr1, "not NULL");
+ <value><![CDATA[chSysLock();
+msg = chThdSuspendTimeoutS(&gtr1, TIME_INFINITE);
+chSysUnlock();
+test_assert(NULL == gtr1, "not NULL");
test_assert(MSG_OK == msg,"wrong returned message");]]></value>
</code>
</step>
@@ -466,14 +466,14 @@ test_assert(MSG_OK == msg,"wrong returned message");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chSysLock();
-time = chVTGetSystemTimeX();
-msg = chThdSuspendTimeoutS(&tr1, MS2ST(1000));
-chSysUnlock();
-test_assert_time_window(time + MS2ST(1000),
- time + MS2ST(1000) + 1,
- "out of time window");
-test_assert(NULL == tr1, "not NULL");
+ <value><![CDATA[chSysLock();
+time = chVTGetSystemTimeX();
+msg = chThdSuspendTimeoutS(&tr1, MS2ST(1000));
+chSysUnlock();
+test_assert_time_window(time + MS2ST(1000),
+ time + MS2ST(1000) + 1,
+ "out of time window");
+test_assert(NULL == tr1, "not NULL");
test_assert(MSG_TIMEOUT == msg, "wrong returned message");]]></value>
</code>
</step>
@@ -487,7 +487,7 @@ test_assert(MSG_TIMEOUT == msg, "wrong returned message");]]></value>
<value>Event flags functionality is tested.</value>
</description>
<condition>
- <value />
+ <value>CH_CFG_USE_EVENTS</value>
</condition>
<various_code>
<setup_code>
@@ -497,7 +497,7 @@ test_assert(MSG_TIMEOUT == msg, "wrong returned message");]]></value>
<value />
</teardown_code>
<local_variables>
- <value><![CDATA[systime_t time;
+ <value><![CDATA[systime_t time;
eventmask_t events;]]></value>
</local_variables>
</various_code>
@@ -510,10 +510,10 @@ eventmask_t events;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[time = chVTGetSystemTimeX();
-chEvtSignal(chThdGetSelfX(), 0x55);
-events = chEvtWaitAnyTimeout(ALL_EVENTS, MS2ST(1000));
-test_assert((eventmask_t)0 != events, "timed out");
+ <value><![CDATA[time = chVTGetSystemTimeX();
+chEvtSignal(chThdGetSelfX(), 0x55);
+events = chEvtWaitAnyTimeout(ALL_EVENTS, MS2ST(1000));
+test_assert((eventmask_t)0 != events, "timed out");
test_assert((eventmask_t)0x55 == events, "wrong events mask");]]></value>
</code>
</step>
@@ -525,10 +525,10 @@ test_assert((eventmask_t)0x55 == events, "wrong events mask");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[time = chVTGetSystemTimeX();
-chThdGetSelfX()->epmask = 0;
-events = chEvtWaitAnyTimeout(ALL_EVENTS, MS2ST(1000));
-test_assert((eventmask_t)0 != events, "timed out");
+ <value><![CDATA[time = chVTGetSystemTimeX();
+chThdGetSelfX()->epmask = 0;
+events = chEvtWaitAnyTimeout(ALL_EVENTS, MS2ST(1000));
+test_assert((eventmask_t)0 != events, "timed out");
test_assert((eventmask_t)0x55 == events, "wrong events mask");]]></value>
</code>
</step>
@@ -540,11 +540,11 @@ test_assert((eventmask_t)0x55 == events, "wrong events mask");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[time = chVTGetSystemTimeX();
-events = chEvtWaitAnyTimeout(0, MS2ST(1000));
-test_assert_time_window(time + MS2ST(1000),
- time + MS2ST(1000) + 1,
- "out of time window");
+ <value><![CDATA[time = chVTGetSystemTimeX();
+events = chEvtWaitAnyTimeout(0, MS2ST(1000));
+test_assert_time_window(time + MS2ST(1000),
+ time + MS2ST(1000) + 1,
+ "out of time window");
test_assert((eventmask_t)0 == events, "wrong events mask");]]></value>
</code>
</step>
@@ -552,6 +552,79 @@ test_assert((eventmask_t)0 == events, "wrong events mask");]]></value>
</case>
</cases>
</sequence>
+ <sequence>
+ <type index="0">
+ <value>Internal Tests</value>
+ </type>
+ <brief>
+ <value>Mailboxes.</value>
+ </brief>
+ <description>
+ <value>This sequence tests the ChibiOS/NIL functionalities related to mailboxes.</value>
+ </description>
+ <shared_code>
+ <value><![CDATA[#define ALLOWED_DELAY MS2ST(5)
+#define MB_SIZE 4
+
+static msg_t mb_buffer[MB_SIZE];
+static MAILBOX_DECL(mb1, mb_buffer, MB_SIZE);]]></value>
+ </shared_code>
+ <cases>
+ <case>
+ <brief>
+ <value>Mailbox non-blocking tests.</value>
+ </brief>
+ <description>
+ <value>The mailbox API is tested without triggering blocking conditions.</value>
+ </description>
+ <condition>
+ <value>CH_CFG_USE_MAILBOXES</value>
+ </condition>
+ <various_code>
+ <setup_code>
+ <value><![CDATA[chMBObjectInit(&mb1, mb_buffer, MB_SIZE);]]></value>
+ </setup_code>
+ <teardown_code>
+ <value><![CDATA[chMBReset(&mb1);]]></value>
+ </teardown_code>
+ <local_variables>
+ <value><![CDATA[msg_t msg1;]]></value>
+ </local_variables>
+ </various_code>
+ <steps>
+ <step>
+ <description>
+ <value>Testing the mailbox size.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[test_assert_lock(chMBGetFreeCountI(&mb1) == MB_SIZE, "wrong size");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>Testing forward and backward queuing, checking for no errors.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[unsigned i;
+
+for (i = 0; i < MB_SIZE - 1; i++) {
+ msg1 = chMBPost(&mb1, 'B' + i, TIME_INFINITE);
+ test_assert(msg1 == MSG_OK, "wrong wake-up message");
+}
+msg1 = chMBPostAhead(&mb1, 'A', TIME_INFINITE);
+test_assert(msg1 == MSG_OK, "wrong wake-up message");]]></value>
+ </code>
+ </step>
+ </steps>
+ </case>
+ </cases>
+ </sequence>
</sequences>
</instance>
</instances>