aboutsummaryrefslogtreecommitdiffstats
path: root/test/nil
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2017-10-03 08:50:33 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2017-10-03 08:50:33 +0000
commit7d2486a57ad2f63c30d00d1d4302e82e10467633 (patch)
tree41445cb98d7c42bf2afa607af7b32f4b22f3d002 /test/nil
parent3a6f91354464e430dfb78bc81031815d7700bb97 (diff)
downloadChibiOS-7d2486a57ad2f63c30d00d1d4302e82e10467633.tar.gz
ChibiOS-7d2486a57ad2f63c30d00d1d4302e82e10467633.tar.bz2
ChibiOS-7d2486a57ad2f63c30d00d1d4302e82e10467633.zip
Mailboxes refactory for consistency.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10747 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'test/nil')
-rw-r--r--test/nil/configuration.xml36
-rw-r--r--test/nil/source/test/test_sequence_005.c52
2 files changed, 44 insertions, 44 deletions
diff --git a/test/nil/configuration.xml b/test/nil/configuration.xml
index 2eaa24bd0..542ccb8b6 100644
--- a/test/nil/configuration.xml
+++ b/test/nil/configuration.xml
@@ -827,28 +827,28 @@ test_assert_lock(mb1.buffer == mb1.rdptr, "read pointer not aligned to base");]]
<value />
</tags>
<code>
- <value><![CDATA[msg1 = chMBPost(&mb1, (msg_t)0, TIME_INFINITE);
+ <value><![CDATA[msg1 = chMBPostTimeout(&mb1, (msg_t)0, TIME_INFINITE);
test_assert(msg1 == MSG_RESET, "not in reset state");
-msg1 = chMBPostAhead(&mb1, (msg_t)0, TIME_INFINITE);
+msg1 = chMBPostAheadTimeout(&mb1, (msg_t)0, TIME_INFINITE);
test_assert(msg1 == MSG_RESET, "not in reset state");
-msg1 = chMBFetch(&mb1, &msg2, TIME_INFINITE);
+msg1 = chMBFetchTimeout(&mb1, &msg2, TIME_INFINITE);
test_assert(msg1 == MSG_RESET, "not in reset state");
chMBResumeX(&mb1);]]></value>
</code>
</step>
<step>
<description>
- <value>Filling the mailbox using chMBPost() and chMBPostAhead() once, no errors expected.</value>
+ <value>Filling the mailbox using chMBPostTimeout() and chMBPostAheadTimeout() once, no errors expected.</value>
</description>
<tags>
<value />
</tags>
<code>
<value><![CDATA[for (i = 0; i < MB_SIZE - 1; i++) {
- msg1 = chMBPost(&mb1, 'B' + i, TIME_INFINITE);
+ msg1 = chMBPostTimeout(&mb1, 'B' + i, TIME_INFINITE);
test_assert(msg1 == MSG_OK, "wrong wake-up message");
}
-msg1 = chMBPostAhead(&mb1, 'A', TIME_INFINITE);
+msg1 = chMBPostAheadTimeout(&mb1, 'A', TIME_INFINITE);
test_assert(msg1 == MSG_OK, "wrong wake-up message");]]></value>
</code>
</step>
@@ -867,14 +867,14 @@ test_assert_lock(mb1.rdptr == mb1.wrptr, "pointers not aligned");]]></value>
</step>
<step>
<description>
- <value>Emptying the mailbox using chMBFetch(), no errors expected.</value>
+ <value>Emptying the mailbox using chMBFetchTimeout(), no errors expected.</value>
</description>
<tags>
<value />
</tags>
<code>
<value><![CDATA[for (i = 0; i < MB_SIZE; i++) {
- msg1 = chMBFetch(&mb1, &msg2, TIME_INFINITE);
+ msg1 = chMBFetchTimeout(&mb1, &msg2, TIME_INFINITE);
test_assert(msg1 == MSG_OK, "wrong wake-up message");
test_emit_token(msg2);
}
@@ -889,9 +889,9 @@ test_assert_sequence("ABCD", "wrong get sequence");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[msg1 = chMBPost(&mb1, 'B' + i, TIME_INFINITE);
+ <value><![CDATA[msg1 = chMBPostTimeout(&mb1, 'B' + i, TIME_INFINITE);
test_assert(msg1 == MSG_OK, "wrong wake-up message");
-msg1 = chMBFetch(&mb1, &msg2, TIME_INFINITE);
+msg1 = chMBFetchTimeout(&mb1, &msg2, TIME_INFINITE);
test_assert(msg1 == MSG_OK, "wrong wake-up message");]]></value>
</code>
</step>
@@ -1022,9 +1022,9 @@ test_assert_sequence("ABCD", "wrong get sequence");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[msg1 = chMBPost(&mb1, 'B' + i, TIME_INFINITE);
+ <value><![CDATA[msg1 = chMBPostTimeout(&mb1, 'B' + i, TIME_INFINITE);
test_assert(msg1 == MSG_OK, "wrong wake-up message");
-msg1 = chMBFetch(&mb1, &msg2, TIME_INFINITE);
+msg1 = chMBFetchTimeout(&mb1, &msg2, TIME_INFINITE);
test_assert(msg1 == MSG_OK, "wrong wake-up message");]]></value>
</code>
</step>
@@ -1076,26 +1076,26 @@ unsigned i;]]></value>
</tags>
<code>
<value><![CDATA[for (i = 0; i < MB_SIZE; i++) {
- msg1 = chMBPost(&mb1, 'B' + i, TIME_INFINITE);
+ msg1 = chMBPostTimeout(&mb1, 'B' + i, TIME_INFINITE);
test_assert(msg1 == MSG_OK, "wrong wake-up message");
}]]></value>
</code>
</step>
<step>
<description>
- <value>Testing chMBPost(), chMBPostI(), chMBPostAhead() and chMBPostAheadI() timeout.</value>
+ <value>Testing chMBPostTimeout(), chMBPostI(), chMBPostAheadTimeout() and chMBPostAheadI() timeout.</value>
</description>
<tags>
<value />
</tags>
<code>
- <value><![CDATA[msg1 = chMBPost(&mb1, 'X', 1);
+ <value><![CDATA[msg1 = chMBPostTimeout(&mb1, 'X', 1);
test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");
chSysLock();
msg1 = chMBPostI(&mb1, 'X');
chSysUnlock();
test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");
-msg1 = chMBPostAhead(&mb1, 'X', 1);
+msg1 = chMBPostAheadTimeout(&mb1, 'X', 1);
test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");
chSysLock();
msg1 = chMBPostAheadI(&mb1, 'X');
@@ -1117,13 +1117,13 @@ chMBResumeX(&mb1);]]></value>
</step>
<step>
<description>
- <value>Testing chMBFetch() and chMBFetchI() timeout.</value>
+ <value>Testing chMBFetchTimeout() and chMBFetchI() timeout.</value>
</description>
<tags>
<value />
</tags>
<code>
- <value><![CDATA[msg1 = chMBFetch(&mb1, &msg2, 1);
+ <value><![CDATA[msg1 = chMBFetchTimeout(&mb1, &msg2, 1);
test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");
chSysLock();
msg1 = chMBFetchI(&mb1, &msg2);
diff --git a/test/nil/source/test/test_sequence_005.c b/test/nil/source/test/test_sequence_005.c
index 32307b284..fbca897f9 100644
--- a/test/nil/source/test/test_sequence_005.c
+++ b/test/nil/source/test/test_sequence_005.c
@@ -72,11 +72,11 @@ static MAILBOX_DECL(mb1, mb_buffer, MB_SIZE);
* expected.
* - [5.1.3] Testing the behavior of API when the mailbox is in reset
* state then return in active state.
- * - [5.1.4] Filling the mailbox using chMBPost() and chMBPostAhead()
- * once, no errors expected.
+ * - [5.1.4] Filling the mailbox using chMBPostTimeout() and
+ * chMBPostAheadTimeout() once, no errors expected.
* - [5.1.5] Testing intermediate conditions. Data pointers must be
* aligned, semaphore counters are checked.
- * - [5.1.6] Emptying the mailbox using chMBFetch(), no errors
+ * - [5.1.6] Emptying the mailbox using chMBFetchTimeout(), no errors
* expected.
* - [5.1.7] Posting and then fetching one more message, no errors
* expected.
@@ -118,24 +118,24 @@ static void test_005_001_execute(void) {
state then return in active state.*/
test_set_step(3);
{
- msg1 = chMBPost(&mb1, (msg_t)0, TIME_INFINITE);
+ msg1 = chMBPostTimeout(&mb1, (msg_t)0, TIME_INFINITE);
test_assert(msg1 == MSG_RESET, "not in reset state");
- msg1 = chMBPostAhead(&mb1, (msg_t)0, TIME_INFINITE);
+ msg1 = chMBPostAheadTimeout(&mb1, (msg_t)0, TIME_INFINITE);
test_assert(msg1 == MSG_RESET, "not in reset state");
- msg1 = chMBFetch(&mb1, &msg2, TIME_INFINITE);
+ msg1 = chMBFetchTimeout(&mb1, &msg2, TIME_INFINITE);
test_assert(msg1 == MSG_RESET, "not in reset state");
chMBResumeX(&mb1);
}
- /* [5.1.4] Filling the mailbox using chMBPost() and chMBPostAhead()
- once, no errors expected.*/
+ /* [5.1.4] Filling the mailbox using chMBPostTimeout() and
+ chMBPostAheadTimeout() once, no errors expected.*/
test_set_step(4);
{
for (i = 0; i < MB_SIZE - 1; i++) {
- msg1 = chMBPost(&mb1, 'B' + i, TIME_INFINITE);
+ msg1 = chMBPostTimeout(&mb1, 'B' + i, TIME_INFINITE);
test_assert(msg1 == MSG_OK, "wrong wake-up message");
}
- msg1 = chMBPostAhead(&mb1, 'A', TIME_INFINITE);
+ msg1 = chMBPostAheadTimeout(&mb1, 'A', TIME_INFINITE);
test_assert(msg1 == MSG_OK, "wrong wake-up message");
}
@@ -148,12 +148,12 @@ static void test_005_001_execute(void) {
test_assert_lock(mb1.rdptr == mb1.wrptr, "pointers not aligned");
}
- /* [5.1.6] Emptying the mailbox using chMBFetch(), no errors
+ /* [5.1.6] Emptying the mailbox using chMBFetchTimeout(), no errors
expected.*/
test_set_step(6);
{
for (i = 0; i < MB_SIZE; i++) {
- msg1 = chMBFetch(&mb1, &msg2, TIME_INFINITE);
+ msg1 = chMBFetchTimeout(&mb1, &msg2, TIME_INFINITE);
test_assert(msg1 == MSG_OK, "wrong wake-up message");
test_emit_token(msg2);
}
@@ -164,9 +164,9 @@ static void test_005_001_execute(void) {
expected.*/
test_set_step(7);
{
- msg1 = chMBPost(&mb1, 'B' + i, TIME_INFINITE);
+ msg1 = chMBPostTimeout(&mb1, 'B' + i, TIME_INFINITE);
test_assert(msg1 == MSG_OK, "wrong wake-up message");
- msg1 = chMBFetch(&mb1, &msg2, TIME_INFINITE);
+ msg1 = chMBFetchTimeout(&mb1, &msg2, TIME_INFINITE);
test_assert(msg1 == MSG_OK, "wrong wake-up message");
}
@@ -287,9 +287,9 @@ static void test_005_002_execute(void) {
expected.*/
test_set_step(6);
{
- msg1 = chMBPost(&mb1, 'B' + i, TIME_INFINITE);
+ msg1 = chMBPostTimeout(&mb1, 'B' + i, TIME_INFINITE);
test_assert(msg1 == MSG_OK, "wrong wake-up message");
- msg1 = chMBFetch(&mb1, &msg2, TIME_INFINITE);
+ msg1 = chMBFetchTimeout(&mb1, &msg2, TIME_INFINITE);
test_assert(msg1 == MSG_OK, "wrong wake-up message");
}
@@ -319,10 +319,10 @@ static const testcase_t test_005_002 = {
*
* <h2>Test Steps</h2>
* - [5.3.1] Filling the mailbox.
- * - [5.3.2] Testing chMBPost(), chMBPostI(), chMBPostAhead() and
- * chMBPostAheadI() timeout.
+ * - [5.3.2] Testing chMBPostTimeout(), chMBPostI(),
+ * chMBPostAheadTimeout() and chMBPostAheadI() timeout.
* - [5.3.3] Resetting the mailbox.
- * - [5.3.4] Testing chMBFetch() and chMBFetchI() timeout.
+ * - [5.3.4] Testing chMBFetchTimeout() and chMBFetchI() timeout.
* .
*/
@@ -342,22 +342,22 @@ static void test_005_003_execute(void) {
test_set_step(1);
{
for (i = 0; i < MB_SIZE; i++) {
- msg1 = chMBPost(&mb1, 'B' + i, TIME_INFINITE);
+ msg1 = chMBPostTimeout(&mb1, 'B' + i, TIME_INFINITE);
test_assert(msg1 == MSG_OK, "wrong wake-up message");
}
}
- /* [5.3.2] Testing chMBPost(), chMBPostI(), chMBPostAhead() and
- chMBPostAheadI() timeout.*/
+ /* [5.3.2] Testing chMBPostTimeout(), chMBPostI(),
+ chMBPostAheadTimeout() and chMBPostAheadI() timeout.*/
test_set_step(2);
{
- msg1 = chMBPost(&mb1, 'X', 1);
+ msg1 = chMBPostTimeout(&mb1, 'X', 1);
test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");
chSysLock();
msg1 = chMBPostI(&mb1, 'X');
chSysUnlock();
test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");
- msg1 = chMBPostAhead(&mb1, 'X', 1);
+ msg1 = chMBPostAheadTimeout(&mb1, 'X', 1);
test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");
chSysLock();
msg1 = chMBPostAheadI(&mb1, 'X');
@@ -372,10 +372,10 @@ static void test_005_003_execute(void) {
chMBResumeX(&mb1);
}
- /* [5.3.4] Testing chMBFetch() and chMBFetchI() timeout.*/
+ /* [5.3.4] Testing chMBFetchTimeout() and chMBFetchI() timeout.*/
test_set_step(4);
{
- msg1 = chMBFetch(&mb1, &msg2, 1);
+ msg1 = chMBFetchTimeout(&mb1, &msg2, 1);
test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");
chSysLock();
msg1 = chMBFetchI(&mb1, &msg2);