aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2017-10-16 15:09:11 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2017-10-16 15:09:11 +0000
commiteb6b6685f09fbc4822492a1db9eaa367f46c657c (patch)
treee6b73b5865ff9559fd766a38054cbffc2e9466a3 /test
parent6bbfd2126f0cd20c733b78682d322250d8223d93 (diff)
downloadChibiOS-eb6b6685f09fbc4822492a1db9eaa367f46c657c.tar.gz
ChibiOS-eb6b6685f09fbc4822492a1db9eaa367f46c657c.tar.bz2
ChibiOS-eb6b6685f09fbc4822492a1db9eaa367f46c657c.zip
Enhancements in the test engine, not finished.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10835 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'test')
-rw-r--r--test/lib/ch_test.c13
-rw-r--r--test/lib/ch_test.h29
-rw-r--r--test/nil/.cproject2
-rw-r--r--test/nil/configuration.xml749
-rw-r--r--test/rt/.cproject2
-rw-r--r--test/rt/configuration.xml2615
-rw-r--r--test/rt/source/test/rt_test_root.c (renamed from test/rt/source/test/test_root.c)58
-rw-r--r--test/rt/source/test/rt_test_root.h (renamed from test/rt/source/test/test_root.h)40
-rw-r--r--test/rt/source/test/rt_test_sequence_001.c (renamed from test/rt/source/test/test_sequence_001.c)34
-rw-r--r--test/rt/source/test/rt_test_sequence_001.h (renamed from test/rt/source/test/test_sequence_001.h)10
-rw-r--r--test/rt/source/test/rt_test_sequence_002.c (renamed from test/rt/source/test/test_sequence_002.c)58
-rw-r--r--test/rt/source/test/rt_test_sequence_002.h (renamed from test/rt/source/test/test_sequence_002.h)10
-rw-r--r--test/rt/source/test/rt_test_sequence_003.c (renamed from test/rt/source/test/test_sequence_003.c)70
-rw-r--r--test/rt/source/test/rt_test_sequence_003.h (renamed from test/rt/source/test/test_sequence_003.h)10
-rw-r--r--test/rt/source/test/rt_test_sequence_004.c (renamed from test/rt/source/test/test_sequence_004.c)32
-rw-r--r--test/rt/source/test/rt_test_sequence_004.h (renamed from test/rt/source/test/test_sequence_004.h)10
-rw-r--r--test/rt/source/test/rt_test_sequence_005.c (renamed from test/rt/source/test/test_sequence_005.c)120
-rw-r--r--test/rt/source/test/rt_test_sequence_005.h (renamed from test/rt/source/test/test_sequence_005.h)10
-rw-r--r--test/rt/source/test/rt_test_sequence_006.c (renamed from test/rt/source/test/test_sequence_006.c)164
-rw-r--r--test/rt/source/test/rt_test_sequence_006.h (renamed from test/rt/source/test/test_sequence_006.h)10
-rw-r--r--test/rt/source/test/rt_test_sequence_007.c (renamed from test/rt/source/test/test_sequence_007.c)22
-rw-r--r--test/rt/source/test/rt_test_sequence_007.h (renamed from test/rt/source/test/test_sequence_007.h)10
-rw-r--r--test/rt/source/test/rt_test_sequence_008.c (renamed from test/rt/source/test/test_sequence_008.c)132
-rw-r--r--test/rt/source/test/rt_test_sequence_008.h (renamed from test/rt/source/test/test_sequence_008.h)10
-rw-r--r--test/rt/source/test/rt_test_sequence_009.c (renamed from test/rt/source/test/test_sequence_009.c)70
-rw-r--r--test/rt/source/test/rt_test_sequence_009.h (renamed from test/rt/source/test/test_sequence_009.h)10
-rw-r--r--test/rt/source/test/rt_test_sequence_010.c (renamed from test/rt/source/test/test_sequence_010.c)60
-rw-r--r--test/rt/source/test/rt_test_sequence_010.h (renamed from test/rt/source/test/test_sequence_010.h)10
-rw-r--r--test/rt/source/test/rt_test_sequence_011.c (renamed from test/rt/source/test/test_sequence_011.c)38
-rw-r--r--test/rt/source/test/rt_test_sequence_011.h (renamed from test/rt/source/test/test_sequence_011.h)10
-rw-r--r--test/rt/source/test/rt_test_sequence_012.c (renamed from test/rt/source/test/test_sequence_012.c)42
-rw-r--r--test/rt/source/test/rt_test_sequence_012.h (renamed from test/rt/source/test/test_sequence_012.h)10
-rw-r--r--test/rt/source/test/rt_test_sequence_013.c (renamed from test/rt/source/test/test_sequence_013.c)182
-rw-r--r--test/rt/source/test/rt_test_sequence_013.h (renamed from test/rt/source/test/test_sequence_013.h)10
-rw-r--r--test/rt/test.mk28
35 files changed, 2355 insertions, 2335 deletions
diff --git a/test/lib/ch_test.c b/test/lib/ch_test.c
index 8dd166278..11d7ac095 100644
--- a/test/lib/ch_test.c
+++ b/test/lib/ch_test.c
@@ -24,7 +24,6 @@
#include "hal.h"
#include "ch_test.h"
-#include "test_root.h"
/*===========================================================================*/
/* Module local definitions. */
@@ -134,7 +133,7 @@ bool _test_assert_time_window(systime_t start,
systime_t end,
const char *msg) {
- return _test_assert(osalOsIsTimeWithinX(osalOsGetSystemTimeX(), start, end),
+ return _test_assert(osalTimeIsInRangeX(osalOsGetSystemTimeX(), start, end),
msg);
}
@@ -224,7 +223,7 @@ void test_emit_token_i(char token) {
*
* @api
*/
-msg_t test_execute(BaseSequentialStream *stream) {
+msg_t test_execute(BaseSequentialStream *stream, testsuite_t ts) {
int i, j;
test_chp = stream;
@@ -252,21 +251,21 @@ msg_t test_execute(BaseSequentialStream *stream) {
test_global_fail = false;
i = 0;
- while (test_suite[i]) {
+ while (ts[i] != NULL) {
j = 0;
- while (test_suite[i][j]) {
+ while (ts[i][j] != NULL) {
print_line();
test_print("--- Test Case ");
test_printn(i + 1);
test_print(".");
test_printn(j + 1);
test_print(" (");
- test_print(test_suite[i][j]->name);
+ test_print(ts[i][j]->name);
test_println(")");
#if TEST_DELAY_BETWEEN_TESTS > 0
osalThreadSleepMilliseconds(TEST_DELAY_BETWEEN_TESTS);
#endif
- execute_test(test_suite[i][j]);
+ execute_test(ts[i][j]);
if (test_local_fail) {
test_print("--- Result: FAILURE (#");
test_printn(test_step);
diff --git a/test/lib/ch_test.h b/test/lib/ch_test.h
index cbc2f2af8..3b805d6b5 100644
--- a/test/lib/ch_test.h
+++ b/test/lib/ch_test.h
@@ -65,6 +65,27 @@ typedef struct {
void (*execute)(void); /**< @brief Test case execution function. */
} testcase_t;
+/**
+ * @brief Structure representing a test sequence.
+ */
+typedef const struct {
+ const char *name; /**< @brief Name of the test sequence. */
+ testcase_t *cases; /**< @brief Test cases array. */
+} testsequence_t;
+
+/**
+ * @brief Type of a test suite.
+ */
+typedef const struct {
+ const char *name; /**< @brief Name of the test suite. */
+ testsequence_t *sequences; /**< @brief Test sequences array. */
+} ts_t;
+
+/**
+ * @brief Type of a test suite.
+ */
+typedef const testcase_t * const *testsuite_t[];
+
/*===========================================================================*/
/* Module macros. */
/*===========================================================================*/
@@ -173,7 +194,7 @@ extern "C" {
void test_println(const char *msgp);
void test_emit_token(char token);
void test_emit_token_i(char token);
- msg_t test_execute(BaseSequentialStream *stream);
+ msg_t test_execute(BaseSequentialStream *stream, testsuite_t ts);
#ifdef __cplusplus
}
#endif
@@ -182,12 +203,6 @@ extern "C" {
/* Module inline functions. */
/*===========================================================================*/
-/*===========================================================================*/
-/* Late inclusions. */
-/*===========================================================================*/
-
-#include "test_root.h"
-
#endif /* CH_TEST_H */
/** @} */
diff --git a/test/nil/.cproject b/test/nil/.cproject
index a3d27ffcd..d3500207c 100644
--- a/test/nil/.cproject
+++ b/test/nil/.cproject
@@ -36,8 +36,8 @@
</toolChain>
</folderInfo>
<sourceEntries>
- <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="components"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="source"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="components"/>
</sourceEntries>
</configuration>
</storageModule>
diff --git a/test/nil/configuration.xml b/test/nil/configuration.xml
index c62e00a37..c808728ae 100644
--- a/test/nil/configuration.xml
+++ b/test/nil/configuration.xml
@@ -10,20 +10,20 @@
<instance locked="false" id="org.chibios.spc5.components.portable.chibios_unitary_tests_engine">
<description>
<copyright>
- <value><![CDATA[/*
- ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ <value><![CDATA[/*
+ ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/]]></value>
</copyright>
<introduction>
@@ -31,69 +31,72 @@
</introduction>
</description>
<global_data_and_code>
+ <code_prefix>
+ <value>nil_</value>
+ </code_prefix>
<global_definitions>
- <value><![CDATA[#define TEST_SUITE_NAME "ChibiOS/NIL Test Suite"
-
-#define TEST_REPORT_HOOK_HEADER test_print_port_info();
-
-extern semaphore_t gsem1, gsem2;
-extern thread_reference_t gtr1;
-extern THD_WORKING_AREA(wa_test_support, 128);
-
-void test_print_port_info(void);
+ <value><![CDATA[#define TEST_SUITE_NAME "ChibiOS/NIL Test Suite"
+
+#define TEST_REPORT_HOOK_HEADER test_print_port_info();
+
+extern semaphore_t gsem1, gsem2;
+extern thread_reference_t gtr1;
+extern THD_WORKING_AREA(wa_test_support, 128);
+
+void test_print_port_info(void);
THD_FUNCTION(test_support, arg);]]></value>
</global_definitions>
<global_code>
- <value><![CDATA[void test_print_port_info(void) {
-
-#ifdef PORT_COMPILER_NAME
- test_print("*** Compiler: ");
- test_println(PORT_COMPILER_NAME);
-#endif
- test_print("*** Architecture: ");
- test_println(PORT_ARCHITECTURE_NAME);
-#ifdef PORT_CORE_VARIANT_NAME
- test_print("*** Core Variant: ");
- test_println(PORT_CORE_VARIANT_NAME);
-#endif
-#ifdef PORT_INFO
- test_print("*** Port Info: ");
- test_println(PORT_INFO);
-#endif
-}
-
-semaphore_t gsem1, gsem2;
-thread_reference_t gtr1;
-
-/*
- * Support thread.
- */
-THD_WORKING_AREA(wa_test_support, 128);
-THD_FUNCTION(test_support, arg) {
-#if CH_CFG_USE_EVENTS == TRUE
- thread_t *tp = (thread_t *)arg;
-#else
- (void)arg;
-#endif
-
- /* Initializing global resources.*/
- chSemObjectInit(&gsem1, 0);
- chSemObjectInit(&gsem2, 0);
-
- while (true) {
- chSysLock();
- if (chSemGetCounterI(&gsem1) < 0)
- chSemSignalI(&gsem1);
- chSemResetI(&gsem2, 0);
- chThdResumeI(&gtr1, MSG_OK);
-#if CH_CFG_USE_EVENTS == TRUE
- chEvtSignalI(tp, 0x55);
-#endif
- chSchRescheduleS();
- chSysUnlock();
-
- chThdSleepMilliseconds(250);
- }
+ <value><![CDATA[void test_print_port_info(void) {
+
+#ifdef PORT_COMPILER_NAME
+ test_print("*** Compiler: ");
+ test_println(PORT_COMPILER_NAME);
+#endif
+ test_print("*** Architecture: ");
+ test_println(PORT_ARCHITECTURE_NAME);
+#ifdef PORT_CORE_VARIANT_NAME
+ test_print("*** Core Variant: ");
+ test_println(PORT_CORE_VARIANT_NAME);
+#endif
+#ifdef PORT_INFO
+ test_print("*** Port Info: ");
+ test_println(PORT_INFO);
+#endif
+}
+
+semaphore_t gsem1, gsem2;
+thread_reference_t gtr1;
+
+/*
+ * Support thread.
+ */
+THD_WORKING_AREA(wa_test_support, 128);
+THD_FUNCTION(test_support, arg) {
+#if CH_CFG_USE_EVENTS == TRUE
+ thread_t *tp = (thread_t *)arg;
+#else
+ (void)arg;
+#endif
+
+ /* Initializing global resources.*/
+ chSemObjectInit(&gsem1, 0);
+ chSemObjectInit(&gsem2, 0);
+
+ while (true) {
+ chSysLock();
+ if (chSemGetCounterI(&gsem1) < 0)
+ chSemSignalI(&gsem1);
+ chSemResetI(&gsem2, 0);
+ chThdResumeI(&gtr1, MSG_OK);
+#if CH_CFG_USE_EVENTS == TRUE
+ chEvtSignalI(tp, 0x55);
+#endif
+ chSchRescheduleS();
+ chSysUnlock();
+
+ chThdSleepMilliseconds(250);
+ }
}]]></value>
</global_code>
</global_data_and_code>
@@ -145,20 +148,20 @@ THD_FUNCTION(test_support, arg) {
<value />
</tags>
<code>
- <value><![CDATA[test_println("--- Product: ChibiOS/NIL");
-test_print("--- Stable Flag: ");
-test_printn(CH_KERNEL_STABLE);
-test_println("");
-test_print("--- Version String: ");
-test_println(CH_KERNEL_VERSION);
-test_print("--- Major Number: ");
-test_printn(CH_KERNEL_MAJOR);
-test_println("");
-test_print("--- Minor Number: ");
-test_printn(CH_KERNEL_MINOR);
-test_println("");
-test_print("--- Patch Number: ");
-test_printn(CH_KERNEL_PATCH);
+ <value><![CDATA[test_println("--- Product: ChibiOS/NIL");
+test_print("--- Stable Flag: ");
+test_printn(CH_KERNEL_STABLE);
+test_println("");
+test_print("--- Version String: ");
+test_println(CH_KERNEL_VERSION);
+test_print("--- Major Number: ");
+test_printn(CH_KERNEL_MAJOR);
+test_println("");
+test_print("--- Minor Number: ");
+test_printn(CH_KERNEL_MINOR);
+test_println("");
+test_print("--- Patch Number: ");
+test_printn(CH_KERNEL_PATCH);
test_println("");]]></value>
</code>
</step>
@@ -194,53 +197,53 @@ test_println("");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_print("--- CH_CFG_NUM_THREADS: ");
-test_printn(CH_CFG_NUM_THREADS);
-test_println("");
-test_print("--- CH_CFG_ST_RESOLUTION: ");
-test_printn(CH_CFG_ST_RESOLUTION);
-test_println("");
-test_print("--- CH_CFG_ST_FREQUENCY: ");
-test_printn(CH_CFG_ST_FREQUENCY);
-test_println("");
-test_print("--- CH_CFG_ST_TIMEDELTA: ");
-test_printn(CH_CFG_ST_TIMEDELTA);
-test_println("");
-test_print("--- CH_CFG_USE_SEMAPHORES: ");
-test_printn(CH_CFG_USE_SEMAPHORES);
-test_println("");
-test_print("--- CH_CFG_USE_MUTEXES: ");
-test_printn(CH_CFG_USE_MUTEXES);
-test_println("");
-test_print("--- CH_CFG_USE_EVENTS: ");
-test_printn(CH_CFG_USE_EVENTS);
-test_println("");
-test_print("--- CH_CFG_USE_MAILBOXES: ");
-test_printn(CH_CFG_USE_MAILBOXES);
-test_println("");
-test_print("--- CH_CFG_USE_MEMCORE: ");
-test_printn(CH_CFG_USE_MEMCORE);
-test_println("");
-test_print("--- CH_CFG_USE_HEAP: ");
-test_printn(CH_CFG_USE_HEAP);
-test_println("");
-test_print("--- CH_CFG_USE_MEMPOOLS: ");
-test_printn(CH_CFG_USE_MEMPOOLS);
-test_println("");
-test_print("--- CH_DBG_STATISTICS: ");
-test_printn(CH_DBG_STATISTICS);
-test_println("");
-test_print("--- CH_DBG_SYSTEM_STATE_CHECK: ");
-test_printn(CH_DBG_SYSTEM_STATE_CHECK);
-test_println("");
-test_print("--- CH_DBG_ENABLE_CHECKS: ");
-test_printn(CH_DBG_ENABLE_CHECKS);
-test_println("");
-test_print("--- CH_DBG_ENABLE_ASSERTS: ");
-test_printn(CH_DBG_ENABLE_ASSERTS);
-test_println("");
-test_print("--- CH_DBG_ENABLE_STACK_CHECK: ");
-test_printn(CH_DBG_ENABLE_STACK_CHECK);
+ <value><![CDATA[test_print("--- CH_CFG_NUM_THREADS: ");
+test_printn(CH_CFG_NUM_THREADS);
+test_println("");
+test_print("--- CH_CFG_ST_RESOLUTION: ");
+test_printn(CH_CFG_ST_RESOLUTION);
+test_println("");
+test_print("--- CH_CFG_ST_FREQUENCY: ");
+test_printn(CH_CFG_ST_FREQUENCY);
+test_println("");
+test_print("--- CH_CFG_ST_TIMEDELTA: ");
+test_printn(CH_CFG_ST_TIMEDELTA);
+test_println("");
+test_print("--- CH_CFG_USE_SEMAPHORES: ");
+test_printn(CH_CFG_USE_SEMAPHORES);
+test_println("");
+test_print("--- CH_CFG_USE_MUTEXES: ");
+test_printn(CH_CFG_USE_MUTEXES);
+test_println("");
+test_print("--- CH_CFG_USE_EVENTS: ");
+test_printn(CH_CFG_USE_EVENTS);
+test_println("");
+test_print("--- CH_CFG_USE_MAILBOXES: ");
+test_printn(CH_CFG_USE_MAILBOXES);
+test_println("");
+test_print("--- CH_CFG_USE_MEMCORE: ");
+test_printn(CH_CFG_USE_MEMCORE);
+test_println("");
+test_print("--- CH_CFG_USE_HEAP: ");
+test_printn(CH_CFG_USE_HEAP);
+test_println("");
+test_print("--- CH_CFG_USE_MEMPOOLS: ");
+test_printn(CH_CFG_USE_MEMPOOLS);
+test_println("");
+test_print("--- CH_DBG_STATISTICS: ");
+test_printn(CH_DBG_STATISTICS);
+test_println("");
+test_print("--- CH_DBG_SYSTEM_STATE_CHECK: ");
+test_printn(CH_DBG_SYSTEM_STATE_CHECK);
+test_println("");
+test_print("--- CH_DBG_ENABLE_CHECKS: ");
+test_printn(CH_DBG_ENABLE_CHECKS);
+test_println("");
+test_print("--- CH_DBG_ENABLE_ASSERTS: ");
+test_printn(CH_DBG_ENABLE_ASSERTS);
+test_println("");
+test_print("--- CH_DBG_ENABLE_STACK_CHECK: ");
+test_printn(CH_DBG_ENABLE_STACK_CHECK);
test_println("");]]></value>
</code>
</step>
@@ -295,8 +298,8 @@ test_println("");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[systime_t time = chVTGetSystemTimeX();
-while (time == chVTGetSystemTimeX()) {
+ <value><![CDATA[systime_t time = chVTGetSystemTimeX();
+while (time == chVTGetSystemTimeX()) {
}]]></value>
</code>
</step>
@@ -332,10 +335,10 @@ while (time == chVTGetSystemTimeX()) {
<value />
</tags>
<code>
- <value><![CDATA[time = chVTGetSystemTimeX();
-chThdSleep(100);
-test_assert_time_window(time + 100,
- time + 100 + 1,
+ <value><![CDATA[time = chVTGetSystemTimeX();
+chThdSleep(100);
+test_assert_time_window(time + 100,
+ time + 100 + 1,
"out of time window");]]></value>
</code>
</step>
@@ -347,10 +350,10 @@ test_assert_time_window(time + 100,
<value />
</tags>
<code>
- <value><![CDATA[time = chVTGetSystemTimeX();
-chThdSleepMicroseconds(100000);
-test_assert_time_window(time + US2ST(100000),
- time + US2ST(100000) + 1,
+ <value><![CDATA[time = chVTGetSystemTimeX();
+chThdSleepMicroseconds(100000);
+test_assert_time_window(time + US2ST(100000),
+ time + US2ST(100000) + 1,
"out of time window");]]></value>
</code>
</step>
@@ -362,10 +365,10 @@ test_assert_time_window(time + US2ST(100000),
<value />
</tags>
<code>
- <value><![CDATA[time = chVTGetSystemTimeX();
-chThdSleepMilliseconds(100);
-test_assert_time_window(time + MS2ST(100),
- time + MS2ST(100) + 1,
+ <value><![CDATA[time = chVTGetSystemTimeX();
+chThdSleepMilliseconds(100);
+test_assert_time_window(time + MS2ST(100),
+ time + MS2ST(100) + 1,
"out of time window");]]></value>
</code>
</step>
@@ -377,10 +380,10 @@ test_assert_time_window(time + MS2ST(100),
<value />
</tags>
<code>
- <value><![CDATA[time = chVTGetSystemTimeX();
-chThdSleepSeconds(1);
-test_assert_time_window(time + S2ST(1),
- time + S2ST(1) + 1,
+ <value><![CDATA[time = chVTGetSystemTimeX();
+chThdSleepSeconds(1);
+test_assert_time_window(time + S2ST(1),
+ time + S2ST(1) + 1,
"out of time window");]]></value>
</code>
</step>
@@ -392,10 +395,10 @@ test_assert_time_window(time + S2ST(1),
<value />
</tags>
<code>
- <value><![CDATA[time = chVTGetSystemTimeX();
-chThdSleepUntil(time + 100);
-test_assert_time_window(time + 100,
- time + 100 + 1,
+ <value><![CDATA[time = chVTGetSystemTimeX();
+chThdSleepUntil(time + 100);
+test_assert_time_window(time + 100,
+ time + 100 + 1,
"out of time window");]]></value>
</code>
</step>
@@ -417,8 +420,8 @@ test_assert_time_window(time + 100,
<value>CH_CFG_USE_SEMAPHORES</value>
</condition>
<shared_code>
- <value><![CDATA[#include "ch.h"
-
+ <value><![CDATA[#include "ch.h"
+
static semaphore_t sem1;]]></value>
</shared_code>
<cases>
@@ -452,10 +455,10 @@ static semaphore_t sem1;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[msg_t msg;
-
-msg = chSemWait(&sem1);
-test_assert_lock(chSemGetCounterI(&sem1) == 0, "wrong counter value");
+ <value><![CDATA[msg_t msg;
+
+msg = chSemWait(&sem1);
+test_assert_lock(chSemGetCounterI(&sem1) == 0, "wrong counter value");
test_assert(MSG_OK == msg, "wrong returned message");]]></value>
</code>
</step>
@@ -467,7 +470,7 @@ test_assert(MSG_OK == msg, "wrong returned message");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chSemSignal(&sem1);
+ <value><![CDATA[chSemSignal(&sem1);
test_assert_lock(chSemGetCounterI(&sem1) == 1, "wrong counter value");]]></value>
</code>
</step>
@@ -479,7 +482,7 @@ test_assert_lock(chSemGetCounterI(&sem1) == 1, "wrong counter value");]]></value
<value />
</tags>
<code>
- <value><![CDATA[chSemReset(&sem1, 2);
+ <value><![CDATA[chSemReset(&sem1, 2);
test_assert_lock(chSemGetCounterI(&sem1) == 2, "wrong counter value");]]></value>
</code>
</step>
@@ -515,10 +518,10 @@ test_assert_lock(chSemGetCounterI(&sem1) == 2, "wrong counter value");]]></value
<value />
</tags>
<code>
- <value><![CDATA[msg_t msg;
-
-msg = chSemWait(&gsem1);
-test_assert_lock(chSemGetCounterI(&gsem1) == 0, "wrong counter value");
+ <value><![CDATA[msg_t msg;
+
+msg = chSemWait(&gsem1);
+test_assert_lock(chSemGetCounterI(&gsem1) == 0, "wrong counter value");
test_assert(MSG_OK == msg, "wrong returned message");]]></value>
</code>
</step>
@@ -530,10 +533,10 @@ test_assert(MSG_OK == msg, "wrong returned message");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[msg_t msg;
-
-msg = chSemWait(&gsem2);
-test_assert_lock(chSemGetCounterI(&gsem2) == 0,"wrong counter value");
+ <value><![CDATA[msg_t msg;
+
+msg = chSemWait(&gsem2);
+test_assert_lock(chSemGetCounterI(&gsem2) == 0,"wrong counter value");
test_assert(MSG_RESET == msg, "wrong returned message");]]></value>
</code>
</step>
@@ -557,7 +560,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>
@@ -570,12 +573,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>
@@ -587,12 +590,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>
@@ -635,7 +638,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>
@@ -648,10 +651,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>
@@ -663,14 +666,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>
@@ -694,7 +697,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>
@@ -707,10 +710,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>
@@ -722,10 +725,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>
@@ -737,11 +740,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>
@@ -763,10 +766,10 @@ test_assert((eventmask_t)0 == events, "wrong events mask");]]></value>
<value>CH_CFG_USE_MAILBOXES</value>
</condition>
<shared_code>
- <value><![CDATA[#define ALLOWED_DELAY MS2ST(5)
-#define MB_SIZE 4
-
-static msg_t mb_buffer[MB_SIZE];
+ <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>
@@ -788,7 +791,7 @@ static MAILBOX_DECL(mb1, mb_buffer, MB_SIZE);]]></value>
<value><![CDATA[chMBReset(&mb1);]]></value>
</teardown_code>
<local_variables>
- <value><![CDATA[msg_t msg1, msg2;
+ <value><![CDATA[msg_t msg1, msg2;
unsigned i;]]></value>
</local_variables>
</various_code>
@@ -812,10 +815,10 @@ unsigned i;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chMBReset(&mb1);
-test_assert_lock(chMBGetFreeCountI(&mb1) == MB_SIZE, "not empty");
-test_assert_lock(chMBGetUsedCountI(&mb1) == 0, "still full");
-test_assert_lock(mb1.buffer == mb1.wrptr, "write pointer not aligned to base");
+ <value><![CDATA[chMBReset(&mb1);
+test_assert_lock(chMBGetFreeCountI(&mb1) == MB_SIZE, "not empty");
+test_assert_lock(chMBGetUsedCountI(&mb1) == 0, "still full");
+test_assert_lock(mb1.buffer == mb1.wrptr, "write pointer not aligned to base");
test_assert_lock(mb1.buffer == mb1.rdptr, "read pointer not aligned to base");]]></value>
</code>
</step>
@@ -827,12 +830,12 @@ test_assert_lock(mb1.buffer == mb1.rdptr, "read pointer not aligned to base");]]
<value />
</tags>
<code>
- <value><![CDATA[msg1 = chMBPostTimeout(&mb1, (msg_t)0, TIME_INFINITE);
-test_assert(msg1 == MSG_RESET, "not in reset state");
-msg1 = chMBPostAheadTimeout(&mb1, (msg_t)0, TIME_INFINITE);
-test_assert(msg1 == MSG_RESET, "not in reset state");
-msg1 = chMBFetchTimeout(&mb1, &msg2, TIME_INFINITE);
-test_assert(msg1 == MSG_RESET, "not in reset state");
+ <value><![CDATA[msg1 = chMBPostTimeout(&mb1, (msg_t)0, TIME_INFINITE);
+test_assert(msg1 == MSG_RESET, "not in reset state");
+msg1 = chMBPostAheadTimeout(&mb1, (msg_t)0, TIME_INFINITE);
+test_assert(msg1 == MSG_RESET, "not in reset state");
+msg1 = chMBFetchTimeout(&mb1, &msg2, TIME_INFINITE);
+test_assert(msg1 == MSG_RESET, "not in reset state");
chMBResumeX(&mb1);]]></value>
</code>
</step>
@@ -844,11 +847,11 @@ chMBResumeX(&mb1);]]></value>
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < MB_SIZE - 1; i++) {
- msg1 = chMBPostTimeout(&mb1, 'B' + i, TIME_INFINITE);
- test_assert(msg1 == MSG_OK, "wrong wake-up message");
-}
-msg1 = chMBPostAheadTimeout(&mb1, 'A', TIME_INFINITE);
+ <value><![CDATA[for (i = 0; i < MB_SIZE - 1; i++) {
+ msg1 = chMBPostTimeout(&mb1, 'B' + i, TIME_INFINITE);
+ test_assert(msg1 == MSG_OK, "wrong wake-up message");
+}
+msg1 = chMBPostAheadTimeout(&mb1, 'A', TIME_INFINITE);
test_assert(msg1 == MSG_OK, "wrong wake-up message");]]></value>
</code>
</step>
@@ -860,8 +863,8 @@ test_assert(msg1 == MSG_OK, "wrong wake-up message");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_assert_lock(chMBGetFreeCountI(&mb1) == 0, "still empty");
-test_assert_lock(chMBGetUsedCountI(&mb1) == MB_SIZE, "not full");
+ <value><![CDATA[test_assert_lock(chMBGetFreeCountI(&mb1) == 0, "still empty");
+test_assert_lock(chMBGetUsedCountI(&mb1) == MB_SIZE, "not full");
test_assert_lock(mb1.rdptr == mb1.wrptr, "pointers not aligned");]]></value>
</code>
</step>
@@ -873,11 +876,11 @@ test_assert_lock(mb1.rdptr == mb1.wrptr, "pointers not aligned");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < MB_SIZE; i++) {
- msg1 = chMBFetchTimeout(&mb1, &msg2, TIME_INFINITE);
- test_assert(msg1 == MSG_OK, "wrong wake-up message");
- test_emit_token(msg2);
-}
+ <value><![CDATA[for (i = 0; i < MB_SIZE; i++) {
+ msg1 = chMBFetchTimeout(&mb1, &msg2, TIME_INFINITE);
+ test_assert(msg1 == MSG_OK, "wrong wake-up message");
+ test_emit_token(msg2);
+}
test_assert_sequence("ABCD", "wrong get sequence");]]></value>
</code>
</step>
@@ -889,9 +892,9 @@ test_assert_sequence("ABCD", "wrong get sequence");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[msg1 = chMBPostTimeout(&mb1, 'B' + i, TIME_INFINITE);
-test_assert(msg1 == MSG_OK, "wrong wake-up message");
-msg1 = chMBFetchTimeout(&mb1, &msg2, TIME_INFINITE);
+ <value><![CDATA[msg1 = chMBPostTimeout(&mb1, 'B' + i, TIME_INFINITE);
+test_assert(msg1 == MSG_OK, "wrong wake-up message");
+msg1 = chMBFetchTimeout(&mb1, &msg2, TIME_INFINITE);
test_assert(msg1 == MSG_OK, "wrong wake-up message");]]></value>
</code>
</step>
@@ -903,9 +906,9 @@ test_assert(msg1 == MSG_OK, "wrong wake-up message");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_assert_lock(chMBGetFreeCountI(&mb1) == MB_SIZE, "not empty");
-test_assert_lock(chMBGetUsedCountI(&mb1) == 0, "still full");
-test_assert(mb1.buffer == mb1.wrptr, "write pointer not aligned to base");
+ <value><![CDATA[test_assert_lock(chMBGetFreeCountI(&mb1) == MB_SIZE, "not empty");
+test_assert_lock(chMBGetUsedCountI(&mb1) == 0, "still full");
+test_assert(mb1.buffer == mb1.wrptr, "write pointer not aligned to base");
test_assert(mb1.buffer == mb1.rdptr, "read pointer not aligned to base");]]></value>
</code>
</step>
@@ -929,7 +932,7 @@ test_assert(mb1.buffer == mb1.rdptr, "read pointer not aligned to base");]]></va
<value><![CDATA[chMBReset(&mb1);]]></value>
</teardown_code>
<local_variables>
- <value><![CDATA[msg_t msg1, msg2;
+ <value><![CDATA[msg_t msg1, msg2;
unsigned i;]]></value>
</local_variables>
</various_code>
@@ -953,13 +956,13 @@ unsigned i;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chSysLock();
-chMBResetI(&mb1);
-chSysUnlock();
-test_assert_lock(chMBGetFreeCountI(&mb1) == MB_SIZE, "not empty");
-test_assert_lock(chMBGetUsedCountI(&mb1) == 0, "still full");
-test_assert_lock(mb1.buffer == mb1.wrptr, "write pointer not aligned to base");
-test_assert_lock(mb1.buffer == mb1.rdptr, "read pointer not aligned to base");
+ <value><![CDATA[chSysLock();
+chMBResetI(&mb1);
+chSysUnlock();
+test_assert_lock(chMBGetFreeCountI(&mb1) == MB_SIZE, "not empty");
+test_assert_lock(chMBGetUsedCountI(&mb1) == 0, "still full");
+test_assert_lock(mb1.buffer == mb1.wrptr, "write pointer not aligned to base");
+test_assert_lock(mb1.buffer == mb1.rdptr, "read pointer not aligned to base");
chMBResumeX(&mb1);]]></value>
</code>
</step>
@@ -971,15 +974,15 @@ chMBResumeX(&mb1);]]></value>
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < MB_SIZE - 1; i++) {
- chSysLock();
- msg1 = chMBPostI(&mb1, 'B' + i);
- chSysUnlock();
- test_assert(msg1 == MSG_OK, "wrong wake-up message");
-}
-chSysLock();
-msg1 = chMBPostAheadI(&mb1, 'A');
-chSysUnlock();
+ <value><![CDATA[for (i = 0; i < MB_SIZE - 1; i++) {
+ chSysLock();
+ msg1 = chMBPostI(&mb1, 'B' + i);
+ chSysUnlock();
+ test_assert(msg1 == MSG_OK, "wrong wake-up message");
+}
+chSysLock();
+msg1 = chMBPostAheadI(&mb1, 'A');
+chSysUnlock();
test_assert(msg1 == MSG_OK, "wrong wake-up message");]]></value>
</code>
</step>
@@ -991,8 +994,8 @@ test_assert(msg1 == MSG_OK, "wrong wake-up message");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_assert_lock(chMBGetFreeCountI(&mb1) == 0, "still empty");
-test_assert_lock(chMBGetUsedCountI(&mb1) == MB_SIZE, "not full");
+ <value><![CDATA[test_assert_lock(chMBGetFreeCountI(&mb1) == 0, "still empty");
+test_assert_lock(chMBGetUsedCountI(&mb1) == MB_SIZE, "not full");
test_assert_lock(mb1.rdptr == mb1.wrptr, "pointers not aligned");]]></value>
</code>
</step>
@@ -1004,13 +1007,13 @@ test_assert_lock(mb1.rdptr == mb1.wrptr, "pointers not aligned");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < MB_SIZE; i++) {
- chSysLock();
- msg1 = chMBFetchI(&mb1, &msg2);
- chSysUnlock();
- test_assert(msg1 == MSG_OK, "wrong wake-up message");
- test_emit_token(msg2);
-}
+ <value><![CDATA[for (i = 0; i < MB_SIZE; i++) {
+ chSysLock();
+ msg1 = chMBFetchI(&mb1, &msg2);
+ chSysUnlock();
+ test_assert(msg1 == MSG_OK, "wrong wake-up message");
+ test_emit_token(msg2);
+}
test_assert_sequence("ABCD", "wrong get sequence");]]></value>
</code>
</step>
@@ -1022,9 +1025,9 @@ test_assert_sequence("ABCD", "wrong get sequence");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[msg1 = chMBPostTimeout(&mb1, 'B' + i, TIME_INFINITE);
-test_assert(msg1 == MSG_OK, "wrong wake-up message");
-msg1 = chMBFetchTimeout(&mb1, &msg2, TIME_INFINITE);
+ <value><![CDATA[msg1 = chMBPostTimeout(&mb1, 'B' + i, TIME_INFINITE);
+test_assert(msg1 == MSG_OK, "wrong wake-up message");
+msg1 = chMBFetchTimeout(&mb1, &msg2, TIME_INFINITE);
test_assert(msg1 == MSG_OK, "wrong wake-up message");]]></value>
</code>
</step>
@@ -1036,9 +1039,9 @@ test_assert(msg1 == MSG_OK, "wrong wake-up message");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_assert_lock(chMBGetFreeCountI(&mb1) == MB_SIZE, "not empty");
-test_assert_lock(chMBGetUsedCountI(&mb1) == 0, "still full");
-test_assert(mb1.buffer == mb1.wrptr, "write pointer not aligned to base");
+ <value><![CDATA[test_assert_lock(chMBGetFreeCountI(&mb1) == MB_SIZE, "not empty");
+test_assert_lock(chMBGetUsedCountI(&mb1) == 0, "still full");
+test_assert(mb1.buffer == mb1.wrptr, "write pointer not aligned to base");
test_assert(mb1.buffer == mb1.rdptr, "read pointer not aligned to base");]]></value>
</code>
</step>
@@ -1062,7 +1065,7 @@ test_assert(mb1.buffer == mb1.rdptr, "read pointer not aligned to base");]]></va
<value><![CDATA[chMBReset(&mb1);]]></value>
</teardown_code>
<local_variables>
- <value><![CDATA[msg_t msg1, msg2;
+ <value><![CDATA[msg_t msg1, msg2;
unsigned i;]]></value>
</local_variables>
</various_code>
@@ -1075,9 +1078,9 @@ unsigned i;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < MB_SIZE; i++) {
- msg1 = chMBPostTimeout(&mb1, 'B' + i, TIME_INFINITE);
- test_assert(msg1 == MSG_OK, "wrong wake-up message");
+ <value><![CDATA[for (i = 0; i < MB_SIZE; i++) {
+ msg1 = chMBPostTimeout(&mb1, 'B' + i, TIME_INFINITE);
+ test_assert(msg1 == MSG_OK, "wrong wake-up message");
}]]></value>
</code>
</step>
@@ -1089,17 +1092,17 @@ unsigned i;]]></value>
<value />
</tags>
<code>
- <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 = chMBPostAheadTimeout(&mb1, 'X', 1);
-test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");
-chSysLock();
-msg1 = chMBPostAheadI(&mb1, 'X');
-chSysUnlock();
+ <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 = chMBPostAheadTimeout(&mb1, 'X', 1);
+test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");
+chSysLock();
+msg1 = chMBPostAheadI(&mb1, 'X');
+chSysUnlock();
test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");]]></value>
</code>
</step>
@@ -1111,7 +1114,7 @@ test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chMBReset(&mb1);;
+ <value><![CDATA[chMBReset(&mb1);;
chMBResumeX(&mb1);]]></value>
</code>
</step>
@@ -1123,11 +1126,11 @@ chMBResumeX(&mb1);]]></value>
<value />
</tags>
<code>
- <value><![CDATA[msg1 = chMBFetchTimeout(&mb1, &msg2, 1);
-test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");
-chSysLock();
-msg1 = chMBFetchI(&mb1, &msg2);
-chSysUnlock();
+ <value><![CDATA[msg1 = chMBFetchTimeout(&mb1, &msg2, 1);
+test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");
+chSysLock();
+msg1 = chMBFetchI(&mb1, &msg2);
+chSysUnlock();
test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");]]></value>
</code>
</step>
@@ -1149,21 +1152,21 @@ test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");]]></value>
<value>CH_CFG_USE_MEMPOOLS</value>
</condition>
<shared_code>
- <value><![CDATA[#define MEMORY_POOL_SIZE 4
-
-static uint32_t objects[MEMORY_POOL_SIZE];
-static MEMORYPOOL_DECL(mp1, sizeof (uint32_t), PORT_NATURAL_ALIGN, NULL);
-
-#if CH_CFG_USE_SEMAPHORES
-static GUARDEDMEMORYPOOL_DECL(gmp1, sizeof (uint32_t), PORT_NATURAL_ALIGN);
-#endif
-
-static void *null_provider(size_t size, unsigned align) {
-
- (void)size;
- (void)align;
-
- return NULL;
+ <value><![CDATA[#define MEMORY_POOL_SIZE 4
+
+static uint32_t objects[MEMORY_POOL_SIZE];
+static MEMORYPOOL_DECL(mp1, sizeof (uint32_t), PORT_NATURAL_ALIGN, NULL);
+
+#if CH_CFG_USE_SEMAPHORES
+static GUARDEDMEMORYPOOL_DECL(gmp1, sizeof (uint32_t), PORT_NATURAL_ALIGN);
+#endif
+
+static void *null_provider(size_t size, unsigned align) {
+
+ (void)size;
+ (void)align;
+
+ return NULL;
}]]></value>
</shared_code>
<cases>
@@ -1208,7 +1211,7 @@ static void *null_provider(size_t size, unsigned align) {
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < MEMORY_POOL_SIZE; i++)
+ <value><![CDATA[for (i = 0; i < MEMORY_POOL_SIZE; i++)
test_assert(chPoolAlloc(&mp1) != NULL, "list empty");]]></value>
</code>
</step>
@@ -1231,7 +1234,7 @@ static void *null_provider(size_t size, unsigned align) {
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < MEMORY_POOL_SIZE; i++)
+ <value><![CDATA[for (i = 0; i < MEMORY_POOL_SIZE; i++)
chPoolFree(&mp1, &objects[i]);]]></value>
</code>
</step>
@@ -1243,7 +1246,7 @@ static void *null_provider(size_t size, unsigned align) {
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < MEMORY_POOL_SIZE; i++)
+ <value><![CDATA[for (i = 0; i < MEMORY_POOL_SIZE; i++)
test_assert(chPoolAlloc(&mp1) != NULL, "list empty");]]></value>
</code>
</step>
@@ -1266,7 +1269,7 @@ static void *null_provider(size_t size, unsigned align) {
<value />
</tags>
<code>
- <value><![CDATA[chPoolObjectInit(&mp1, sizeof (uint32_t), null_provider);
+ <value><![CDATA[chPoolObjectInit(&mp1, sizeof (uint32_t), null_provider);
test_assert(chPoolAlloc(&mp1) == NULL, "provider returned memory");]]></value>
</code>
</step>
@@ -1313,7 +1316,7 @@ test_assert(chPoolAlloc(&mp1) == NULL, "provider returned memory");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < MEMORY_POOL_SIZE; i++)
+ <value><![CDATA[for (i = 0; i < MEMORY_POOL_SIZE; i++)
test_assert(chGuardedPoolAllocTimeout(&gmp1, TIME_IMMEDIATE) != NULL, "list empty");]]></value>
</code>
</step>
@@ -1336,7 +1339,7 @@ test_assert(chPoolAlloc(&mp1) == NULL, "provider returned memory");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < MEMORY_POOL_SIZE; i++)
+ <value><![CDATA[for (i = 0; i < MEMORY_POOL_SIZE; i++)
chGuardedPoolFree(&gmp1, &objects[i]);]]></value>
</code>
</step>
@@ -1348,7 +1351,7 @@ test_assert(chPoolAlloc(&mp1) == NULL, "provider returned memory");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < MEMORY_POOL_SIZE; i++)
+ <value><![CDATA[for (i = 0; i < MEMORY_POOL_SIZE; i++)
test_assert(chGuardedPoolAllocTimeout(&gmp1, TIME_IMMEDIATE) != NULL, "list empty");]]></value>
</code>
</step>
@@ -1416,10 +1419,10 @@ test_assert(chPoolAlloc(&mp1) == NULL, "provider returned memory");]]></value>
<value>CH_CFG_USE_HEAP</value>
</condition>
<shared_code>
- <value><![CDATA[#define ALLOC_SIZE 16
-#define HEAP_SIZE (ALLOC_SIZE * 8)
-
-static memory_heap_t test_heap;
+ <value><![CDATA[#define ALLOC_SIZE 16
+#define HEAP_SIZE (ALLOC_SIZE * 8)
+
+static memory_heap_t test_heap;
static CH_HEAP_AREA(myheap, HEAP_SIZE);]]></value>
</shared_code>
<cases>
@@ -1441,7 +1444,7 @@ static CH_HEAP_AREA(myheap, HEAP_SIZE);]]></value>
<value />
</teardown_code>
<local_variables>
- <value><![CDATA[void *p1, *p2, *p3;
+ <value><![CDATA[void *p1, *p2, *p3;
size_t n, sz;]]></value>
</local_variables>
</various_code>
@@ -1465,7 +1468,7 @@ size_t n, sz;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[p1 = chHeapAlloc(&test_heap, HEAP_SIZE * 2);
+ <value><![CDATA[p1 = chHeapAlloc(&test_heap, HEAP_SIZE * 2);
test_assert(p1 == NULL, "allocation not failed");]]></value>
</code>
</step>
@@ -1477,8 +1480,8 @@ test_assert(p1 == NULL, "allocation not failed");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[p1 = chHeapAlloc(&test_heap, ALLOC_SIZE);
-test_assert(p1 != NULL, "allocation failed");
+ <value><![CDATA[p1 = chHeapAlloc(&test_heap, ALLOC_SIZE);
+test_assert(p1 != NULL, "allocation failed");
chHeapFree(p1);]]></value>
</code>
</step>
@@ -1490,11 +1493,11 @@ chHeapFree(p1);]]></value>
<value />
</tags>
<code>
- <value><![CDATA[size_t total_size, largest_size;
-
-n = chHeapStatus(&test_heap, &total_size, &largest_size);
-test_assert(n == 1, "missing free block");
-test_assert(total_size >= ALLOC_SIZE, "unexpected heap state");
+ <value><![CDATA[size_t total_size, largest_size;
+
+n = chHeapStatus(&test_heap, &total_size, &largest_size);
+test_assert(n == 1, "missing free block");
+test_assert(total_size >= ALLOC_SIZE, "unexpected heap state");
test_assert(total_size == largest_size, "unexpected heap state");]]></value>
</code>
</step>
@@ -1506,12 +1509,12 @@ test_assert(total_size == largest_size, "unexpected heap state");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[p1 = chHeapAlloc(&test_heap, ALLOC_SIZE);
-p2 = chHeapAlloc(&test_heap, ALLOC_SIZE);
-p3 = chHeapAlloc(&test_heap, ALLOC_SIZE);
-chHeapFree(p1); /* Does not merge.*/
-chHeapFree(p2); /* Merges backward.*/
-chHeapFree(p3); /* Merges both sides.*/
+ <value><![CDATA[p1 = chHeapAlloc(&test_heap, ALLOC_SIZE);
+p2 = chHeapAlloc(&test_heap, ALLOC_SIZE);
+p3 = chHeapAlloc(&test_heap, ALLOC_SIZE);
+chHeapFree(p1); /* Does not merge.*/
+chHeapFree(p2); /* Merges backward.*/
+chHeapFree(p3); /* Merges both sides.*/
test_assert(chHeapStatus(&test_heap, &n, NULL) == 1, "heap fragmented");]]></value>
</code>
</step>
@@ -1523,12 +1526,12 @@ test_assert(chHeapStatus(&test_heap, &n, NULL) == 1, "heap fragmented");]]></val
<value />
</tags>
<code>
- <value><![CDATA[p1 = chHeapAlloc(&test_heap, ALLOC_SIZE);
-p2 = chHeapAlloc(&test_heap, ALLOC_SIZE);
-p3 = chHeapAlloc(&test_heap, ALLOC_SIZE);
-chHeapFree(p3); /* Merges forward.*/
-chHeapFree(p2); /* Merges forward.*/
-chHeapFree(p1); /* Merges forward.*/
+ <value><![CDATA[p1 = chHeapAlloc(&test_heap, ALLOC_SIZE);
+p2 = chHeapAlloc(&test_heap, ALLOC_SIZE);
+p3 = chHeapAlloc(&test_heap, ALLOC_SIZE);
+chHeapFree(p3); /* Merges forward.*/
+chHeapFree(p2); /* Merges forward.*/
+chHeapFree(p1); /* Merges forward.*/
test_assert(chHeapStatus(&test_heap, &n, NULL) == 1, "heap fragmented");]]></value>
</code>
</step>
@@ -1540,17 +1543,17 @@ test_assert(chHeapStatus(&test_heap, &n, NULL) == 1, "heap fragmented");]]></val
<value />
</tags>
<code>
- <value><![CDATA[p1 = chHeapAlloc(&test_heap, ALLOC_SIZE + 1);
-p2 = chHeapAlloc(&test_heap, ALLOC_SIZE);
-chHeapFree(p1);
-test_assert(chHeapStatus(&test_heap, &n, NULL) == 2, "invalid state");
-p1 = chHeapAlloc(&test_heap, ALLOC_SIZE);
-/* Note, the first situation happens when the alignment size is smaller
- than the header size, the second in the other cases.*/
-test_assert((chHeapStatus(&test_heap, &n, NULL) == 1) ||
- (chHeapStatus(&test_heap, &n, NULL) == 2), "heap fragmented");
-chHeapFree(p2);
-chHeapFree(p1);
+ <value><![CDATA[p1 = chHeapAlloc(&test_heap, ALLOC_SIZE + 1);
+p2 = chHeapAlloc(&test_heap, ALLOC_SIZE);
+chHeapFree(p1);
+test_assert(chHeapStatus(&test_heap, &n, NULL) == 2, "invalid state");
+p1 = chHeapAlloc(&test_heap, ALLOC_SIZE);
+/* Note, the first situation happens when the alignment size is smaller
+ than the header size, the second in the other cases.*/
+test_assert((chHeapStatus(&test_heap, &n, NULL) == 1) ||
+ (chHeapStatus(&test_heap, &n, NULL) == 2), "heap fragmented");
+chHeapFree(p2);
+chHeapFree(p1);
test_assert(chHeapStatus(&test_heap, &n, NULL) == 1, "heap fragmented");]]></value>
</code>
</step>
@@ -1562,13 +1565,13 @@ test_assert(chHeapStatus(&test_heap, &n, NULL) == 1, "heap fragmented");]]></val
<value />
</tags>
<code>
- <value><![CDATA[p1 = chHeapAlloc(&test_heap, ALLOC_SIZE);
-p2 = chHeapAlloc(&test_heap, ALLOC_SIZE);
-chHeapFree(p1);
-test_assert( chHeapStatus(&test_heap, &n, NULL) == 2, "invalid state");
-p1 = chHeapAlloc(&test_heap, ALLOC_SIZE * 2); /* Skips first fragment.*/
-chHeapFree(p1);
-chHeapFree(p2);
+ <value><![CDATA[p1 = chHeapAlloc(&test_heap, ALLOC_SIZE);
+p2 = chHeapAlloc(&test_heap, ALLOC_SIZE);
+chHeapFree(p1);
+test_assert( chHeapStatus(&test_heap, &n, NULL) == 2, "invalid state");
+p1 = chHeapAlloc(&test_heap, ALLOC_SIZE * 2); /* Skips first fragment.*/
+chHeapFree(p1);
+chHeapFree(p2);
test_assert(chHeapStatus(&test_heap, &n, NULL) == 1, "heap fragmented");]]></value>
</code>
</step>
@@ -1580,10 +1583,10 @@ test_assert(chHeapStatus(&test_heap, &n, NULL) == 1, "heap fragmented");]]></val
<value />
</tags>
<code>
- <value><![CDATA[(void)chHeapStatus(&test_heap, &n, NULL);
-p1 = chHeapAlloc(&test_heap, n);
-test_assert(p1 != NULL, "allocation failed");
-test_assert(chHeapStatus(&test_heap, NULL, NULL) == 0, "not empty");
+ <value><![CDATA[(void)chHeapStatus(&test_heap, &n, NULL);
+p1 = chHeapAlloc(&test_heap, n);
+test_assert(p1 != NULL, "allocation failed");
+test_assert(chHeapStatus(&test_heap, NULL, NULL) == 0, "not empty");
chHeapFree(p1);]]></value>
</code>
</step>
@@ -1595,7 +1598,7 @@ chHeapFree(p1);]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_assert(chHeapStatus(&test_heap, &n, NULL) == 1, "heap fragmented");
+ <value><![CDATA[test_assert(chHeapStatus(&test_heap, &n, NULL) == 1, "heap fragmented");
test_assert(n == sz, "size changed");]]></value>
</code>
</step>
@@ -1619,7 +1622,7 @@ test_assert(n == sz, "size changed");]]></value>
<value />
</teardown_code>
<local_variables>
- <value><![CDATA[void *p1;
+ <value><![CDATA[void *p1;
size_t total_size, largest_size;]]></value>
</local_variables>
</various_code>
@@ -1632,9 +1635,9 @@ size_t total_size, largest_size;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[(void)chHeapStatus(NULL, &total_size, &largest_size);
-p1 = chHeapAlloc(&test_heap, ALLOC_SIZE);
-test_assert(p1 != NULL, "allocation failed");
+ <value><![CDATA[(void)chHeapStatus(NULL, &total_size, &largest_size);
+p1 = chHeapAlloc(&test_heap, ALLOC_SIZE);
+test_assert(p1 != NULL, "allocation failed");
chHeapFree(p1);]]></value>
</code>
</step>
@@ -1646,7 +1649,7 @@ chHeapFree(p1);]]></value>
<value />
</tags>
<code>
- <value><![CDATA[p1 = chHeapAlloc(NULL, (size_t)-256);
+ <value><![CDATA[p1 = chHeapAlloc(NULL, (size_t)-256);
test_assert(p1 == NULL, "allocation not failed");]]></value>
</code>
</step>
diff --git a/test/rt/.cproject b/test/rt/.cproject
index e92ac3785..e849ada7d 100644
--- a/test/rt/.cproject
+++ b/test/rt/.cproject
@@ -36,8 +36,8 @@
</toolChain>
</folderInfo>
<sourceEntries>
- <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="components"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="source"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="components"/>
</sourceEntries>
</configuration>
</storageModule>
diff --git a/test/rt/configuration.xml b/test/rt/configuration.xml
index 056687afe..75e1b1966 100644
--- a/test/rt/configuration.xml
+++ b/test/rt/configuration.xml
@@ -10,20 +10,20 @@
<instance locked="false" id="org.chibios.spc5.components.portable.chibios_unitary_tests_engine">
<description>
<copyright>
- <value><![CDATA[/*
- ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ <value><![CDATA[/*
+ ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/]]></value>
</copyright>
<introduction>
@@ -31,118 +31,121 @@
</introduction>
</description>
<global_data_and_code>
+ <code_prefix>
+ <value>rt_</value>
+ </code_prefix>
<global_definitions>
- <value><![CDATA[#define TEST_SUITE_NAME "ChibiOS/RT Test Suite"
-
-/*
- * Allowed delay in timeout checks.
- */
-#define ALLOWED_DELAY MS2ST(2)
-
-/*
- * Maximum number of test threads.
- */
-#define MAX_THREADS 5
-
-/*
- * Stack size of test threads.
- */
-#if defined(CH_ARCHITECTURE_AVR) || defined(CH_ARCHITECTURE_MSP430)
-#define THREADS_STACK_SIZE 48
-#elif defined(CH_ARCHITECTURE_STM8)
-#define THREADS_STACK_SIZE 64
-#elif defined(CH_ARCHITECTURE_SIMIA32)
-#define THREADS_STACK_SIZE 512
-#else
-#define THREADS_STACK_SIZE 128
-#endif
-
-/*
- * Working Area size of test threads.
- */
-#define WA_SIZE MEM_ALIGN_NEXT(THD_WORKING_AREA_SIZE(THREADS_STACK_SIZE), \
- PORT_WORKING_AREA_ALIGN)
-
-#define TEST_REPORT_HOOK_HEADER test_print_port_info();
-
-extern uint8_t test_buffer[WA_SIZE * 5];
-extern thread_t *threads[MAX_THREADS];
-extern void * ROMCONST wa[5];
-
-void test_print_port_info(void);
-void test_terminate_threads(void);
-void test_wait_threads(void);
+ <value><![CDATA[#define TEST_SUITE_NAME "ChibiOS/RT Test Suite"
+
+/*
+ * Allowed delay in timeout checks.
+ */
+#define ALLOWED_DELAY TIME_MS2I(2)
+
+/*
+ * Maximum number of test threads.
+ */
+#define MAX_THREADS 5
+
+/*
+ * Stack size of test threads.
+ */
+#if defined(CH_ARCHITECTURE_AVR) || defined(CH_ARCHITECTURE_MSP430)
+#define THREADS_STACK_SIZE 48
+#elif defined(CH_ARCHITECTURE_STM8)
+#define THREADS_STACK_SIZE 64
+#elif defined(CH_ARCHITECTURE_SIMIA32)
+#define THREADS_STACK_SIZE 512
+#else
+#define THREADS_STACK_SIZE 128
+#endif
+
+/*
+ * Working Area size of test threads.
+ */
+#define WA_SIZE MEM_ALIGN_NEXT(THD_WORKING_AREA_SIZE(THREADS_STACK_SIZE), \
+ PORT_WORKING_AREA_ALIGN)
+
+#define TEST_REPORT_HOOK_HEADER test_print_port_info();
+
+extern uint8_t test_buffer[WA_SIZE * 5];
+extern thread_t *threads[MAX_THREADS];
+extern void * ROMCONST wa[5];
+
+void test_print_port_info(void);
+void test_terminate_threads(void);
+void test_wait_threads(void);
systime_t test_wait_tick(void);]]></value>
</global_definitions>
<global_code>
- <value><![CDATA[void test_print_port_info(void) {
-
-#ifdef PORT_COMPILER_NAME
- test_print("*** Compiler: ");
- test_println(PORT_COMPILER_NAME);
-#endif
- test_print("*** Architecture: ");
- test_println(PORT_ARCHITECTURE_NAME);
-#ifdef PORT_CORE_VARIANT_NAME
- test_print("*** Core Variant: ");
- test_println(PORT_CORE_VARIANT_NAME);
-#endif
-#ifdef PORT_INFO
- test_print("*** Port Info: ");
- test_println(PORT_INFO);
-#endif
-}
-
-/*
- * Global test buffer holding 5 working areas.
- */
-ALIGNED_VAR(PORT_WORKING_AREA_ALIGN) uint8_t test_buffer[WA_SIZE * 5];
-
-/*
- * Pointers to the spawned threads.
- */
-thread_t *threads[MAX_THREADS];
-
-/*
- * Pointers to the working areas.
- */
-void * ROMCONST wa[5] = {test_buffer + (WA_SIZE * 0),
- test_buffer + (WA_SIZE * 1),
- test_buffer + (WA_SIZE * 2),
- test_buffer + (WA_SIZE * 3),
- test_buffer + (WA_SIZE * 4)};
-
-/*
- * Sets a termination request in all the test-spawned threads.
- */
-void test_terminate_threads(void) {
- unsigned i;
-
- for (i = 0; i < MAX_THREADS; i++)
- if (threads[i])
- chThdTerminate(threads[i]);
-}
-
-/*
- * Waits for the completion of all the test-spawned threads.
- */
-void test_wait_threads(void) {
- unsigned i;
-
- for (i = 0; i < MAX_THREADS; i++)
- if (threads[i] != NULL) {
- chThdWait(threads[i]);
- threads[i] = NULL;
- }
-}
-
-/*
- * Delays execution until next system time tick.
- */
-systime_t test_wait_tick(void) {
-
- chThdSleep(1);
- return chVTGetSystemTime();
+ <value><![CDATA[void test_print_port_info(void) {
+
+#ifdef PORT_COMPILER_NAME
+ test_print("*** Compiler: ");
+ test_println(PORT_COMPILER_NAME);
+#endif
+ test_print("*** Architecture: ");
+ test_println(PORT_ARCHITECTURE_NAME);
+#ifdef PORT_CORE_VARIANT_NAME
+ test_print("*** Core Variant: ");
+ test_println(PORT_CORE_VARIANT_NAME);
+#endif
+#ifdef PORT_INFO
+ test_print("*** Port Info: ");
+ test_println(PORT_INFO);
+#endif
+}
+
+/*
+ * Global test buffer holding 5 working areas.
+ */
+ALIGNED_VAR(PORT_WORKING_AREA_ALIGN) uint8_t test_buffer[WA_SIZE * 5];
+
+/*
+ * Pointers to the spawned threads.
+ */
+thread_t *threads[MAX_THREADS];
+
+/*
+ * Pointers to the working areas.
+ */
+void * ROMCONST wa[5] = {test_buffer + (WA_SIZE * 0),
+ test_buffer + (WA_SIZE * 1),
+ test_buffer + (WA_SIZE * 2),
+ test_buffer + (WA_SIZE * 3),
+ test_buffer + (WA_SIZE * 4)};
+
+/*
+ * Sets a termination request in all the test-spawned threads.
+ */
+void test_terminate_threads(void) {
+ unsigned i;
+
+ for (i = 0; i < MAX_THREADS; i++)
+ if (threads[i])
+ chThdTerminate(threads[i]);
+}
+
+/*
+ * Waits for the completion of all the test-spawned threads.
+ */
+void test_wait_threads(void) {
+ unsigned i;
+
+ for (i = 0; i < MAX_THREADS; i++)
+ if (threads[i] != NULL) {
+ chThdWait(threads[i]);
+ threads[i] = NULL;
+ }
+}
+
+/*
+ * Delays execution until next system time tick.
+ */
+systime_t test_wait_tick(void) {
+
+ chThdSleep(1);
+ return chVTGetSystemTime();
}]]></value>
</global_code>
</global_data_and_code>
@@ -194,20 +197,20 @@ systime_t test_wait_tick(void) {
<value />
</tags>
<code>
- <value><![CDATA[test_println("--- Product: ChibiOS/RT");
-test_print("--- Stable Flag: ");
-test_printn(CH_KERNEL_STABLE);
-test_println("");
-test_print("--- Version String: ");
-test_println(CH_KERNEL_VERSION);
-test_print("--- Major Number: ");
-test_printn(CH_KERNEL_MAJOR);
-test_println("");
-test_print("--- Minor Number: ");
-test_printn(CH_KERNEL_MINOR);
-test_println("");
-test_print("--- Patch Number: ");
-test_printn(CH_KERNEL_PATCH);
+ <value><![CDATA[test_println("--- Product: ChibiOS/RT");
+test_print("--- Stable Flag: ");
+test_printn(CH_KERNEL_STABLE);
+test_println("");
+test_print("--- Version String: ");
+test_println(CH_KERNEL_VERSION);
+test_print("--- Major Number: ");
+test_printn(CH_KERNEL_MAJOR);
+test_println("");
+test_print("--- Minor Number: ");
+test_printn(CH_KERNEL_MINOR);
+test_println("");
+test_print("--- Patch Number: ");
+test_printn(CH_KERNEL_PATCH);
test_println("");]]></value>
</code>
</step>
@@ -243,107 +246,107 @@ test_println("");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_print("--- CH_CFG_ST_RESOLUTION: ");
-test_printn(CH_CFG_ST_RESOLUTION);
-test_println("");
-test_print("--- CH_CFG_ST_FREQUENCY: ");
-test_printn(CH_CFG_ST_FREQUENCY);
-test_println("");
-test_print("--- CH_CFG_ST_TIMEDELTA: ");
-test_printn(CH_CFG_ST_TIMEDELTA);
-test_println("");
-test_print("--- CH_CFG_TIME_QUANTUM: ");
-test_printn(CH_CFG_TIME_QUANTUM);
-test_println("");
-test_print("--- CH_CFG_MEMCORE_SIZE: ");
-test_printn(CH_CFG_MEMCORE_SIZE);
-test_println("");
-test_print("--- CH_CFG_NO_IDLE_THREAD: ");
-test_printn(CH_CFG_NO_IDLE_THREAD);
-test_println("");
-test_print("--- CH_CFG_OPTIMIZE_SPEED: ");
-test_printn(CH_CFG_OPTIMIZE_SPEED);
-test_println("");
-test_print("--- CH_CFG_USE_TM: ");
-test_printn(CH_CFG_USE_TM);
-test_println("");
-test_print("--- CH_CFG_USE_REGISTRY: ");
-test_printn(CH_CFG_USE_REGISTRY);
-test_println("");
-test_print("--- CH_CFG_USE_WAITEXIT: ");
-test_printn(CH_CFG_USE_WAITEXIT);
-test_println("");
-test_print("--- CH_CFG_USE_SEMAPHORES: ");
-test_printn(CH_CFG_USE_SEMAPHORES);
-test_println("");
-test_print("--- CH_CFG_USE_SEMAPHORES_PRI: ");
-test_printn(CH_CFG_USE_SEMAPHORES_PRIORITY);
-test_println("");
-test_print("--- CH_CFG_USE_MUTEXES: ");
-test_printn(CH_CFG_USE_MUTEXES);
-test_println("");
-test_print("--- CH_CFG_USE_MUTEXES_RECURS: ");
-test_printn(CH_CFG_USE_MUTEXES_RECURSIVE);
-test_println("");
-test_print("--- CH_CFG_USE_CONDVARS: ");
-test_printn(CH_CFG_USE_CONDVARS);
-test_println("");
-test_print("--- CH_CFG_USE_CONDVARS_TIMEO: ");
-test_printn(CH_CFG_USE_CONDVARS_TIMEOUT);
-test_println("");
-test_print("--- CH_CFG_USE_EVENTS: ");
-test_printn(CH_CFG_USE_EVENTS);
-test_println("");
-test_print("--- CH_CFG_USE_EVENTS_TIMEOUT: ");
-test_printn(CH_CFG_USE_EVENTS_TIMEOUT);
-test_println("");
-test_print("--- CH_CFG_USE_MESSAGES: ");
-test_printn(CH_CFG_USE_MESSAGES);
-test_println("");
-test_print("--- CH_CFG_USE_MESSAGES_PRI: ");
-test_printn(CH_CFG_USE_MESSAGES_PRIORITY);
-test_println("");
-test_print("--- CH_CFG_USE_MAILBOXES: ");
-test_printn(CH_CFG_USE_MAILBOXES);
-test_println("");
-test_print("--- CH_CFG_USE_MEMCORE: ");
-test_printn(CH_CFG_USE_MEMCORE);
-test_println("");
-test_print("--- CH_CFG_USE_HEAP: ");
-test_printn(CH_CFG_USE_HEAP);
-test_println("");
-test_print("--- CH_CFG_USE_MEMPOOLS: ");
-test_printn(CH_CFG_USE_MEMPOOLS);
-test_println("");
-test_print("--- CH_CFG_USE_DYNAMIC: ");
-test_printn(CH_CFG_USE_DYNAMIC);
-test_println("");
-test_print("--- CH_DBG_STATISTICS: ");
-test_printn(CH_DBG_STATISTICS);
-test_println("");
-test_print("--- CH_DBG_SYSTEM_STATE_CHECK: ");
-test_printn(CH_DBG_SYSTEM_STATE_CHECK);
-test_println("");
-test_print("--- CH_DBG_ENABLE_CHECKS: ");
-test_printn(CH_DBG_ENABLE_CHECKS);
-test_println("");
-test_print("--- CH_DBG_ENABLE_ASSERTS: ");
-test_printn(CH_DBG_ENABLE_ASSERTS);
-test_println("");
-test_print("--- CH_DBG_TRACE_MASK: ");
-test_printn(CH_DBG_TRACE_MASK);
-test_println("");
-test_print("--- CH_DBG_TRACE_BUFFER_SIZE: ");
-test_printn(CH_DBG_TRACE_BUFFER_SIZE);
-test_println("");
-test_print("--- CH_DBG_ENABLE_STACK_CHECK: ");
-test_printn(CH_DBG_ENABLE_STACK_CHECK);
-test_println("");
-test_print("--- CH_DBG_FILL_THREADS: ");
-test_printn(CH_DBG_FILL_THREADS);
-test_println("");
-test_print("--- CH_DBG_THREADS_PROFILING: ");
-test_printn(CH_DBG_THREADS_PROFILING);
+ <value><![CDATA[test_print("--- CH_CFG_ST_RESOLUTION: ");
+test_printn(CH_CFG_ST_RESOLUTION);
+test_println("");
+test_print("--- CH_CFG_ST_FREQUENCY: ");
+test_printn(CH_CFG_ST_FREQUENCY);
+test_println("");
+test_print("--- CH_CFG_ST_TIMEDELTA: ");
+test_printn(CH_CFG_ST_TIMEDELTA);
+test_println("");
+test_print("--- CH_CFG_TIME_QUANTUM: ");
+test_printn(CH_CFG_TIME_QUANTUM);
+test_println("");
+test_print("--- CH_CFG_MEMCORE_SIZE: ");
+test_printn(CH_CFG_MEMCORE_SIZE);
+test_println("");
+test_print("--- CH_CFG_NO_IDLE_THREAD: ");
+test_printn(CH_CFG_NO_IDLE_THREAD);
+test_println("");
+test_print("--- CH_CFG_OPTIMIZE_SPEED: ");
+test_printn(CH_CFG_OPTIMIZE_SPEED);
+test_println("");
+test_print("--- CH_CFG_USE_TM: ");
+test_printn(CH_CFG_USE_TM);
+test_println("");
+test_print("--- CH_CFG_USE_REGISTRY: ");
+test_printn(CH_CFG_USE_REGISTRY);
+test_println("");
+test_print("--- CH_CFG_USE_WAITEXIT: ");
+test_printn(CH_CFG_USE_WAITEXIT);
+test_println("");
+test_print("--- CH_CFG_USE_SEMAPHORES: ");
+test_printn(CH_CFG_USE_SEMAPHORES);
+test_println("");
+test_print("--- CH_CFG_USE_SEMAPHORES_PRI: ");
+test_printn(CH_CFG_USE_SEMAPHORES_PRIORITY);
+test_println("");
+test_print("--- CH_CFG_USE_MUTEXES: ");
+test_printn(CH_CFG_USE_MUTEXES);
+test_println("");
+test_print("--- CH_CFG_USE_MUTEXES_RECURS: ");
+test_printn(CH_CFG_USE_MUTEXES_RECURSIVE);
+test_println("");
+test_print("--- CH_CFG_USE_CONDVARS: ");
+test_printn(CH_CFG_USE_CONDVARS);
+test_println("");
+test_print("--- CH_CFG_USE_CONDVARS_TIMEO: ");
+test_printn(CH_CFG_USE_CONDVARS_TIMEOUT);
+test_println("");
+test_print("--- CH_CFG_USE_EVENTS: ");
+test_printn(CH_CFG_USE_EVENTS);
+test_println("");
+test_print("--- CH_CFG_USE_EVENTS_TIMEOUT: ");
+test_printn(CH_CFG_USE_EVENTS_TIMEOUT);
+test_println("");
+test_print("--- CH_CFG_USE_MESSAGES: ");
+test_printn(CH_CFG_USE_MESSAGES);
+test_println("");
+test_print("--- CH_CFG_USE_MESSAGES_PRI: ");
+test_printn(CH_CFG_USE_MESSAGES_PRIORITY);
+test_println("");
+test_print("--- CH_CFG_USE_MAILBOXES: ");
+test_printn(CH_CFG_USE_MAILBOXES);
+test_println("");
+test_print("--- CH_CFG_USE_MEMCORE: ");
+test_printn(CH_CFG_USE_MEMCORE);
+test_println("");
+test_print("--- CH_CFG_USE_HEAP: ");
+test_printn(CH_CFG_USE_HEAP);
+test_println("");
+test_print("--- CH_CFG_USE_MEMPOOLS: ");
+test_printn(CH_CFG_USE_MEMPOOLS);
+test_println("");
+test_print("--- CH_CFG_USE_DYNAMIC: ");
+test_printn(CH_CFG_USE_DYNAMIC);
+test_println("");
+test_print("--- CH_DBG_STATISTICS: ");
+test_printn(CH_DBG_STATISTICS);
+test_println("");
+test_print("--- CH_DBG_SYSTEM_STATE_CHECK: ");
+test_printn(CH_DBG_SYSTEM_STATE_CHECK);
+test_println("");
+test_print("--- CH_DBG_ENABLE_CHECKS: ");
+test_printn(CH_DBG_ENABLE_CHECKS);
+test_println("");
+test_print("--- CH_DBG_ENABLE_ASSERTS: ");
+test_printn(CH_DBG_ENABLE_ASSERTS);
+test_println("");
+test_print("--- CH_DBG_TRACE_MASK: ");
+test_printn(CH_DBG_TRACE_MASK);
+test_println("");
+test_print("--- CH_DBG_TRACE_BUFFER_SIZE: ");
+test_printn(CH_DBG_TRACE_BUFFER_SIZE);
+test_println("");
+test_print("--- CH_DBG_ENABLE_STACK_CHECK: ");
+test_printn(CH_DBG_ENABLE_STACK_CHECK);
+test_println("");
+test_print("--- CH_DBG_FILL_THREADS: ");
+test_printn(CH_DBG_FILL_THREADS);
+test_println("");
+test_print("--- CH_DBG_THREADS_PROFILING: ");
+test_printn(CH_DBG_THREADS_PROFILING);
test_println("");]]></value>
</code>
</step>
@@ -365,21 +368,21 @@ test_println("");]]></value>
<value />
</condition>
<shared_code>
- <value><![CDATA[/* Timer callback for testing system functions in ISR context.*/
-static void vtcb(void *p) {
- syssts_t sts;
-
- (void)p;
-
- /* Testing normal case.*/
- chSysLockFromISR();
- chSysUnlockFromISR();
-
- /* Reentrant case.*/
- chSysLockFromISR();
- sts = chSysGetStatusAndLockX();
- chSysRestoreStatusX(sts);
- chSysUnlockFromISR();
+ <value><![CDATA[/* Timer callback for testing system functions in ISR context.*/
+static void vtcb(void *p) {
+ syssts_t sts;
+
+ (void)p;
+
+ /* Testing normal case.*/
+ chSysLockFromISR();
+ chSysUnlockFromISR();
+
+ /* Reentrant case.*/
+ chSysLockFromISR();
+ sts = chSysGetStatusAndLockX();
+ chSysRestoreStatusX(sts);
+ chSysUnlockFromISR();
}]]></value>
</shared_code>
<cases>
@@ -413,9 +416,9 @@ static void vtcb(void *p) {
<value />
</tags>
<code>
- <value><![CDATA[chSysLock();
-result = chSysIntegrityCheckI(CH_INTEGRITY_RLIST);
-chSysUnlock();
+ <value><![CDATA[chSysLock();
+result = chSysIntegrityCheckI(CH_INTEGRITY_RLIST);
+chSysUnlock();
test_assert(result == false, "ready list check failed");]]></value>
</code>
</step>
@@ -427,9 +430,9 @@ test_assert(result == false, "ready list check failed");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chSysLock();
-result = chSysIntegrityCheckI(CH_INTEGRITY_VTLIST);
-chSysUnlock();
+ <value><![CDATA[chSysLock();
+result = chSysIntegrityCheckI(CH_INTEGRITY_VTLIST);
+chSysUnlock();
test_assert(result == false, "virtual timers list check failed");]]></value>
</code>
</step>
@@ -441,9 +444,9 @@ test_assert(result == false, "virtual timers list check failed");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chSysLock();
-result = chSysIntegrityCheckI(CH_INTEGRITY_REGISTRY);
-chSysUnlock();
+ <value><![CDATA[chSysLock();
+result = chSysIntegrityCheckI(CH_INTEGRITY_REGISTRY);
+chSysUnlock();
test_assert(result == false, "registry list check failed");]]></value>
</code>
</step>
@@ -455,9 +458,9 @@ test_assert(result == false, "registry list check failed");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chSysLock();
-result = chSysIntegrityCheckI(CH_INTEGRITY_PORT);
-chSysUnlock();
+ <value><![CDATA[chSysLock();
+result = chSysIntegrityCheckI(CH_INTEGRITY_PORT);
+chSysUnlock();
test_assert(result == false, "port layer check failed");]]></value>
</code>
</step>
@@ -481,7 +484,7 @@ test_assert(result == false, "port layer check failed");]]></value>
<value />
</teardown_code>
<local_variables>
- <value><![CDATA[syssts_t sts;
+ <value><![CDATA[syssts_t sts;
virtual_timer_t vt;]]></value>
</local_variables>
</various_code>
@@ -494,7 +497,7 @@ virtual_timer_t vt;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[sts = chSysGetStatusAndLockX();
+ <value><![CDATA[sts = chSysGetStatusAndLockX();
chSysRestoreStatusX(sts);]]></value>
</code>
</step>
@@ -506,9 +509,9 @@ chSysRestoreStatusX(sts);]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chSysLock();
-sts = chSysGetStatusAndLockX();
-chSysRestoreStatusX(sts);
+ <value><![CDATA[chSysLock();
+sts = chSysGetStatusAndLockX();
+chSysRestoreStatusX(sts);
chSysUnlock();]]></value>
</code>
</step>
@@ -520,8 +523,8 @@ chSysUnlock();]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chSysUnconditionalLock();
-chSysUnconditionalLock();
+ <value><![CDATA[chSysUnconditionalLock();
+chSysUnconditionalLock();
chSysUnlock();]]></value>
</code>
</step>
@@ -533,8 +536,8 @@ chSysUnlock();]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chSysLock();
-chSysUnconditionalUnlock();
+ <value><![CDATA[chSysLock();
+chSysUnconditionalUnlock();
chSysUnconditionalUnlock();]]></value>
</code>
</step>
@@ -546,10 +549,10 @@ chSysUnconditionalUnlock();]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chVTObjectInit(&vt);
-chVTSet(&vt, 1, vtcb, NULL);
-chThdSleep(10);
-
+ <value><![CDATA[chVTObjectInit(&vt);
+chVTSet(&vt, 1, vtcb, NULL);
+chThdSleep(10);
+
test_assert(chVTIsArmed(&vt) == false, "timer still armed");]]></value>
</code>
</step>
@@ -585,9 +588,9 @@ test_assert(chVTIsArmed(&vt) == false, "timer still armed");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chSysSuspend();
-chSysDisable();
-chSysSuspend();
+ <value><![CDATA[chSysSuspend();
+chSysDisable();
+chSysSuspend();
chSysEnable();]]></value>
</code>
</step>
@@ -623,11 +626,11 @@ chSysEnable();]]></value>
<value />
</tags>
<code>
- <value><![CDATA[systime_t time = chVTGetSystemTimeX();
-while (time == chVTGetSystemTimeX()) {
-#if defined(SIMULATOR)
- _sim_check_for_interrupts();
-#endif
+ <value><![CDATA[systime_t time = chVTGetSystemTimeX();
+while (time == chVTGetSystemTimeX()) {
+#if defined(SIMULATOR)
+ _sim_check_for_interrupts();
+#endif
}]]></value>
</code>
</step>
@@ -649,9 +652,9 @@ while (time == chVTGetSystemTimeX()) {
<value />
</condition>
<shared_code>
- <value><![CDATA[static THD_FUNCTION(thread, p) {
-
- test_emit_token(*(char *)p);
+ <value><![CDATA[static THD_FUNCTION(thread, p) {
+
+ test_emit_token(*(char *)p);
}]]></value>
</shared_code>
<cases>
@@ -685,10 +688,10 @@ while (time == chVTGetSystemTimeX()) {
<value />
</tags>
<code>
- <value><![CDATA[time = chVTGetSystemTimeX();
-chThdSleep(100);
-test_assert_time_window(time + 100,
- time + 100 + CH_CFG_ST_TIMEDELTA + 1,
+ <value><![CDATA[time = chVTGetSystemTimeX();
+chThdSleep(100);
+test_assert_time_window(time + 100,
+ time + 100 + CH_CFG_ST_TIMEDELTA + 1,
"out of time window");]]></value>
</code>
</step>
@@ -700,10 +703,10 @@ test_assert_time_window(time + 100,
<value />
</tags>
<code>
- <value><![CDATA[time = chVTGetSystemTimeX();
-chThdSleepMicroseconds(100000);
-test_assert_time_window(time + US2ST(100000),
- time + US2ST(100000) + CH_CFG_ST_TIMEDELTA + 1,
+ <value><![CDATA[time = chVTGetSystemTimeX();
+chThdSleepMicroseconds(100000);
+test_assert_time_window(time + TIME_US2I(100000),
+ time + TIME_US2I(100000) + CH_CFG_ST_TIMEDELTA + 1,
"out of time window");]]></value>
</code>
</step>
@@ -715,10 +718,10 @@ test_assert_time_window(time + US2ST(100000),
<value />
</tags>
<code>
- <value><![CDATA[time = chVTGetSystemTimeX();
-chThdSleepMilliseconds(100);
-test_assert_time_window(time + MS2ST(100),
- time + MS2ST(100) + CH_CFG_ST_TIMEDELTA + 1,
+ <value><![CDATA[time = chVTGetSystemTimeX();
+chThdSleepMilliseconds(100);
+test_assert_time_window(time + TIME_MS2I(100),
+ time + TIME_MS2I(100) + CH_CFG_ST_TIMEDELTA + 1,
"out of time window");]]></value>
</code>
</step>
@@ -730,10 +733,10 @@ test_assert_time_window(time + MS2ST(100),
<value />
</tags>
<code>
- <value><![CDATA[time = chVTGetSystemTimeX();
-chThdSleepSeconds(1);
-test_assert_time_window(time + S2ST(1),
- time + S2ST(1) + CH_CFG_ST_TIMEDELTA + 1,
+ <value><![CDATA[time = chVTGetSystemTimeX();
+chThdSleepSeconds(1);
+test_assert_time_window(time + TIME_S2I(1),
+ time + TIME_S2I(1) + CH_CFG_ST_TIMEDELTA + 1,
"out of time window");]]></value>
</code>
</step>
@@ -745,10 +748,10 @@ test_assert_time_window(time + S2ST(1),
<value />
</tags>
<code>
- <value><![CDATA[time = chVTGetSystemTimeX();
-chThdSleepUntil(time + 100);
-test_assert_time_window(time + 100,
- time + 100 + CH_CFG_ST_TIMEDELTA + 1,
+ <value><![CDATA[time = chVTGetSystemTimeX();
+chThdSleepUntil(time + 100);
+test_assert_time_window(time + 100,
+ time + 100 + CH_CFG_ST_TIMEDELTA + 1,
"out of time window");]]></value>
</code>
</step>
@@ -784,12 +787,12 @@ test_assert_time_window(time + 100,
<value />
</tags>
<code>
- <value><![CDATA[threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()-5, thread, "E");
-threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriorityX()-4, thread, "D");
-threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriorityX()-3, thread, "C");
-threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriorityX()-2, thread, "B");
-threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriorityX()-1, thread, "A");
-test_wait_threads();
+ <value><![CDATA[threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()-5, thread, "E");
+threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriorityX()-4, thread, "D");
+threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriorityX()-3, thread, "C");
+threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriorityX()-2, thread, "B");
+threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriorityX()-1, thread, "A");
+test_wait_threads();
test_assert_sequence("ABCDE", "invalid sequence");]]></value>
</code>
</step>
@@ -801,12 +804,12 @@ test_assert_sequence("ABCDE", "invalid sequence");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriorityX()-1, thread, "A");
-threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriorityX()-2, thread, "B");
-threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriorityX()-3, thread, "C");
-threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriorityX()-4, thread, "D");
-threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()-5, thread, "E");
-test_wait_threads();
+ <value><![CDATA[threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriorityX()-1, thread, "A");
+threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriorityX()-2, thread, "B");
+threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriorityX()-3, thread, "C");
+threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriorityX()-4, thread, "D");
+threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()-5, thread, "E");
+test_wait_threads();
test_assert_sequence("ABCDE", "invalid sequence");]]></value>
</code>
</step>
@@ -818,12 +821,12 @@ test_assert_sequence("ABCDE", "invalid sequence");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriorityX()-4, thread, "D");
-threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()-5, thread, "E");
-threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriorityX()-1, thread, "A");
-threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriorityX()-2, thread, "B");
-threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriorityX()-3, thread, "C");
-test_wait_threads();
+ <value><![CDATA[threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriorityX()-4, thread, "D");
+threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()-5, thread, "E");
+threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriorityX()-1, thread, "A");
+threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriorityX()-2, thread, "B");
+threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriorityX()-3, thread, "C");
+test_wait_threads();
test_assert_sequence("ABCDE", "invalid sequence");]]></value>
</code>
</step>
@@ -859,9 +862,9 @@ test_assert_sequence("ABCDE", "invalid sequence");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[prio = chThdGetPriorityX();
-p1 = chThdSetPriority(prio + 1);
-test_assert(p1 == prio, "unexpected returned priority level");
+ <value><![CDATA[prio = chThdGetPriorityX();
+p1 = chThdSetPriority(prio + 1);
+test_assert(p1 == prio, "unexpected returned priority level");
test_assert(chThdGetPriorityX() == prio + 1, "unexpected priority level");]]></value>
</code>
</step>
@@ -873,8 +876,8 @@ test_assert(chThdGetPriorityX() == prio + 1, "unexpected priority level");]]></v
<value />
</tags>
<code>
- <value><![CDATA[p1 = chThdSetPriority(p1);
-test_assert(p1 == prio + 1, "unexpected returned priority level");
+ <value><![CDATA[p1 = chThdSetPriority(p1);
+test_assert(p1 == prio + 1, "unexpected returned priority level");
test_assert(chThdGetPriorityX() == prio, "unexpected priority level");]]></value>
</code>
</step>
@@ -910,8 +913,8 @@ test_assert(chThdGetPriorityX() == prio, "unexpected priority level");]]></value
<value />
</tags>
<code>
- <value><![CDATA[prio = chThdGetPriorityX();
-chThdGetSelfX()->prio += 2;
+ <value><![CDATA[prio = chThdGetPriorityX();
+chThdGetSelfX()->prio += 2;
test_assert(chThdGetPriorityX() == prio + 2, "unexpected priority level");]]></value>
</code>
</step>
@@ -923,9 +926,9 @@ test_assert(chThdGetPriorityX() == prio + 2, "unexpected priority level");]]></v
<value />
</tags>
<code>
- <value><![CDATA[p1 = chThdSetPriority(prio + 1);
-test_assert(p1 == prio, "unexpected returned priority level");
-test_assert(chThdGetSelfX()->prio == prio + 2, "unexpected priority level");
+ <value><![CDATA[p1 = chThdSetPriority(prio + 1);
+test_assert(p1 == prio, "unexpected returned priority level");
+test_assert(chThdGetSelfX()->prio == prio + 2, "unexpected priority level");
test_assert(chThdGetSelfX()->realprio == prio + 1, "unexpected returned real priority level");]]></value>
</code>
</step>
@@ -937,9 +940,9 @@ test_assert(chThdGetSelfX()->realprio == prio + 1, "unexpected returned real pri
<value />
</tags>
<code>
- <value><![CDATA[p1 = chThdSetPriority(prio + 3);
-test_assert(p1 == prio + 1, "unexpected returned priority level");
-test_assert(chThdGetSelfX()->prio == prio + 3, "unexpected priority level");
+ <value><![CDATA[p1 = chThdSetPriority(prio + 3);
+test_assert(p1 == prio + 1, "unexpected returned priority level");
+test_assert(chThdGetSelfX()->prio == prio + 3, "unexpected priority level");
test_assert(chThdGetSelfX()->realprio == prio + 3, "unexpected real priority level");]]></value>
</code>
</step>
@@ -951,9 +954,9 @@ test_assert(chThdGetSelfX()->realprio == prio + 3, "unexpected real priority lev
<value />
</tags>
<code>
- <value><![CDATA[chSysLock();
-chThdGetSelfX()->prio = prio;
-chThdGetSelfX()->realprio = prio;
+ <value><![CDATA[chSysLock();
+chThdGetSelfX()->prio = prio;
+chThdGetSelfX()->realprio = prio;
chSysUnlock();]]></value>
</code>
</step>
@@ -975,15 +978,15 @@ chSysUnlock();]]></value>
<value />
</condition>
<shared_code>
- <value><![CDATA[static thread_reference_t tr1;
-
-static THD_FUNCTION(thread1, p) {
-
- chSysLock();
- chThdResumeI(&tr1, MSG_OK);
- chSchRescheduleS();
- chSysUnlock();
- test_emit_token(*(char *)p);
+ <value><![CDATA[static thread_reference_t tr1;
+
+static THD_FUNCTION(thread1, p) {
+
+ chSysLock();
+ chThdResumeI(&tr1, MSG_OK);
+ chSchRescheduleS();
+ chSysUnlock();
+ test_emit_token(*(char *)p);
}]]></value>
</shared_code>
<cases>
@@ -1005,7 +1008,7 @@ static THD_FUNCTION(thread1, p) {
<value />
</teardown_code>
<local_variables>
- <value><![CDATA[systime_t time;
+ <value><![CDATA[systime_t time;
msg_t msg;]]></value>
</local_variables>
</various_code>
@@ -1018,12 +1021,12 @@ msg_t msg;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()-1, thread1, "A");
-chSysLock();
-msg = chThdSuspendTimeoutS(&tr1, TIME_INFINITE);
-chSysUnlock();
-test_assert(NULL == tr1, "not NULL");
-test_assert(MSG_OK == msg,"wrong returned message");
+ <value><![CDATA[threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()-1, thread1, "A");
+chSysLock();
+msg = chThdSuspendTimeoutS(&tr1, TIME_INFINITE);
+chSysUnlock();
+test_assert(NULL == tr1, "not NULL");
+test_assert(MSG_OK == msg,"wrong returned message");
test_wait_threads();]]></value>
</code>
</step>
@@ -1035,14 +1038,14 @@ test_wait_threads();]]></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) + CH_CFG_ST_TIMEDELTA + 1,
- "out of time window");
-test_assert(NULL == tr1, "not NULL");
+ <value><![CDATA[chSysLock();
+time = chVTGetSystemTimeX();
+msg = chThdSuspendTimeoutS(&tr1, TIME_MS2I(1000));
+chSysUnlock();
+test_assert_time_window(time + TIME_MS2I(1000),
+ time + TIME_MS2I(1000) + CH_CFG_ST_TIMEDELTA + 1,
+ "out of time window");
+test_assert(NULL == tr1, "not NULL");
test_assert(MSG_TIMEOUT == msg, "wrong returned message");]]></value>
</code>
</step>
@@ -1064,36 +1067,36 @@ test_assert(MSG_TIMEOUT == msg, "wrong returned message");]]></value>
<value>CH_CFG_USE_SEMAPHORES</value>
</condition>
<shared_code>
- <value><![CDATA[#include "ch.h"
-
-static semaphore_t sem1;
-
-static THD_FUNCTION(thread1, p) {
-
- chSemWait(&sem1);
- test_emit_token(*(char *)p);
-}
-
-static THD_FUNCTION(thread2, p) {
-
- (void)p;
- chThdSleepMilliseconds(50);
- chSysLock();
- chSemSignalI(&sem1); /* For coverage reasons */
- chSchRescheduleS();
- chSysUnlock();
-}
-
-static THD_FUNCTION(thread3, p) {
-
- (void)p;
- chSemWait(&sem1);
- chSemSignal(&sem1);
-}
-
-static THD_FUNCTION(thread4, p) {
-
- chBSemSignal((binary_semaphore_t *)p);
+ <value><![CDATA[#include "ch.h"
+
+static semaphore_t sem1;
+
+static THD_FUNCTION(thread1, p) {
+
+ chSemWait(&sem1);
+ test_emit_token(*(char *)p);
+}
+
+static THD_FUNCTION(thread2, p) {
+
+ (void)p;
+ chThdSleepMilliseconds(50);
+ chSysLock();
+ chSemSignalI(&sem1); /* For coverage reasons */
+ chSchRescheduleS();
+ chSysUnlock();
+}
+
+static THD_FUNCTION(thread3, p) {
+
+ (void)p;
+ chSemWait(&sem1);
+ chSemSignal(&sem1);
+}
+
+static THD_FUNCTION(thread4, p) {
+
+ chBSemSignal((binary_semaphore_t *)p);
}]]></value>
</shared_code>
<cases>
@@ -1127,10 +1130,10 @@ static THD_FUNCTION(thread4, p) {
<value />
</tags>
<code>
- <value><![CDATA[msg_t msg;
-
-msg = chSemWait(&sem1);
-test_assert_lock(chSemGetCounterI(&sem1) == 0, "wrong counter value");
+ <value><![CDATA[msg_t msg;
+
+msg = chSemWait(&sem1);
+test_assert_lock(chSemGetCounterI(&sem1) == 0, "wrong counter value");
test_assert(MSG_OK == msg, "wrong returned message");]]></value>
</code>
</step>
@@ -1142,7 +1145,7 @@ test_assert(MSG_OK == msg, "wrong returned message");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chSemSignal(&sem1);
+ <value><![CDATA[chSemSignal(&sem1);
test_assert_lock(chSemGetCounterI(&sem1) == 1, "wrong counter value");]]></value>
</code>
</step>
@@ -1154,7 +1157,7 @@ test_assert_lock(chSemGetCounterI(&sem1) == 1, "wrong counter value");]]></value
<value />
</tags>
<code>
- <value><![CDATA[chSemReset(&sem1, 2);
+ <value><![CDATA[chSemReset(&sem1, 2);
test_assert_lock(chSemGetCounterI(&sem1) == 2, "wrong counter value");]]></value>
</code>
</step>
@@ -1190,10 +1193,10 @@ test_assert_lock(chSemGetCounterI(&sem1) == 2, "wrong counter value");]]></value
<value />
</tags>
<code>
- <value><![CDATA[threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()+5, thread1, "A");
-threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriorityX()+1, thread1, "B");
-threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriorityX()+3, thread1, "C");
-threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriorityX()+4, thread1, "D");
+ <value><![CDATA[threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()+5, thread1, "A");
+threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriorityX()+1, thread1, "B");
+threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriorityX()+3, thread1, "C");
+threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriorityX()+4, thread1, "D");
threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriorityX()+2, thread1, "E");]]></value>
</code>
</step>
@@ -1205,16 +1208,16 @@ threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriorityX()+2, thread1, "
<value />
</tags>
<code>
- <value><![CDATA[chSemSignal(&sem1);
-chSemSignal(&sem1);
-chSemSignal(&sem1);
-chSemSignal(&sem1);
-chSemSignal(&sem1);
-test_wait_threads();
-#if CH_CFG_USE_SEMAPHORES_PRIORITY
-test_assert_sequence("ADCEB", "invalid sequence");
-#else
-test_assert_sequence("ABCDE", "invalid sequence");
+ <value><![CDATA[chSemSignal(&sem1);
+chSemSignal(&sem1);
+chSemSignal(&sem1);
+chSemSignal(&sem1);
+chSemSignal(&sem1);
+test_wait_threads();
+#if CH_CFG_USE_SEMAPHORES_PRIORITY
+test_assert_sequence("ADCEB", "invalid sequence");
+#else
+test_assert_sequence("ABCDE", "invalid sequence");
#endif]]></value>
</code>
</step>
@@ -1238,8 +1241,8 @@ test_assert_sequence("ABCDE", "invalid sequence");
<value />
</teardown_code>
<local_variables>
- <value><![CDATA[unsigned i;
-systime_t target_time;
+ <value><![CDATA[unsigned i;
+systime_t target_time;
msg_t msg;]]></value>
</local_variables>
</various_code>
@@ -1252,9 +1255,9 @@ msg_t msg;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[msg = chSemWaitTimeout(&sem1, TIME_IMMEDIATE);
-test_assert(msg == MSG_TIMEOUT, "wrong wake-up message");
-test_assert(queue_isempty(&sem1.queue), "queue not empty");
+ <value><![CDATA[msg = chSemWaitTimeout(&sem1, TIME_IMMEDIATE);
+test_assert(msg == MSG_TIMEOUT, "wrong wake-up message");
+test_assert(queue_isempty(&sem1.queue), "queue not empty");
test_assert(sem1.cnt == 0, "counter not zero");]]></value>
</code>
</step>
@@ -1266,12 +1269,12 @@ test_assert(sem1.cnt == 0, "counter not zero");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() - 1,
- thread2, 0);
-msg = chSemWaitTimeout(&sem1, MS2ST(500));
-test_wait_threads();
-test_assert(msg == MSG_OK, "wrong wake-up message");
-test_assert(queue_isempty(&sem1.queue), "queue not empty");
+ <value><![CDATA[threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() - 1,
+ thread2, 0);
+msg = chSemWaitTimeout(&sem1, TIME_MS2I(500));
+test_wait_threads();
+test_assert(msg == MSG_OK, "wrong wake-up message");
+test_assert(queue_isempty(&sem1.queue), "queue not empty");
test_assert(sem1.cnt == 0, "counter not zero");]]></value>
</code>
</step>
@@ -1283,16 +1286,16 @@ test_assert(sem1.cnt == 0, "counter not zero");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[target_time = test_wait_tick() + MS2ST(5 * 50);
-for (i = 0; i < 5; i++) {
- test_emit_token('A' + i);
- msg = chSemWaitTimeout(&sem1, MS2ST(50));
- test_assert(msg == MSG_TIMEOUT, "wrong wake-up message");
- test_assert(queue_isempty(&sem1.queue), "queue not empty");
- test_assert(sem1.cnt == 0, "counter not zero");
-}
-test_assert_sequence("ABCDE", "invalid sequence");
-test_assert_time_window(target_time, target_time + ALLOWED_DELAY,
+ <value><![CDATA[target_time = test_wait_tick() + TIME_MS2I(5 * 50);
+for (i = 0; i < 5; i++) {
+ test_emit_token('A' + i);
+ msg = chSemWaitTimeout(&sem1, TIME_MS2I(50));
+ test_assert(msg == MSG_TIMEOUT, "wrong wake-up message");
+ test_assert(queue_isempty(&sem1.queue), "queue not empty");
+ test_assert(sem1.cnt == 0, "counter not zero");
+}
+test_assert_sequence("ABCDE", "invalid sequence");
+test_assert_time_window(target_time, target_time + ALLOWED_DELAY,
"out of time window");]]></value>
</code>
</step>
@@ -1339,12 +1342,12 @@ test_assert_time_window(target_time, target_time + ALLOWED_DELAY,
<value />
</tags>
<code>
- <value><![CDATA[chSysLock();
-chSemAddCounterI(&sem1, 2);
-chSchRescheduleS();
-chSysUnlock();
-test_wait_threads();
-test_assert_lock(chSemGetCounterI(&sem1) == 1, "invalid counter");
+ <value><![CDATA[chSysLock();
+chSemAddCounterI(&sem1, 2);
+chSchRescheduleS();
+chSysUnlock();
+test_wait_threads();
+test_assert_lock(chSemGetCounterI(&sem1) == 1, "invalid counter");
test_assert_sequence("A", "invalid sequence");]]></value>
</code>
</step>
@@ -1391,8 +1394,8 @@ test_assert_sequence("A", "invalid sequence");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chSemSignalWait(&sem1, &sem1);
-test_assert(queue_isempty(&sem1.queue), "queue not empty");
+ <value><![CDATA[chSemSignalWait(&sem1, &sem1);
+test_assert(queue_isempty(&sem1.queue), "queue not empty");
test_assert(sem1.cnt == 0, "counter not zero");]]></value>
</code>
</step>
@@ -1404,8 +1407,8 @@ test_assert(sem1.cnt == 0, "counter not zero");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chSemSignalWait(&sem1, &sem1);
-test_assert(queue_isempty(&sem1.queue), "queue not empty");
+ <value><![CDATA[chSemSignalWait(&sem1, &sem1);
+test_assert(queue_isempty(&sem1.queue), "queue not empty");
test_assert(sem1.cnt == 0, "counter not zero");]]></value>
</code>
</step>
@@ -1429,7 +1432,7 @@ test_assert(sem1.cnt == 0, "counter not zero");]]></value>
<value><![CDATA[test_wait_threads();]]></value>
</teardown_code>
<local_variables>
- <value><![CDATA[binary_semaphore_t bsem;
+ <value><![CDATA[binary_semaphore_t bsem;
msg_t msg;]]></value>
</local_variables>
</various_code>
@@ -1442,7 +1445,7 @@ msg_t msg;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chBSemObjectInit(&bsem, true);
+ <value><![CDATA[chBSemObjectInit(&bsem, true);
test_assert_lock(chBSemGetStateI(&bsem) == true, "not taken");]]></value>
</code>
</step>
@@ -1454,7 +1457,7 @@ test_assert_lock(chBSemGetStateI(&bsem) == true, "not taken");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chBSemReset(&bsem, true);
+ <value><![CDATA[chBSemReset(&bsem, true);
test_assert_lock(chBSemGetStateI(&bsem) == true, "not taken");]]></value>
</code>
</step>
@@ -1466,7 +1469,7 @@ test_assert_lock(chBSemGetStateI(&bsem) == true, "not taken");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[threads[0] = chThdCreateStatic(wa[0], WA_SIZE,
+ <value><![CDATA[threads[0] = chThdCreateStatic(wa[0], WA_SIZE,
chThdGetPriorityX()-1, thread4, &bsem);]]></value>
</code>
</step>
@@ -1478,8 +1481,8 @@ test_assert_lock(chBSemGetStateI(&bsem) == true, "not taken");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[msg = chBSemWait(&bsem);
-test_assert_lock(chBSemGetStateI(&bsem) == true, "not taken");
+ <value><![CDATA[msg = chBSemWait(&bsem);
+test_assert_lock(chBSemGetStateI(&bsem) == true, "not taken");
test_assert(msg == MSG_OK, "unexpected message");]]></value>
</code>
</step>
@@ -1491,8 +1494,8 @@ test_assert(msg == MSG_OK, "unexpected message");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chBSemSignal(&bsem);
-test_assert_lock(chBSemGetStateI(&bsem) ==false, "still taken");
+ <value><![CDATA[chBSemSignal(&bsem);
+test_assert_lock(chBSemGetStateI(&bsem) ==false, "still taken");
test_assert_lock(chSemGetCounterI(&bsem.sem) == 1, "unexpected counter");]]></value>
</code>
</step>
@@ -1504,8 +1507,8 @@ test_assert_lock(chSemGetCounterI(&bsem.sem) == 1, "unexpected counter");]]></va
<value />
</tags>
<code>
- <value><![CDATA[chBSemSignal(&bsem);
-test_assert_lock(chBSemGetStateI(&bsem) == false, "taken");
+ <value><![CDATA[chBSemSignal(&bsem);
+test_assert_lock(chBSemGetStateI(&bsem) == false, "taken");
test_assert_lock(chSemGetCounterI(&bsem.sem) == 1, "unexpected counter");]]></value>
</code>
</step>
@@ -1527,178 +1530,178 @@ test_assert_lock(chSemGetCounterI(&bsem.sem) == 1, "unexpected counter");]]></va
<value>CH_CFG_USE_MUTEXES</value>
</condition>
<shared_code>
- <value><![CDATA[static MUTEX_DECL(m1);
-static MUTEX_DECL(m2);
-#if CH_CFG_USE_CONDVARS || defined(__DOXYGEN__)
-static CONDVAR_DECL(c1);
-#endif
-
-#if CH_DBG_THREADS_PROFILING || defined(__DOXYGEN__)
-/**
- * @brief CPU pulse.
- * @note The current implementation is not totally reliable.
- *
- * @param[in] duration CPU pulse duration in milliseconds
- */
-void test_cpu_pulse(unsigned duration) {
- systime_t start, end, now;
-
- start = chThdGetTicksX(chThdGetSelfX());
- end = start + MS2ST(duration);
- do {
- now = chThdGetTicksX(chThdGetSelfX());
-#if defined(SIMULATOR)
- _sim_check_for_interrupts();
-#endif
- }
- while (chVTIsTimeWithinX(now, start, end));
-}
-#endif /* CH_DBG_THREADS_PROFILING */
-
-static THD_FUNCTION(thread1, p) {
-
- chMtxLock(&m1);
- test_emit_token(*(char *)p);
- chMtxUnlock(&m1);
-}
-
-#if CH_DBG_THREADS_PROFILING || defined(__DOXYGEN__)
-/* Low priority thread */
-static THD_FUNCTION(thread2L, p) {
-
- (void)p;
- chMtxLock(&m1);
- test_cpu_pulse(40);
- chMtxUnlock(&m1);
- test_cpu_pulse(10);
- test_emit_token('C');
-}
-
-/* Medium priority thread */
-static THD_FUNCTION(thread2M, p) {
-
- (void)p;
- chThdSleepMilliseconds(20);
- test_cpu_pulse(40);
- test_emit_token('B');
-}
-
-/* High priority thread */
-static THD_FUNCTION(thread2H, p) {
-
- (void)p;
- chThdSleepMilliseconds(40);
- chMtxLock(&m1);
- test_cpu_pulse(10);
- chMtxUnlock(&m1);
- test_emit_token('A');
-}
-
-/* Lowest priority thread */
-static THD_FUNCTION(thread3LL, p) {
-
- (void)p;
- chMtxLock(&m1);
- test_cpu_pulse(30);
- chMtxUnlock(&m1);
- test_emit_token('E');
-}
-
-/* Low priority thread */
-static THD_FUNCTION(thread3L, p) {
-
- (void)p;
- chThdSleepMilliseconds(10);
- chMtxLock(&m2);
- test_cpu_pulse(20);
- chMtxLock(&m1);
- test_cpu_pulse(10);
- chMtxUnlock(&m1);
- test_cpu_pulse(10);
- chMtxUnlock(&m2);
- test_emit_token('D');
-}
-
-/* Medium priority thread */
-static THD_FUNCTION(thread3M, p) {
-
- (void)p;
- chThdSleepMilliseconds(20);
- chMtxLock(&m2);
- test_cpu_pulse(10);
- chMtxUnlock(&m2);
- test_emit_token('C');
-}
-
-/* High priority thread */
-static THD_FUNCTION(thread3H, p) {
-
- (void)p;
- chThdSleepMilliseconds(40);
- test_cpu_pulse(20);
- test_emit_token('B');
-}
-
-/* Highest priority thread */
-static THD_FUNCTION(thread3HH, p) {
-
- (void)p;
- chThdSleepMilliseconds(50);
- chMtxLock(&m2);
- test_cpu_pulse(10);
- chMtxUnlock(&m2);
- test_emit_token('A');
-}
-#endif /* CH_DBG_THREADS_PROFILING */
-
-static THD_FUNCTION(thread4A, p) {
-
- (void)p;
- chThdSleepMilliseconds(50);
- chMtxLock(&m1);
- chMtxUnlock(&m1);
-}
-
-static THD_FUNCTION(thread4B, p) {
-
- (void)p;
- chThdSleepMilliseconds(150);
- chSysLock();
- chMtxLockS(&m2); /* For coverage of the chMtxLockS() function variant.*/
- chMtxUnlockS(&m2); /* For coverage of the chMtxUnlockS() function variant.*/
- chSchRescheduleS();
- chSysUnlock();
-}
-
-#if CH_CFG_USE_CONDVARS || defined(__DOXYGEN__)
-static THD_FUNCTION(thread6, p) {
-
- chMtxLock(&m1);
- chCondWait(&c1);
- test_emit_token(*(char *)p);
- chMtxUnlock(&m1);
-}
-
-static THD_FUNCTION(thread8, p) {
-
- chMtxLock(&m2);
- chMtxLock(&m1);
-#if CH_CFG_USE_CONDVARS_TIMEOUT || defined(__DOXYGEN__)
- chCondWaitTimeout(&c1, TIME_INFINITE);
-#else
- chCondWait(&c1);
-#endif
- test_emit_token(*(char *)p);
- chMtxUnlock(&m1);
- chMtxUnlock(&m2);
-}
-
-static THD_FUNCTION(thread9, p) {
-
- chMtxLock(&m2);
- test_emit_token(*(char *)p);
- chMtxUnlock(&m2);
-}
+ <value><![CDATA[static MUTEX_DECL(m1);
+static MUTEX_DECL(m2);
+#if CH_CFG_USE_CONDVARS || defined(__DOXYGEN__)
+static CONDVAR_DECL(c1);
+#endif
+
+#if CH_DBG_THREADS_PROFILING || defined(__DOXYGEN__)
+/**
+ * @brief CPU pulse.
+ * @note The current implementation is not totally reliable.
+ *
+ * @param[in] duration CPU pulse duration in milliseconds
+ */
+void test_cpu_pulse(unsigned duration) {
+ systime_t start, end, now;
+
+ start = chThdGetTicksX(chThdGetSelfX());
+ end = start + TIME_MS2I(duration);
+ do {
+ now = chThdGetTicksX(chThdGetSelfX());
+#if defined(SIMULATOR)
+ _sim_check_for_interrupts();
+#endif
+ }
+ while (chVTIsTimeWithinX(now, start, end));
+}
+#endif /* CH_DBG_THREADS_PROFILING */
+
+static THD_FUNCTION(thread1, p) {
+
+ chMtxLock(&m1);
+ test_emit_token(*(char *)p);
+ chMtxUnlock(&m1);
+}
+
+#if CH_DBG_THREADS_PROFILING || defined(__DOXYGEN__)
+/* Low priority thread */
+static THD_FUNCTION(thread2L, p) {
+
+ (void)p;
+ chMtxLock(&m1);
+ test_cpu_pulse(40);
+ chMtxUnlock(&m1);
+ test_cpu_pulse(10);
+ test_emit_token('C');
+}
+
+/* Medium priority thread */
+static THD_FUNCTION(thread2M, p) {
+
+ (void)p;
+ chThdSleepMilliseconds(20);
+ test_cpu_pulse(40);
+ test_emit_token('B');
+}
+
+/* High priority thread */
+static THD_FUNCTION(thread2H, p) {
+
+ (void)p;
+ chThdSleepMilliseconds(40);
+ chMtxLock(&m1);
+ test_cpu_pulse(10);
+ chMtxUnlock(&m1);
+ test_emit_token('A');
+}
+
+/* Lowest priority thread */
+static THD_FUNCTION(thread3LL, p) {
+
+ (void)p;
+ chMtxLock(&m1);
+ test_cpu_pulse(30);
+ chMtxUnlock(&m1);
+ test_emit_token('E');
+}
+
+/* Low priority thread */
+static THD_FUNCTION(thread3L, p) {
+
+ (void)p;
+ chThdSleepMilliseconds(10);
+ chMtxLock(&m2);
+ test_cpu_pulse(20);
+ chMtxLock(&m1);
+ test_cpu_pulse(10);
+ chMtxUnlock(&m1);
+ test_cpu_pulse(10);
+ chMtxUnlock(&m2);
+ test_emit_token('D');
+}
+
+/* Medium priority thread */
+static THD_FUNCTION(thread3M, p) {
+
+ (void)p;
+ chThdSleepMilliseconds(20);
+ chMtxLock(&m2);
+ test_cpu_pulse(10);
+ chMtxUnlock(&m2);
+ test_emit_token('C');
+}
+
+/* High priority thread */
+static THD_FUNCTION(thread3H, p) {
+
+ (void)p;
+ chThdSleepMilliseconds(40);
+ test_cpu_pulse(20);
+ test_emit_token('B');
+}
+
+/* Highest priority thread */
+static THD_FUNCTION(thread3HH, p) {
+
+ (void)p;
+ chThdSleepMilliseconds(50);
+ chMtxLock(&m2);
+ test_cpu_pulse(10);
+ chMtxUnlock(&m2);
+ test_emit_token('A');
+}
+#endif /* CH_DBG_THREADS_PROFILING */
+
+static THD_FUNCTION(thread4A, p) {
+
+ (void)p;
+ chThdSleepMilliseconds(50);
+ chMtxLock(&m1);
+ chMtxUnlock(&m1);
+}
+
+static THD_FUNCTION(thread4B, p) {
+
+ (void)p;
+ chThdSleepMilliseconds(150);
+ chSysLock();
+ chMtxLockS(&m2); /* For coverage of the chMtxLockS() function variant.*/
+ chMtxUnlockS(&m2); /* For coverage of the chMtxUnlockS() function variant.*/
+ chSchRescheduleS();
+ chSysUnlock();
+}
+
+#if CH_CFG_USE_CONDVARS || defined(__DOXYGEN__)
+static THD_FUNCTION(thread6, p) {
+
+ chMtxLock(&m1);
+ chCondWait(&c1);
+ test_emit_token(*(char *)p);
+ chMtxUnlock(&m1);
+}
+
+static THD_FUNCTION(thread8, p) {
+
+ chMtxLock(&m2);
+ chMtxLock(&m1);
+#if CH_CFG_USE_CONDVARS_TIMEOUT || defined(__DOXYGEN__)
+ chCondWaitTimeout(&c1, TIME_INFINITE);
+#else
+ chCondWait(&c1);
+#endif
+ test_emit_token(*(char *)p);
+ chMtxUnlock(&m1);
+ chMtxUnlock(&m2);
+}
+
+static THD_FUNCTION(thread9, p) {
+
+ chMtxLock(&m2);
+ test_emit_token(*(char *)p);
+ chMtxUnlock(&m2);
+}
#endif /* CH_CFG_USE_CONDVARS */]]></value>
</shared_code>
<cases>
@@ -1754,10 +1757,10 @@ static THD_FUNCTION(thread9, p) {
<value />
</tags>
<code>
- <value><![CDATA[threads[0] = chThdCreateStatic(wa[0], WA_SIZE, prio+1, thread1, "E");
-threads[1] = chThdCreateStatic(wa[1], WA_SIZE, prio+2, thread1, "D");
-threads[2] = chThdCreateStatic(wa[2], WA_SIZE, prio+3, thread1, "C");
-threads[3] = chThdCreateStatic(wa[3], WA_SIZE, prio+4, thread1, "B");
+ <value><![CDATA[threads[0] = chThdCreateStatic(wa[0], WA_SIZE, prio+1, thread1, "E");
+threads[1] = chThdCreateStatic(wa[1], WA_SIZE, prio+2, thread1, "D");
+threads[2] = chThdCreateStatic(wa[2], WA_SIZE, prio+3, thread1, "C");
+threads[3] = chThdCreateStatic(wa[3], WA_SIZE, prio+4, thread1, "B");
threads[4] = chThdCreateStatic(wa[4], WA_SIZE, prio+5, thread1, "A");]]></value>
</code>
</step>
@@ -1769,9 +1772,9 @@ threads[4] = chThdCreateStatic(wa[4], WA_SIZE, prio+5, thread1, "A");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chMtxUnlock(&m1);
-test_wait_threads();
-test_assert(prio == chThdGetPriorityX(), "wrong priority level");
+ <value><![CDATA[chMtxUnlock(&m1);
+test_wait_threads();
+test_assert(prio == chThdGetPriorityX(), "wrong priority level");
test_assert_sequence("ABCDE", "invalid sequence");]]></value>
</code>
</step>
@@ -1818,10 +1821,10 @@ test_assert_sequence("ABCDE", "invalid sequence");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()-1, thread2H, 0);
-threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriorityX()-2, thread2M, 0);
-threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriorityX()-3, thread2L, 0);
-test_wait_threads();
+ <value><![CDATA[threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()-1, thread2H, 0);
+threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriorityX()-2, thread2M, 0);
+threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriorityX()-3, thread2L, 0);
+test_wait_threads();
test_assert_sequence("ABC", "invalid sequence");]]></value>
</code>
</step>
@@ -1833,7 +1836,7 @@ test_assert_sequence("ABC", "invalid sequence");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_assert_time_window(time + MS2ST(100), time + MS2ST(100) + ALLOWED_DELAY,
+ <value><![CDATA[test_assert_time_window(time + TIME_MS2I(100), time + TIME_MS2I(100) + ALLOWED_DELAY,
"out of time window");]]></value>
</code>
</step>
@@ -1851,7 +1854,7 @@ test_assert_sequence("ABC", "invalid sequence");]]></value>
</condition>
<various_code>
<setup_code>
- <value><![CDATA[chMtxObjectInit(&m1); /* Mutex B.*/
+ <value><![CDATA[chMtxObjectInit(&m1); /* Mutex B.*/
chMtxObjectInit(&m2); /* Mutex A.*/]]></value>
</setup_code>
<teardown_code>
@@ -1881,12 +1884,12 @@ chMtxObjectInit(&m2); /* Mutex A.*/]]></value>
<value />
</tags>
<code>
- <value><![CDATA[threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()-5, thread3LL, 0);
-threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriorityX()-4, thread3L, 0);
-threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriorityX()-3, thread3M, 0);
-threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriorityX()-2, thread3H, 0);
-threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriorityX()-1, thread3HH, 0);
-test_wait_threads();
+ <value><![CDATA[threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()-5, thread3LL, 0);
+threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriorityX()-4, thread3L, 0);
+threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriorityX()-3, thread3M, 0);
+threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriorityX()-2, thread3H, 0);
+threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriorityX()-1, thread3HH, 0);
+test_wait_threads();
test_assert_sequence("ABCDE", "invalid sequence");]]></value>
</code>
</step>
@@ -1898,7 +1901,7 @@ test_assert_sequence("ABCDE", "invalid sequence");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_assert_time_window(time + MS2ST(110), time + MS2ST(110) + ALLOWED_DELAY,
+ <value><![CDATA[test_assert_time_window(time + TIME_MS2I(110), time + TIME_MS2I(110) + ALLOWED_DELAY,
"out of time window");]]></value>
</code>
</step>
@@ -1917,7 +1920,7 @@ Thread A performs wait(50), lock(m1), unlock(m1), exit. Thread B performs wait(1
</condition>
<various_code>
<setup_code>
- <value><![CDATA[chMtxObjectInit(&m1);
+ <value><![CDATA[chMtxObjectInit(&m1);
chMtxObjectInit(&m2);]]></value>
</setup_code>
<teardown_code>
@@ -1936,8 +1939,8 @@ chMtxObjectInit(&m2);]]></value>
<value />
</tags>
<code>
- <value><![CDATA[p = chThdGetPriorityX();
-pa = p + 1;
+ <value><![CDATA[p = chThdGetPriorityX();
+pa = p + 1;
pb = p + 2;]]></value>
</code>
</step>
@@ -1949,7 +1952,7 @@ pb = p + 2;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[threads[0] = chThdCreateStatic(wa[0], WA_SIZE, pa, thread4A, "A");
+ <value><![CDATA[threads[0] = chThdCreateStatic(wa[0], WA_SIZE, pa, thread4A, "A");
threads[1] = chThdCreateStatic(wa[1], WA_SIZE, pb, thread4B, "B");]]></value>
</code>
</step>
@@ -1961,7 +1964,7 @@ threads[1] = chThdCreateStatic(wa[1], WA_SIZE, pb, thread4B, "B");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chMtxLock(&m1);
+ <value><![CDATA[chMtxLock(&m1);
test_assert(chThdGetPriorityX() == p, "wrong priority level");]]></value>
</code>
</step>
@@ -1973,7 +1976,7 @@ test_assert(chThdGetPriorityX() == p, "wrong priority level");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chThdSleepMilliseconds(100);
+ <value><![CDATA[chThdSleepMilliseconds(100);
test_assert(chThdGetPriorityX() == pa, "wrong priority level");]]></value>
</code>
</step>
@@ -1985,7 +1988,7 @@ test_assert(chThdGetPriorityX() == pa, "wrong priority level");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chMtxLock(&m2);
+ <value><![CDATA[chMtxLock(&m2);
test_assert(chThdGetPriorityX() == pa, "wrong priority level");]]></value>
</code>
</step>
@@ -1997,7 +2000,7 @@ test_assert(chThdGetPriorityX() == pa, "wrong priority level");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chThdSleepMilliseconds(100);
+ <value><![CDATA[chThdSleepMilliseconds(100);
test_assert(chThdGetPriorityX() == pb, "wrong priority level");]]></value>
</code>
</step>
@@ -2009,7 +2012,7 @@ test_assert(chThdGetPriorityX() == pb, "wrong priority level");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chMtxUnlock(&m2);
+ <value><![CDATA[chMtxUnlock(&m2);
test_assert(chThdGetPriorityX() == pa, "wrong priority level");]]></value>
</code>
</step>
@@ -2021,7 +2024,7 @@ test_assert(chThdGetPriorityX() == pa, "wrong priority level");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chMtxUnlock(&m1);
+ <value><![CDATA[chMtxUnlock(&m1);
test_assert(chThdGetPriorityX() == p, "wrong priority level");]]></value>
</code>
</step>
@@ -2045,7 +2048,7 @@ test_assert(chThdGetPriorityX() == p, "wrong priority level");]]></value>
<value />
</teardown_code>
<local_variables>
- <value><![CDATA[bool b;
+ <value><![CDATA[bool b;
tprio_t prio;]]></value>
</local_variables>
</various_code>
@@ -2069,7 +2072,7 @@ tprio_t prio;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[b = chMtxTryLock(&m1);
+ <value><![CDATA[b = chMtxTryLock(&m1);
test_assert(b, "already locked");]]></value>
</code>
</step>
@@ -2081,7 +2084,7 @@ test_assert(b, "already locked");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[b = chMtxTryLock(&m1);
+ <value><![CDATA[b = chMtxTryLock(&m1);
test_assert(!b, "not locked");]]></value>
</code>
</step>
@@ -2093,8 +2096,8 @@ test_assert(!b, "not locked");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chMtxUnlock(&m1);
-test_assert(m1.owner == NULL, "still owned");
+ <value><![CDATA[chMtxUnlock(&m1);
+test_assert(m1.owner == NULL, "still owned");
test_assert(queue_isempty(&m1.queue), "queue not empty");]]></value>
</code>
</step>
@@ -2117,13 +2120,13 @@ test_assert(queue_isempty(&m1.queue), "queue not empty");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[b = chMtxTryLock(&m1);
-test_assert(b, "already locked");
-b = chMtxTryLock(&m1);
-test_assert(!b, "not locked");
-
-chMtxUnlockAll();
-test_assert(m1.owner == NULL, "still owned");
+ <value><![CDATA[b = chMtxTryLock(&m1);
+test_assert(b, "already locked");
+b = chMtxTryLock(&m1);
+test_assert(!b, "not locked");
+
+chMtxUnlockAll();
+test_assert(m1.owner == NULL, "still owned");
test_assert(queue_isempty(&m1.queue), "queue not empty");]]></value>
</code>
</step>
@@ -2158,7 +2161,7 @@ test_assert(queue_isempty(&m1.queue), "queue not empty");]]></value>
<value />
</teardown_code>
<local_variables>
- <value><![CDATA[bool b;
+ <value><![CDATA[bool b;
tprio_t prio;]]></value>
</local_variables>
</various_code>
@@ -2182,7 +2185,7 @@ tprio_t prio;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[b = chMtxTryLock(&m1);
+ <value><![CDATA[b = chMtxTryLock(&m1);
test_assert(b, "already locked");]]></value>
</code>
</step>
@@ -2194,7 +2197,7 @@ test_assert(b, "already locked");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[b = chMtxTryLock(&m1);
+ <value><![CDATA[b = chMtxTryLock(&m1);
test_assert(b, "already locked");]]></value>
</code>
</step>
@@ -2206,7 +2209,7 @@ test_assert(b, "already locked");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chMtxUnlock(&m1);
+ <value><![CDATA[chMtxUnlock(&m1);
test_assert(m1.owner != NULL, "not owned");]]></value>
</code>
</step>
@@ -2218,8 +2221,8 @@ test_assert(m1.owner != NULL, "not owned");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chMtxUnlock(&m1);
-test_assert(m1.owner == NULL, "still owned");
+ <value><![CDATA[chMtxUnlock(&m1);
+test_assert(m1.owner == NULL, "still owned");
test_assert(queue_isempty(&m1.queue), "queue not empty");]]></value>
</code>
</step>
@@ -2242,18 +2245,18 @@ test_assert(queue_isempty(&m1.queue), "queue not empty");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[b = chMtxTryLock(&m1);
-test_assert(b, "already locked");
-chSysLock();
-b = chMtxTryLockS(&m1);
-chSysUnlock();
-test_assert(b, "already locked");
-test_assert(m1.cnt == 2, "invalid recursion counter");
-chSysLock();
-chMtxUnlockAllS();
-chSysUnlock();
-test_assert(m1.owner == NULL, "still owned");
-test_assert(queue_isempty(&m1.queue), "queue not empty");
+ <value><![CDATA[b = chMtxTryLock(&m1);
+test_assert(b, "already locked");
+chSysLock();
+b = chMtxTryLockS(&m1);
+chSysUnlock();
+test_assert(b, "already locked");
+test_assert(m1.cnt == 2, "invalid recursion counter");
+chSysLock();
+chMtxUnlockAllS();
+chSysUnlock();
+test_assert(m1.owner == NULL, "still owned");
+test_assert(queue_isempty(&m1.queue), "queue not empty");
test_assert(m1.cnt == 0, "invalid recursion counter");]]></value>
</code>
</step>
@@ -2265,16 +2268,16 @@ test_assert(m1.cnt == 0, "invalid recursion counter");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chMtxLock(&m1);
-test_assert(m1.owner != NULL, "not owned");
-chSysLock();
-chMtxLockS(&m1);
-chSysUnlock();
-test_assert(m1.owner != NULL, "not owned");
-test_assert(m1.cnt == 2, "invalid recursion counter");
-chMtxUnlockAll();
-test_assert(m1.owner == NULL, "still owned");
-test_assert(queue_isempty(&m1.queue), "queue not empty");
+ <value><![CDATA[chMtxLock(&m1);
+test_assert(m1.owner != NULL, "not owned");
+chSysLock();
+chMtxLockS(&m1);
+chSysUnlock();
+test_assert(m1.owner != NULL, "not owned");
+test_assert(m1.cnt == 2, "invalid recursion counter");
+chMtxUnlockAll();
+test_assert(m1.owner == NULL, "still owned");
+test_assert(queue_isempty(&m1.queue), "queue not empty");
test_assert(m1.cnt == 0, "invalid recursion counter");]]></value>
</code>
</step>
@@ -2304,7 +2307,7 @@ The test expects the threads to reach their goal in increasing priority order re
</condition>
<various_code>
<setup_code>
- <value><![CDATA[chCondObjectInit(&c1);
+ <value><![CDATA[chCondObjectInit(&c1);
chMtxObjectInit(&m1);]]></value>
</setup_code>
<teardown_code>
@@ -2323,11 +2326,11 @@ chMtxObjectInit(&m1);]]></value>
<value />
</tags>
<code>
- <value><![CDATA[tprio_t prio = chThdGetPriorityX();
-threads[0] = chThdCreateStatic(wa[0], WA_SIZE, prio+1, thread6, "E");
-threads[1] = chThdCreateStatic(wa[1], WA_SIZE, prio+2, thread6, "D");
-threads[2] = chThdCreateStatic(wa[2], WA_SIZE, prio+3, thread6, "C");
-threads[3] = chThdCreateStatic(wa[3], WA_SIZE, prio+4, thread6, "B");
+ <value><![CDATA[tprio_t prio = chThdGetPriorityX();
+threads[0] = chThdCreateStatic(wa[0], WA_SIZE, prio+1, thread6, "E");
+threads[1] = chThdCreateStatic(wa[1], WA_SIZE, prio+2, thread6, "D");
+threads[2] = chThdCreateStatic(wa[2], WA_SIZE, prio+3, thread6, "C");
+threads[3] = chThdCreateStatic(wa[3], WA_SIZE, prio+4, thread6, "B");
threads[4] = chThdCreateStatic(wa[4], WA_SIZE, prio+5, thread6, "A");]]></value>
</code>
</step>
@@ -2339,15 +2342,15 @@ threads[4] = chThdCreateStatic(wa[4], WA_SIZE, prio+5, thread6, "A");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chSysLock();
-chCondSignalI(&c1);
-chCondSignalI(&c1);
-chCondSignalI(&c1);
-chCondSignalI(&c1);
-chCondSignalI(&c1);
-chSchRescheduleS();
-chSysUnlock();
-test_wait_threads();
+ <value><![CDATA[chSysLock();
+chCondSignalI(&c1);
+chCondSignalI(&c1);
+chCondSignalI(&c1);
+chCondSignalI(&c1);
+chCondSignalI(&c1);
+chSchRescheduleS();
+chSysUnlock();
+test_wait_threads();
test_assert_sequence("ABCDE", "invalid sequence");]]></value>
</code>
</step>
@@ -2366,7 +2369,7 @@ The test expects the threads to reach their goal in increasing priority order re
</condition>
<various_code>
<setup_code>
- <value><![CDATA[chCondObjectInit(&c1);
+ <value><![CDATA[chCondObjectInit(&c1);
chMtxObjectInit(&m1);]]></value>
</setup_code>
<teardown_code>
@@ -2385,11 +2388,11 @@ chMtxObjectInit(&m1);]]></value>
<value />
</tags>
<code>
- <value><![CDATA[tprio_t prio = chThdGetPriorityX();
-threads[0] = chThdCreateStatic(wa[0], WA_SIZE, prio+1, thread6, "E");
-threads[1] = chThdCreateStatic(wa[1], WA_SIZE, prio+2, thread6, "D");
-threads[2] = chThdCreateStatic(wa[2], WA_SIZE, prio+3, thread6, "C");
-threads[3] = chThdCreateStatic(wa[3], WA_SIZE, prio+4, thread6, "B");
+ <value><![CDATA[tprio_t prio = chThdGetPriorityX();
+threads[0] = chThdCreateStatic(wa[0], WA_SIZE, prio+1, thread6, "E");
+threads[1] = chThdCreateStatic(wa[1], WA_SIZE, prio+2, thread6, "D");
+threads[2] = chThdCreateStatic(wa[2], WA_SIZE, prio+3, thread6, "C");
+threads[3] = chThdCreateStatic(wa[3], WA_SIZE, prio+4, thread6, "B");
threads[4] = chThdCreateStatic(wa[4], WA_SIZE, prio+5, thread6, "A");]]></value>
</code>
</step>
@@ -2401,8 +2404,8 @@ threads[4] = chThdCreateStatic(wa[4], WA_SIZE, prio+5, thread6, "A");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chCondBroadcast(&c1);
-test_wait_threads();
+ <value><![CDATA[chCondBroadcast(&c1);
+test_wait_threads();
test_assert_sequence("ABCDE", "invalid sequence");]]></value>
</code>
</step>
@@ -2420,8 +2423,8 @@ test_assert_sequence("ABCDE", "invalid sequence");]]></value>
</condition>
<various_code>
<setup_code>
- <value><![CDATA[chCondObjectInit(&c1);
-chMtxObjectInit(&m1);
+ <value><![CDATA[chCondObjectInit(&c1);
+chMtxObjectInit(&m1);
chMtxObjectInit(&m2);]]></value>
</setup_code>
<teardown_code>
@@ -2506,7 +2509,7 @@ chMtxObjectInit(&m2);]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_wait_threads();
+ <value><![CDATA[test_wait_threads();
test_assert_sequence("ABC", "invalid sequence");]]></value>
</code>
</step>
@@ -2528,12 +2531,12 @@ test_assert_sequence("ABC", "invalid sequence");]]></value>
<value>CH_CFG_USE_MESSAGES</value>
</condition>
<shared_code>
- <value><![CDATA[static THD_FUNCTION(msg_thread1, p) {
-
- chMsgSend(p, 'A');
- chMsgSend(p, 'B');
- chMsgSend(p, 'C');
- chMsgSend(p, 'D');
+ <value><![CDATA[static THD_FUNCTION(msg_thread1, p) {
+
+ chMsgSend(p, 'A');
+ chMsgSend(p, 'B');
+ chMsgSend(p, 'C');
+ chMsgSend(p, 'D');
}]]></value>
</shared_code>
<cases>
@@ -2556,7 +2559,7 @@ The test expect to receive the messages in the correct sequence and to not find
<value />
</teardown_code>
<local_variables>
- <value><![CDATA[thread_t *tp;
+ <value><![CDATA[thread_t *tp;
msg_t msg;]]></value>
</local_variables>
</various_code>
@@ -2569,7 +2572,7 @@ msg_t msg;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() + 1,
+ <value><![CDATA[threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() + 1,
msg_thread1, chThdGetSelfX());]]></value>
</code>
</step>
@@ -2581,15 +2584,15 @@ msg_t msg;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[unsigned i;
-
-for (i = 0; i < 4; i++) {
- tp = chMsgWait();
- msg = chMsgGet(tp);
- chMsgRelease(tp, msg);
- test_emit_token(msg);
-}
-test_wait_threads();
+ <value><![CDATA[unsigned i;
+
+for (i = 0; i < 4; i++) {
+ tp = chMsgWait();
+ msg = chMsgGet(tp);
+ chMsgRelease(tp, msg);
+ test_emit_token(msg);
+}
+test_wait_threads();
test_assert_sequence("ABCD", "invalid sequence");]]></value>
</code>
</step>
@@ -2611,26 +2614,26 @@ test_assert_sequence("ABCD", "invalid sequence");]]></value>
<value>CH_CFG_USE_EVENTS</value>
</condition>
<shared_code>
- <value><![CDATA[static EVENTSOURCE_DECL(es1);
-static EVENTSOURCE_DECL(es2);
-
-static void h1(eventid_t id) {(void)id;test_emit_token('A');}
-static void h2(eventid_t id) {(void)id;test_emit_token('B');}
-static void h3(eventid_t id) {(void)id;test_emit_token('C');}
-static ROMCONST evhandler_t evhndl[] = {h1, h2, h3};
-
-static THD_FUNCTION(evt_thread3, p) {
-
- chThdSleepMilliseconds(50);
- chEvtSignal((thread_t *)p, 1);
-}
-
-static THD_FUNCTION(evt_thread7, p) {
-
- (void)p;
- chEvtBroadcast(&es1);
- chThdSleepMilliseconds(50);
- chEvtBroadcast(&es2);
+ <value><![CDATA[static EVENTSOURCE_DECL(es1);
+static EVENTSOURCE_DECL(es2);
+
+static void h1(eventid_t id) {(void)id;test_emit_token('A');}
+static void h2(eventid_t id) {(void)id;test_emit_token('B');}
+static void h3(eventid_t id) {(void)id;test_emit_token('C');}
+static ROMCONST evhandler_t evhndl[] = {h1, h2, h3};
+
+static THD_FUNCTION(evt_thread3, p) {
+
+ chThdSleepMilliseconds(50);
+ chEvtSignal((thread_t *)p, 1);
+}
+
+static THD_FUNCTION(evt_thread7, p) {
+
+ (void)p;
+ chEvtBroadcast(&es1);
+ chThdSleepMilliseconds(50);
+ chEvtBroadcast(&es2);
}]]></value>
</shared_code>
<cases>
@@ -2676,8 +2679,8 @@ The test expects that the even source has listeners after the registrations and
<value />
</tags>
<code>
- <value><![CDATA[chEvtRegisterMask(&es1, &el1, 1);
-chEvtRegisterMask(&es1, &el2, 2);
+ <value><![CDATA[chEvtRegisterMask(&es1, &el1, 1);
+chEvtRegisterMask(&es1, &el2, 2);
test_assert_lock(chEvtIsListeningI(&es1), "no listener");]]></value>
</code>
</step>
@@ -2689,7 +2692,7 @@ test_assert_lock(chEvtIsListeningI(&es1), "no listener");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chEvtUnregister(&es1, &el1);
+ <value><![CDATA[chEvtUnregister(&es1, &el1);
test_assert_lock(chEvtIsListeningI(&es1), "no listener");]]></value>
</code>
</step>
@@ -2701,7 +2704,7 @@ test_assert_lock(chEvtIsListeningI(&es1), "no listener");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chEvtUnregister(&es1, &el2);
+ <value><![CDATA[chEvtUnregister(&es1, &el2);
test_assert_lock(!chEvtIsListeningI(&es1), "stuck listener");]]></value>
</code>
</step>
@@ -2737,7 +2740,7 @@ test_assert_lock(!chEvtIsListeningI(&es1), "stuck listener");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chEvtDispatch(evhndl, 7);
+ <value><![CDATA[chEvtDispatch(evhndl, 7);
test_assert_sequence("ABC", "invalid sequence");]]></value>
</code>
</step>
@@ -2761,7 +2764,7 @@ test_assert_sequence("ABC", "invalid sequence");]]></value>
<value />
</teardown_code>
<local_variables>
- <value><![CDATA[eventmask_t m;
+ <value><![CDATA[eventmask_t m;
systime_t target_time;]]></value>
</local_variables>
</various_code>
@@ -2785,13 +2788,13 @@ systime_t target_time;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[m = chEvtWaitOne(ALL_EVENTS);
-test_assert(m == 1, "single event error");
-m = chEvtWaitOne(ALL_EVENTS);
-test_assert(m == 2, "single event error");
-m = chEvtWaitOne(ALL_EVENTS);
-test_assert(m == 4, "single event error");
-m = chEvtGetAndClearEvents(ALL_EVENTS);
+ <value><![CDATA[m = chEvtWaitOne(ALL_EVENTS);
+test_assert(m == 1, "single event error");
+m = chEvtWaitOne(ALL_EVENTS);
+test_assert(m == 2, "single event error");
+m = chEvtWaitOne(ALL_EVENTS);
+test_assert(m == 4, "single event error");
+m = chEvtGetAndClearEvents(ALL_EVENTS);
test_assert(m == 0, "stuck event");]]></value>
</code>
</step>
@@ -2803,8 +2806,8 @@ test_assert(m == 0, "stuck event");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[target_time = test_wait_tick() + MS2ST(50);
-threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() - 1,
+ <value><![CDATA[target_time = test_wait_tick() + TIME_MS2I(50);
+threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() - 1,
evt_thread3, chThdGetSelfX());]]></value>
</code>
</step>
@@ -2816,12 +2819,12 @@ threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() - 1,
<value />
</tags>
<code>
- <value><![CDATA[m = chEvtWaitOne(ALL_EVENTS);
-test_assert_time_window(target_time, target_time + ALLOWED_DELAY,
- "out of time window");
-test_assert(m == 1, "event flag error");
-m = chEvtGetAndClearEvents(ALL_EVENTS);
-test_assert(m == 0, "stuck event");
+ <value><![CDATA[m = chEvtWaitOne(ALL_EVENTS);
+test_assert_time_window(target_time, target_time + ALLOWED_DELAY,
+ "out of time window");
+test_assert(m == 1, "event flag error");
+m = chEvtGetAndClearEvents(ALL_EVENTS);
+test_assert(m == 0, "stuck event");
test_wait_threads();]]></value>
</code>
</step>
@@ -2845,7 +2848,7 @@ test_wait_threads();]]></value>
<value />
</teardown_code>
<local_variables>
- <value><![CDATA[eventmask_t m;
+ <value><![CDATA[eventmask_t m;
systime_t target_time;]]></value>
</local_variables>
</various_code>
@@ -2869,9 +2872,9 @@ systime_t target_time;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[m = chEvtWaitAny(ALL_EVENTS);
-test_assert(m == 5, "unexpected pending bit");
-m = chEvtGetAndClearEvents(ALL_EVENTS);
+ <value><![CDATA[m = chEvtWaitAny(ALL_EVENTS);
+test_assert(m == 5, "unexpected pending bit");
+m = chEvtGetAndClearEvents(ALL_EVENTS);
test_assert(m == 0, "stuck event");]]></value>
</code>
</step>
@@ -2883,8 +2886,8 @@ test_assert(m == 0, "stuck event");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[target_time = test_wait_tick() + MS2ST(50);
-threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() - 1,
+ <value><![CDATA[target_time = test_wait_tick() + TIME_MS2I(50);
+threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() - 1,
evt_thread3, chThdGetSelfX());]]></value>
</code>
</step>
@@ -2896,12 +2899,12 @@ threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() - 1,
<value />
</tags>
<code>
- <value><![CDATA[m = chEvtWaitAny(ALL_EVENTS);
-test_assert_time_window(target_time, target_time + ALLOWED_DELAY,
- "out of time window");
-test_assert(m == 1, "event flag error");
-m = chEvtGetAndClearEvents(ALL_EVENTS);
-test_assert(m == 0, "stuck event");
+ <value><![CDATA[m = chEvtWaitAny(ALL_EVENTS);
+test_assert_time_window(target_time, target_time + ALLOWED_DELAY,
+ "out of time window");
+test_assert(m == 1, "event flag error");
+m = chEvtGetAndClearEvents(ALL_EVENTS);
+test_assert(m == 0, "stuck event");
test_wait_threads();]]></value>
</code>
</step>
@@ -2925,7 +2928,7 @@ test_wait_threads();]]></value>
<value />
</teardown_code>
<local_variables>
- <value><![CDATA[eventmask_t m;
+ <value><![CDATA[eventmask_t m;
systime_t target_time;]]></value>
</local_variables>
</various_code>
@@ -2949,9 +2952,9 @@ systime_t target_time;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[m = chEvtWaitAll(5);
-test_assert(m == 5, "unexpected pending bit");
-m = chEvtGetAndClearEvents(ALL_EVENTS);
+ <value><![CDATA[m = chEvtWaitAll(5);
+test_assert(m == 5, "unexpected pending bit");
+m = chEvtGetAndClearEvents(ALL_EVENTS);
test_assert(m == 0, "stuck event");]]></value>
</code>
</step>
@@ -2974,8 +2977,8 @@ test_assert(m == 0, "stuck event");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[target_time = test_wait_tick() + MS2ST(50);
-threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() - 1,
+ <value><![CDATA[target_time = test_wait_tick() + TIME_MS2I(50);
+threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() - 1,
evt_thread3, chThdGetSelfX());]]></value>
</code>
</step>
@@ -2987,12 +2990,12 @@ threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() - 1,
<value />
</tags>
<code>
- <value><![CDATA[m = chEvtWaitAll(5);
-test_assert_time_window(target_time, target_time + ALLOWED_DELAY,
- "out of time window");
-test_assert(m == 5, "event flags error");
-m = chEvtGetAndClearEvents(ALL_EVENTS);
-test_assert(m == 0, "stuck event");
+ <value><![CDATA[m = chEvtWaitAll(5);
+test_assert_time_window(target_time, target_time + ALLOWED_DELAY,
+ "out of time window");
+test_assert(m == 5, "event flags error");
+m = chEvtGetAndClearEvents(ALL_EVENTS);
+test_assert(m == 0, "stuck event");
test_wait_threads();]]></value>
</code>
</step>
@@ -3028,11 +3031,11 @@ test_wait_threads();]]></value>
<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);
+ <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>
@@ -3044,11 +3047,11 @@ test_assert(m == 0, "spurious event");]]></value>
<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));
+ <value><![CDATA[m = chEvtWaitOneTimeout(ALL_EVENTS, TIME_MS2I(50));
+test_assert(m == 0, "spurious event");
+m = chEvtWaitAnyTimeout(ALL_EVENTS, TIME_MS2I(50));
+test_assert(m == 0, "spurious event");
+m = chEvtWaitAllTimeout(ALL_EVENTS, TIME_MS2I(50));
test_assert(m == 0, "spurious event");]]></value>
</code>
</step>
@@ -3066,16 +3069,16 @@ test_assert(m == 0, "spurious event");]]></value>
</condition>
<various_code>
<setup_code>
- <value><![CDATA[chEvtGetAndClearEvents(ALL_EVENTS);
-chEvtObjectInit(&es1);
+ <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;
+ <value><![CDATA[eventmask_t m;
+event_listener_t el1, el2;
systime_t target_time;]]></value>
</local_variables>
</various_code>
@@ -3088,7 +3091,7 @@ systime_t target_time;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chEvtRegisterMask(&es1, &el1, 1);
+ <value><![CDATA[chEvtRegisterMask(&es1, &el1, 1);
chEvtRegisterMask(&es2, &el2, 4);]]></value>
</code>
</step>
@@ -3100,8 +3103,8 @@ chEvtRegisterMask(&es2, &el2, 4);]]></value>
<value />
</tags>
<code>
- <value><![CDATA[target_time = test_wait_tick() + MS2ST(50);
-threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() - 1,
+ <value><![CDATA[target_time = test_wait_tick() + TIME_MS2I(50);
+threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() - 1,
evt_thread7, "A");]]></value>
</code>
</step>
@@ -3113,11 +3116,11 @@ threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() - 1,
<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");
+ <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>
@@ -3129,9 +3132,9 @@ test_wait_threads();]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chEvtUnregister(&es1, &el1);
-chEvtUnregister(&es2, &el2);
-test_assert(!chEvtIsListeningI(&es1), "stuck listener");
+ <value><![CDATA[chEvtUnregister(&es1, &el1);
+chEvtUnregister(&es2, &el2);
+test_assert(!chEvtIsListeningI(&es1), "stuck listener");
test_assert(!chEvtIsListeningI(&es2), "stuck listener");]]></value>
</code>
</step>
@@ -3153,9 +3156,9 @@ test_assert(!chEvtIsListeningI(&es2), "stuck listener");]]></value>
<value>CH_CFG_USE_MAILBOXES</value>
</condition>
<shared_code>
- <value><![CDATA[#define MB_SIZE 4
-
-static msg_t mb_buffer[MB_SIZE];
+ <value><![CDATA[#define MB_SIZE 4
+
+static msg_t mb_buffer[MB_SIZE];
static MAILBOX_DECL(mb1, mb_buffer, MB_SIZE);]]></value>
</shared_code>
<cases>
@@ -3177,7 +3180,7 @@ static MAILBOX_DECL(mb1, mb_buffer, MB_SIZE);]]></value>
<value><![CDATA[chMBReset(&mb1);]]></value>
</teardown_code>
<local_variables>
- <value><![CDATA[msg_t msg1, msg2;
+ <value><![CDATA[msg_t msg1, msg2;
unsigned i;]]></value>
</local_variables>
</various_code>
@@ -3201,10 +3204,10 @@ unsigned i;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chMBReset(&mb1);
-test_assert_lock(chMBGetFreeCountI(&mb1) == MB_SIZE, "not empty");
-test_assert_lock(chMBGetUsedCountI(&mb1) == 0, "still full");
-test_assert_lock(mb1.buffer == mb1.wrptr, "write pointer not aligned to base");
+ <value><![CDATA[chMBReset(&mb1);
+test_assert_lock(chMBGetFreeCountI(&mb1) == MB_SIZE, "not empty");
+test_assert_lock(chMBGetUsedCountI(&mb1) == 0, "still full");
+test_assert_lock(mb1.buffer == mb1.wrptr, "write pointer not aligned to base");
test_assert_lock(mb1.buffer == mb1.rdptr, "read pointer not aligned to base");]]></value>
</code>
</step>
@@ -3216,12 +3219,12 @@ test_assert_lock(mb1.buffer == mb1.rdptr, "read pointer not aligned to base");]]
<value />
</tags>
<code>
- <value><![CDATA[msg1 = chMBPostTimeout(&mb1, (msg_t)0, TIME_INFINITE);
-test_assert(msg1 == MSG_RESET, "not in reset state");
-msg1 = chMBPostAheadTimeout(&mb1, (msg_t)0, TIME_INFINITE);
-test_assert(msg1 == MSG_RESET, "not in reset state");
-msg1 = chMBFetchTimeout(&mb1, &msg2, TIME_INFINITE);
-test_assert(msg1 == MSG_RESET, "not in reset state");
+ <value><![CDATA[msg1 = chMBPostTimeout(&mb1, (msg_t)0, TIME_INFINITE);
+test_assert(msg1 == MSG_RESET, "not in reset state");
+msg1 = chMBPostAheadTimeout(&mb1, (msg_t)0, TIME_INFINITE);
+test_assert(msg1 == MSG_RESET, "not in reset state");
+msg1 = chMBFetchTimeout(&mb1, &msg2, TIME_INFINITE);
+test_assert(msg1 == MSG_RESET, "not in reset state");
chMBResumeX(&mb1);]]></value>
</code>
</step>
@@ -3233,11 +3236,11 @@ chMBResumeX(&mb1);]]></value>
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < MB_SIZE - 1; i++) {
- msg1 = chMBPostTimeout(&mb1, 'B' + i, TIME_INFINITE);
- test_assert(msg1 == MSG_OK, "wrong wake-up message");
-}
-msg1 = chMBPostAheadTimeout(&mb1, 'A', TIME_INFINITE);
+ <value><![CDATA[for (i = 0; i < MB_SIZE - 1; i++) {
+ msg1 = chMBPostTimeout(&mb1, 'B' + i, TIME_INFINITE);
+ test_assert(msg1 == MSG_OK, "wrong wake-up message");
+}
+msg1 = chMBPostAheadTimeout(&mb1, 'A', TIME_INFINITE);
test_assert(msg1 == MSG_OK, "wrong wake-up message");]]></value>
</code>
</step>
@@ -3249,8 +3252,8 @@ test_assert(msg1 == MSG_OK, "wrong wake-up message");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_assert_lock(chMBGetFreeCountI(&mb1) == 0, "still empty");
-test_assert_lock(chMBGetUsedCountI(&mb1) == MB_SIZE, "not full");
+ <value><![CDATA[test_assert_lock(chMBGetFreeCountI(&mb1) == 0, "still empty");
+test_assert_lock(chMBGetUsedCountI(&mb1) == MB_SIZE, "not full");
test_assert_lock(mb1.rdptr == mb1.wrptr, "pointers not aligned");]]></value>
</code>
</step>
@@ -3262,11 +3265,11 @@ test_assert_lock(mb1.rdptr == mb1.wrptr, "pointers not aligned");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < MB_SIZE; i++) {
- msg1 = chMBFetchTimeout(&mb1, &msg2, TIME_INFINITE);
- test_assert(msg1 == MSG_OK, "wrong wake-up message");
- test_emit_token(msg2);
-}
+ <value><![CDATA[for (i = 0; i < MB_SIZE; i++) {
+ msg1 = chMBFetchTimeout(&mb1, &msg2, TIME_INFINITE);
+ test_assert(msg1 == MSG_OK, "wrong wake-up message");
+ test_emit_token(msg2);
+}
test_assert_sequence("ABCD", "wrong get sequence");]]></value>
</code>
</step>
@@ -3278,9 +3281,9 @@ test_assert_sequence("ABCD", "wrong get sequence");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[msg1 = chMBPostTimeout(&mb1, 'B' + i, TIME_INFINITE);
-test_assert(msg1 == MSG_OK, "wrong wake-up message");
-msg1 = chMBFetchTimeout(&mb1, &msg2, TIME_INFINITE);
+ <value><![CDATA[msg1 = chMBPostTimeout(&mb1, 'B' + i, TIME_INFINITE);
+test_assert(msg1 == MSG_OK, "wrong wake-up message");
+msg1 = chMBFetchTimeout(&mb1, &msg2, TIME_INFINITE);
test_assert(msg1 == MSG_OK, "wrong wake-up message");]]></value>
</code>
</step>
@@ -3292,9 +3295,9 @@ test_assert(msg1 == MSG_OK, "wrong wake-up message");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_assert_lock(chMBGetFreeCountI(&mb1) == MB_SIZE, "not empty");
-test_assert_lock(chMBGetUsedCountI(&mb1) == 0, "still full");
-test_assert(mb1.buffer == mb1.wrptr, "write pointer not aligned to base");
+ <value><![CDATA[test_assert_lock(chMBGetFreeCountI(&mb1) == MB_SIZE, "not empty");
+test_assert_lock(chMBGetUsedCountI(&mb1) == 0, "still full");
+test_assert(mb1.buffer == mb1.wrptr, "write pointer not aligned to base");
test_assert(mb1.buffer == mb1.rdptr, "read pointer not aligned to base");]]></value>
</code>
</step>
@@ -3318,7 +3321,7 @@ test_assert(mb1.buffer == mb1.rdptr, "read pointer not aligned to base");]]></va
<value><![CDATA[chMBReset(&mb1);]]></value>
</teardown_code>
<local_variables>
- <value><![CDATA[msg_t msg1, msg2;
+ <value><![CDATA[msg_t msg1, msg2;
unsigned i;]]></value>
</local_variables>
</various_code>
@@ -3342,13 +3345,13 @@ unsigned i;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chSysLock();
-chMBResetI(&mb1);
-chSysUnlock();
-test_assert_lock(chMBGetFreeCountI(&mb1) == MB_SIZE, "not empty");
-test_assert_lock(chMBGetUsedCountI(&mb1) == 0, "still full");
-test_assert_lock(mb1.buffer == mb1.wrptr, "write pointer not aligned to base");
-test_assert_lock(mb1.buffer == mb1.rdptr, "read pointer not aligned to base");
+ <value><![CDATA[chSysLock();
+chMBResetI(&mb1);
+chSysUnlock();
+test_assert_lock(chMBGetFreeCountI(&mb1) == MB_SIZE, "not empty");
+test_assert_lock(chMBGetUsedCountI(&mb1) == 0, "still full");
+test_assert_lock(mb1.buffer == mb1.wrptr, "write pointer not aligned to base");
+test_assert_lock(mb1.buffer == mb1.rdptr, "read pointer not aligned to base");
chMBResumeX(&mb1);]]></value>
</code>
</step>
@@ -3360,15 +3363,15 @@ chMBResumeX(&mb1);]]></value>
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < MB_SIZE - 1; i++) {
- chSysLock();
- msg1 = chMBPostI(&mb1, 'B' + i);
- chSysUnlock();
- test_assert(msg1 == MSG_OK, "wrong wake-up message");
-}
-chSysLock();
-msg1 = chMBPostAheadI(&mb1, 'A');
-chSysUnlock();
+ <value><![CDATA[for (i = 0; i < MB_SIZE - 1; i++) {
+ chSysLock();
+ msg1 = chMBPostI(&mb1, 'B' + i);
+ chSysUnlock();
+ test_assert(msg1 == MSG_OK, "wrong wake-up message");
+}
+chSysLock();
+msg1 = chMBPostAheadI(&mb1, 'A');
+chSysUnlock();
test_assert(msg1 == MSG_OK, "wrong wake-up message");]]></value>
</code>
</step>
@@ -3380,8 +3383,8 @@ test_assert(msg1 == MSG_OK, "wrong wake-up message");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_assert_lock(chMBGetFreeCountI(&mb1) == 0, "still empty");
-test_assert_lock(chMBGetUsedCountI(&mb1) == MB_SIZE, "not full");
+ <value><![CDATA[test_assert_lock(chMBGetFreeCountI(&mb1) == 0, "still empty");
+test_assert_lock(chMBGetUsedCountI(&mb1) == MB_SIZE, "not full");
test_assert_lock(mb1.rdptr == mb1.wrptr, "pointers not aligned");]]></value>
</code>
</step>
@@ -3393,13 +3396,13 @@ test_assert_lock(mb1.rdptr == mb1.wrptr, "pointers not aligned");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < MB_SIZE; i++) {
- chSysLock();
- msg1 = chMBFetchI(&mb1, &msg2);
- chSysUnlock();
- test_assert(msg1 == MSG_OK, "wrong wake-up message");
- test_emit_token(msg2);
-}
+ <value><![CDATA[for (i = 0; i < MB_SIZE; i++) {
+ chSysLock();
+ msg1 = chMBFetchI(&mb1, &msg2);
+ chSysUnlock();
+ test_assert(msg1 == MSG_OK, "wrong wake-up message");
+ test_emit_token(msg2);
+}
test_assert_sequence("ABCD", "wrong get sequence");]]></value>
</code>
</step>
@@ -3411,9 +3414,9 @@ test_assert_sequence("ABCD", "wrong get sequence");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[msg1 = chMBPostTimeout(&mb1, 'B' + i, TIME_INFINITE);
-test_assert(msg1 == MSG_OK, "wrong wake-up message");
-msg1 = chMBFetchTimeout(&mb1, &msg2, TIME_INFINITE);
+ <value><![CDATA[msg1 = chMBPostTimeout(&mb1, 'B' + i, TIME_INFINITE);
+test_assert(msg1 == MSG_OK, "wrong wake-up message");
+msg1 = chMBFetchTimeout(&mb1, &msg2, TIME_INFINITE);
test_assert(msg1 == MSG_OK, "wrong wake-up message");]]></value>
</code>
</step>
@@ -3425,9 +3428,9 @@ test_assert(msg1 == MSG_OK, "wrong wake-up message");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_assert_lock(chMBGetFreeCountI(&mb1) == MB_SIZE, "not empty");
-test_assert_lock(chMBGetUsedCountI(&mb1) == 0, "still full");
-test_assert(mb1.buffer == mb1.wrptr, "write pointer not aligned to base");
+ <value><![CDATA[test_assert_lock(chMBGetFreeCountI(&mb1) == MB_SIZE, "not empty");
+test_assert_lock(chMBGetUsedCountI(&mb1) == 0, "still full");
+test_assert(mb1.buffer == mb1.wrptr, "write pointer not aligned to base");
test_assert(mb1.buffer == mb1.rdptr, "read pointer not aligned to base");]]></value>
</code>
</step>
@@ -3451,7 +3454,7 @@ test_assert(mb1.buffer == mb1.rdptr, "read pointer not aligned to base");]]></va
<value><![CDATA[chMBReset(&mb1);]]></value>
</teardown_code>
<local_variables>
- <value><![CDATA[msg_t msg1, msg2;
+ <value><![CDATA[msg_t msg1, msg2;
unsigned i;]]></value>
</local_variables>
</various_code>
@@ -3464,9 +3467,9 @@ unsigned i;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < MB_SIZE; i++) {
- msg1 = chMBPostTimeout(&mb1, 'B' + i, TIME_INFINITE);
- test_assert(msg1 == MSG_OK, "wrong wake-up message");
+ <value><![CDATA[for (i = 0; i < MB_SIZE; i++) {
+ msg1 = chMBPostTimeout(&mb1, 'B' + i, TIME_INFINITE);
+ test_assert(msg1 == MSG_OK, "wrong wake-up message");
}]]></value>
</code>
</step>
@@ -3478,17 +3481,17 @@ unsigned i;]]></value>
<value />
</tags>
<code>
- <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 = chMBPostAheadTimeout(&mb1, 'X', 1);
-test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");
-chSysLock();
-msg1 = chMBPostAheadI(&mb1, 'X');
-chSysUnlock();
+ <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 = chMBPostAheadTimeout(&mb1, 'X', 1);
+test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");
+chSysLock();
+msg1 = chMBPostAheadI(&mb1, 'X');
+chSysUnlock();
test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");]]></value>
</code>
</step>
@@ -3500,7 +3503,7 @@ test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[chMBReset(&mb1);
+ <value><![CDATA[chMBReset(&mb1);
chMBResumeX(&mb1);]]></value>
</code>
</step>
@@ -3512,11 +3515,11 @@ chMBResumeX(&mb1);]]></value>
<value />
</tags>
<code>
- <value><![CDATA[msg1 = chMBFetchTimeout(&mb1, &msg2, 1);
-test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");
-chSysLock();
-msg1 = chMBFetchI(&mb1, &msg2);
-chSysUnlock();
+ <value><![CDATA[msg1 = chMBFetchTimeout(&mb1, &msg2, 1);
+test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");
+chSysLock();
+msg1 = chMBFetchI(&mb1, &msg2);
+chSysUnlock();
test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");]]></value>
</code>
</step>
@@ -3538,21 +3541,21 @@ test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");]]></value>
<value>CH_CFG_USE_MEMPOOLS</value>
</condition>
<shared_code>
- <value><![CDATA[#define MEMORY_POOL_SIZE 4
-
-static uint32_t objects[MEMORY_POOL_SIZE];
-static MEMORYPOOL_DECL(mp1, sizeof (uint32_t), PORT_NATURAL_ALIGN, NULL);
-
-#if CH_CFG_USE_SEMAPHORES
-static GUARDEDMEMORYPOOL_DECL(gmp1, sizeof (uint32_t), PORT_NATURAL_ALIGN);
-#endif
-
-static void *null_provider(size_t size, unsigned align) {
-
- (void)size;
- (void)align;
-
- return NULL;
+ <value><![CDATA[#define MEMORY_POOL_SIZE 4
+
+static uint32_t objects[MEMORY_POOL_SIZE];
+static MEMORYPOOL_DECL(mp1, sizeof (uint32_t), PORT_NATURAL_ALIGN, NULL);
+
+#if CH_CFG_USE_SEMAPHORES
+static GUARDEDMEMORYPOOL_DECL(gmp1, sizeof (uint32_t), PORT_NATURAL_ALIGN);
+#endif
+
+static void *null_provider(size_t size, unsigned align) {
+
+ (void)size;
+ (void)align;
+
+ return NULL;
}]]></value>
</shared_code>
<cases>
@@ -3597,7 +3600,7 @@ static void *null_provider(size_t size, unsigned align) {
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < MEMORY_POOL_SIZE; i++)
+ <value><![CDATA[for (i = 0; i < MEMORY_POOL_SIZE; i++)
test_assert(chPoolAlloc(&mp1) != NULL, "list empty");]]></value>
</code>
</step>
@@ -3620,7 +3623,7 @@ static void *null_provider(size_t size, unsigned align) {
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < MEMORY_POOL_SIZE; i++)
+ <value><![CDATA[for (i = 0; i < MEMORY_POOL_SIZE; i++)
chPoolFree(&mp1, &objects[i]);]]></value>
</code>
</step>
@@ -3632,7 +3635,7 @@ static void *null_provider(size_t size, unsigned align) {
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < MEMORY_POOL_SIZE; i++)
+ <value><![CDATA[for (i = 0; i < MEMORY_POOL_SIZE; i++)
test_assert(chPoolAlloc(&mp1) != NULL, "list empty");]]></value>
</code>
</step>
@@ -3655,7 +3658,7 @@ static void *null_provider(size_t size, unsigned align) {
<value />
</tags>
<code>
- <value><![CDATA[chPoolObjectInit(&mp1, sizeof (uint32_t), null_provider);
+ <value><![CDATA[chPoolObjectInit(&mp1, sizeof (uint32_t), null_provider);
test_assert(chPoolAlloc(&mp1) == NULL, "provider returned memory");]]></value>
</code>
</step>
@@ -3702,7 +3705,7 @@ test_assert(chPoolAlloc(&mp1) == NULL, "provider returned memory");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < MEMORY_POOL_SIZE; i++)
+ <value><![CDATA[for (i = 0; i < MEMORY_POOL_SIZE; i++)
test_assert(chGuardedPoolAllocTimeout(&gmp1, TIME_IMMEDIATE) != NULL, "list empty");]]></value>
</code>
</step>
@@ -3725,7 +3728,7 @@ test_assert(chPoolAlloc(&mp1) == NULL, "provider returned memory");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < MEMORY_POOL_SIZE; i++)
+ <value><![CDATA[for (i = 0; i < MEMORY_POOL_SIZE; i++)
chGuardedPoolFree(&gmp1, &objects[i]);]]></value>
</code>
</step>
@@ -3737,7 +3740,7 @@ test_assert(chPoolAlloc(&mp1) == NULL, "provider returned memory");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < MEMORY_POOL_SIZE; i++)
+ <value><![CDATA[for (i = 0; i < MEMORY_POOL_SIZE; i++)
test_assert(chGuardedPoolAllocTimeout(&gmp1, TIME_IMMEDIATE) != NULL, "list empty");]]></value>
</code>
</step>
@@ -3784,7 +3787,7 @@ test_assert(chPoolAlloc(&mp1) == NULL, "provider returned memory");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_assert(chGuardedPoolAllocTimeout(&gmp1, MS2ST(100)) == NULL, "list not empty");]]></value>
+ <value><![CDATA[test_assert(chGuardedPoolAllocTimeout(&gmp1, TIME_MS2I(100)) == NULL, "list not empty");]]></value>
</code>
</step>
</steps>
@@ -3805,9 +3808,9 @@ test_assert(chPoolAlloc(&mp1) == NULL, "provider returned memory");]]></value>
<value>CH_CFG_USE_HEAP</value>
</condition>
<shared_code>
- <value><![CDATA[#define ALLOC_SIZE 16
-#define HEAP_SIZE (ALLOC_SIZE * 8)
-
+ <value><![CDATA[#define ALLOC_SIZE 16
+#define HEAP_SIZE (ALLOC_SIZE * 8)
+
memory_heap_t test_heap;]]></value>
</shared_code>
<cases>
@@ -3829,7 +3832,7 @@ memory_heap_t test_heap;]]></value>
<value />
</teardown_code>
<local_variables>
- <value><![CDATA[void *p1, *p2, *p3;
+ <value><![CDATA[void *p1, *p2, *p3;
size_t n, sz;]]></value>
</local_variables>
</various_code>
@@ -3853,7 +3856,7 @@ size_t n, sz;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[p1 = chHeapAlloc(&test_heap, sizeof test_buffer * 2);
+ <value><![CDATA[p1 = chHeapAlloc(&test_heap, sizeof test_buffer * 2);
test_assert(p1 == NULL, "allocation not failed");]]></value>
</code>
</step>
@@ -3865,8 +3868,8 @@ test_assert(p1 == NULL, "allocation not failed");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[p1 = chHeapAlloc(&test_heap, ALLOC_SIZE);
-test_assert(p1 != NULL, "allocation failed");
+ <value><![CDATA[p1 = chHeapAlloc(&test_heap, ALLOC_SIZE);
+test_assert(p1 != NULL, "allocation failed");
chHeapFree(p1);]]></value>
</code>
</step>
@@ -3878,11 +3881,11 @@ chHeapFree(p1);]]></value>
<value />
</tags>
<code>
- <value><![CDATA[size_t total_size, largest_size;
-
-n = chHeapStatus(&test_heap, &total_size, &largest_size);
-test_assert(n == 1, "missing free block");
-test_assert(total_size >= ALLOC_SIZE, "unexpected heap state");
+ <value><![CDATA[size_t total_size, largest_size;
+
+n = chHeapStatus(&test_heap, &total_size, &largest_size);
+test_assert(n == 1, "missing free block");
+test_assert(total_size >= ALLOC_SIZE, "unexpected heap state");
test_assert(total_size == largest_size, "unexpected heap state");]]></value>
</code>
</step>
@@ -3894,12 +3897,12 @@ test_assert(total_size == largest_size, "unexpected heap state");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[p1 = chHeapAlloc(&test_heap, ALLOC_SIZE);
-p2 = chHeapAlloc(&test_heap, ALLOC_SIZE);
-p3 = chHeapAlloc(&test_heap, ALLOC_SIZE);
-chHeapFree(p1); /* Does not merge.*/
-chHeapFree(p2); /* Merges backward.*/
-chHeapFree(p3); /* Merges both sides.*/
+ <value><![CDATA[p1 = chHeapAlloc(&test_heap, ALLOC_SIZE);
+p2 = chHeapAlloc(&test_heap, ALLOC_SIZE);
+p3 = chHeapAlloc(&test_heap, ALLOC_SIZE);
+chHeapFree(p1); /* Does not merge.*/
+chHeapFree(p2); /* Merges backward.*/
+chHeapFree(p3); /* Merges both sides.*/
test_assert(chHeapStatus(&test_heap, &n, NULL) == 1, "heap fragmented");]]></value>
</code>
</step>
@@ -3911,12 +3914,12 @@ test_assert(chHeapStatus(&test_heap, &n, NULL) == 1, "heap fragmented");]]></val
<value />
</tags>
<code>
- <value><![CDATA[p1 = chHeapAlloc(&test_heap, ALLOC_SIZE);
-p2 = chHeapAlloc(&test_heap, ALLOC_SIZE);
-p3 = chHeapAlloc(&test_heap, ALLOC_SIZE);
-chHeapFree(p3); /* Merges forward.*/
-chHeapFree(p2); /* Merges forward.*/
-chHeapFree(p1); /* Merges forward.*/
+ <value><![CDATA[p1 = chHeapAlloc(&test_heap, ALLOC_SIZE);
+p2 = chHeapAlloc(&test_heap, ALLOC_SIZE);
+p3 = chHeapAlloc(&test_heap, ALLOC_SIZE);
+chHeapFree(p3); /* Merges forward.*/
+chHeapFree(p2); /* Merges forward.*/
+chHeapFree(p1); /* Merges forward.*/
test_assert(chHeapStatus(&test_heap, &n, NULL) == 1, "heap fragmented");]]></value>
</code>
</step>
@@ -3928,17 +3931,17 @@ test_assert(chHeapStatus(&test_heap, &n, NULL) == 1, "heap fragmented");]]></val
<value />
</tags>
<code>
- <value><![CDATA[p1 = chHeapAlloc(&test_heap, ALLOC_SIZE + 1);
-p2 = chHeapAlloc(&test_heap, ALLOC_SIZE);
-chHeapFree(p1);
-test_assert(chHeapStatus(&test_heap, &n, NULL) == 2, "invalid state");
-p1 = chHeapAlloc(&test_heap, ALLOC_SIZE);
-/* Note, the first situation happens when the alignment size is smaller
- than the header size, the second in the other cases.*/
-test_assert((chHeapStatus(&test_heap, &n, NULL) == 1) ||
- (chHeapStatus(&test_heap, &n, NULL) == 2), "heap fragmented");
-chHeapFree(p2);
-chHeapFree(p1);
+ <value><![CDATA[p1 = chHeapAlloc(&test_heap, ALLOC_SIZE + 1);
+p2 = chHeapAlloc(&test_heap, ALLOC_SIZE);
+chHeapFree(p1);
+test_assert(chHeapStatus(&test_heap, &n, NULL) == 2, "invalid state");
+p1 = chHeapAlloc(&test_heap, ALLOC_SIZE);
+/* Note, the first situation happens when the alignment size is smaller
+ than the header size, the second in the other cases.*/
+test_assert((chHeapStatus(&test_heap, &n, NULL) == 1) ||
+ (chHeapStatus(&test_heap, &n, NULL) == 2), "heap fragmented");
+chHeapFree(p2);
+chHeapFree(p1);
test_assert(chHeapStatus(&test_heap, &n, NULL) == 1, "heap fragmented");]]></value>
</code>
</step>
@@ -3950,13 +3953,13 @@ test_assert(chHeapStatus(&test_heap, &n, NULL) == 1, "heap fragmented");]]></val
<value />
</tags>
<code>
- <value><![CDATA[p1 = chHeapAlloc(&test_heap, ALLOC_SIZE);
-p2 = chHeapAlloc(&test_heap, ALLOC_SIZE);
-chHeapFree(p1);
-test_assert( chHeapStatus(&test_heap, &n, NULL) == 2, "invalid state");
-p1 = chHeapAlloc(&test_heap, ALLOC_SIZE * 2); /* Skips first fragment.*/
-chHeapFree(p1);
-chHeapFree(p2);
+ <value><![CDATA[p1 = chHeapAlloc(&test_heap, ALLOC_SIZE);
+p2 = chHeapAlloc(&test_heap, ALLOC_SIZE);
+chHeapFree(p1);
+test_assert( chHeapStatus(&test_heap, &n, NULL) == 2, "invalid state");
+p1 = chHeapAlloc(&test_heap, ALLOC_SIZE * 2); /* Skips first fragment.*/
+chHeapFree(p1);
+chHeapFree(p2);
test_assert(chHeapStatus(&test_heap, &n, NULL) == 1, "heap fragmented");]]></value>
</code>
</step>
@@ -3968,10 +3971,10 @@ test_assert(chHeapStatus(&test_heap, &n, NULL) == 1, "heap fragmented");]]></val
<value />
</tags>
<code>
- <value><![CDATA[(void)chHeapStatus(&test_heap, &n, NULL);
-p1 = chHeapAlloc(&test_heap, n);
-test_assert(p1 != NULL, "allocation failed");
-test_assert(chHeapStatus(&test_heap, NULL, NULL) == 0, "not empty");
+ <value><![CDATA[(void)chHeapStatus(&test_heap, &n, NULL);
+p1 = chHeapAlloc(&test_heap, n);
+test_assert(p1 != NULL, "allocation failed");
+test_assert(chHeapStatus(&test_heap, NULL, NULL) == 0, "not empty");
chHeapFree(p1);]]></value>
</code>
</step>
@@ -3983,7 +3986,7 @@ chHeapFree(p1);]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_assert(chHeapStatus(&test_heap, &n, NULL) == 1, "heap fragmented");
+ <value><![CDATA[test_assert(chHeapStatus(&test_heap, &n, NULL) == 1, "heap fragmented");
test_assert(n == sz, "size changed");]]></value>
</code>
</step>
@@ -4007,7 +4010,7 @@ test_assert(n == sz, "size changed");]]></value>
<value />
</teardown_code>
<local_variables>
- <value><![CDATA[void *p1;
+ <value><![CDATA[void *p1;
size_t total_size, largest_size;]]></value>
</local_variables>
</various_code>
@@ -4020,9 +4023,9 @@ size_t total_size, largest_size;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[(void)chHeapStatus(NULL, &total_size, &largest_size);
-p1 = chHeapAlloc(&test_heap, ALLOC_SIZE);
-test_assert(p1 != NULL, "allocation failed");
+ <value><![CDATA[(void)chHeapStatus(NULL, &total_size, &largest_size);
+p1 = chHeapAlloc(&test_heap, ALLOC_SIZE);
+test_assert(p1 != NULL, "allocation failed");
chHeapFree(p1);]]></value>
</code>
</step>
@@ -4034,7 +4037,7 @@ chHeapFree(p1);]]></value>
<value />
</tags>
<code>
- <value><![CDATA[p1 = chHeapAlloc(NULL, (size_t)-256);
+ <value><![CDATA[p1 = chHeapAlloc(NULL, (size_t)-256);
test_assert(p1 == NULL, "allocation not failed");]]></value>
</code>
</step>
@@ -4056,16 +4059,16 @@ test_assert(p1 == NULL, "allocation not failed");]]></value>
<value>CH_CFG_USE_DYNAMIC</value>
</condition>
<shared_code>
- <value><![CDATA[#if CH_CFG_USE_HEAP
-static memory_heap_t heap1;
-#endif
-#if CH_CFG_USE_MEMPOOLS
-static memory_pool_t mp1;
-#endif
-
-static THD_FUNCTION(dyn_thread1, p) {
-
- test_emit_token(*(char *)p);
+ <value><![CDATA[#if CH_CFG_USE_HEAP
+static memory_heap_t heap1;
+#endif
+#if CH_CFG_USE_MEMPOOLS
+static memory_pool_t mp1;
+#endif
+
+static THD_FUNCTION(dyn_thread1, p) {
+
+ test_emit_token(*(char *)p);
}]]></value>
</shared_code>
<cases>
@@ -4088,8 +4091,8 @@ The test expects the first two threads to successfully start and the third one t
<value />
</teardown_code>
<local_variables>
- <value><![CDATA[size_t n1, total1, largest1;
-size_t n2, total2, largest2;
+ <value><![CDATA[size_t n1, total1, largest1;
+size_t n2, total2, largest2;
tprio_t prio;]]></value>
</local_variables>
</various_code>
@@ -4113,7 +4116,7 @@ tprio_t prio;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[n1 = chHeapStatus(&heap1, &total1, &largest1);
+ <value><![CDATA[n1 = chHeapStatus(&heap1, &total1, &largest1);
test_assert(n1 == 1, "heap fragmented");]]></value>
</code>
</step>
@@ -4125,10 +4128,10 @@ test_assert(n1 == 1, "heap fragmented");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[threads[0] = chThdCreateFromHeap(&heap1,
- THD_WORKING_AREA_SIZE(THREADS_STACK_SIZE),
- "dyn1",
- prio-1, dyn_thread1, "A");
+ <value><![CDATA[threads[0] = chThdCreateFromHeap(&heap1,
+ THD_WORKING_AREA_SIZE(THREADS_STACK_SIZE),
+ "dyn1",
+ prio-1, dyn_thread1, "A");
test_assert(threads[0] != NULL, "thread creation failed");]]></value>
</code>
</step>
@@ -4140,10 +4143,10 @@ test_assert(threads[0] != NULL, "thread creation failed");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[threads[1] = chThdCreateFromHeap(&heap1,
- THD_WORKING_AREA_SIZE(THREADS_STACK_SIZE),
- "dyn2",
- prio-2, dyn_thread1, "B");
+ <value><![CDATA[threads[1] = chThdCreateFromHeap(&heap1,
+ THD_WORKING_AREA_SIZE(THREADS_STACK_SIZE),
+ "dyn2",
+ prio-2, dyn_thread1, "B");
test_assert(threads[1] != NULL, "thread creation failed");]]></value>
</code>
</step>
@@ -4155,10 +4158,10 @@ test_assert(threads[1] != NULL, "thread creation failed");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[threads[2] = chThdCreateFromHeap(&heap1,
- THD_WORKING_AREA_SIZE(THREADS_STACK_SIZE * 1024),
- "dyn3",
- prio-3, dyn_thread1, "C");
+ <value><![CDATA[threads[2] = chThdCreateFromHeap(&heap1,
+ THD_WORKING_AREA_SIZE(THREADS_STACK_SIZE * 1024),
+ "dyn3",
+ prio-3, dyn_thread1, "C");
test_assert(threads[2] == NULL, "thread creation not failed");]]></value>
</code>
</step>
@@ -4170,7 +4173,7 @@ test_assert(threads[2] == NULL, "thread creation not failed");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_wait_threads();
+ <value><![CDATA[test_wait_threads();
test_assert_sequence("AB", "invalid sequence");]]></value>
</code>
</step>
@@ -4182,9 +4185,9 @@ test_assert_sequence("AB", "invalid sequence");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[n2 = chHeapStatus(&heap1, &total2, &largest2);
-test_assert(n1 == n2, "fragmentation changed");
-test_assert(total1 == total2, "total free space changed");
+ <value><![CDATA[n2 = chHeapStatus(&heap1, &total2, &largest2);
+test_assert(n1 == n2, "fragmentation changed");
+test_assert(total1 == total2, "total free space changed");
test_assert(largest1 == largest2, "largest fragment size changed");]]></value>
</code>
</step>
@@ -4209,7 +4212,7 @@ The test expects the first four threads to successfully start and the last one t
<value />
</teardown_code>
<local_variables>
- <value><![CDATA[unsigned i;
+ <value><![CDATA[unsigned i;
tprio_t prio;]]></value>
</local_variables>
</various_code>
@@ -4222,7 +4225,7 @@ tprio_t prio;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < 4; i++)
+ <value><![CDATA[for (i = 0; i < 4; i++)
chPoolFree(&mp1, wa[i]);]]></value>
</code>
</step>
@@ -4245,10 +4248,10 @@ tprio_t prio;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[threads[0] = chThdCreateFromMemoryPool(&mp1, "dyn1", prio-1, dyn_thread1, "A");
-threads[1] = chThdCreateFromMemoryPool(&mp1, "dyn2", prio-2, dyn_thread1, "B");
-threads[2] = chThdCreateFromMemoryPool(&mp1, "dyn3", prio-3, dyn_thread1, "C");
-threads[3] = chThdCreateFromMemoryPool(&mp1, "dyn4", prio-4, dyn_thread1, "D");
+ <value><![CDATA[threads[0] = chThdCreateFromMemoryPool(&mp1, "dyn1", prio-1, dyn_thread1, "A");
+threads[1] = chThdCreateFromMemoryPool(&mp1, "dyn2", prio-2, dyn_thread1, "B");
+threads[2] = chThdCreateFromMemoryPool(&mp1, "dyn3", prio-3, dyn_thread1, "C");
+threads[3] = chThdCreateFromMemoryPool(&mp1, "dyn4", prio-4, dyn_thread1, "D");
threads[4] = chThdCreateFromMemoryPool(&mp1, "dyn5", prio-5, dyn_thread1, "E");]]></value>
</code>
</step>
@@ -4260,12 +4263,12 @@ threads[4] = chThdCreateFromMemoryPool(&mp1, "dyn5", prio-5, dyn_thread1, "E");]
<value />
</tags>
<code>
- <value><![CDATA[test_assert((threads[0] != NULL) &&
- (threads[1] != NULL) &&
- (threads[2] != NULL) &&
- (threads[3] != NULL),
- "thread creation failed");
-test_assert(threads[4] == NULL,
+ <value><![CDATA[test_assert((threads[0] != NULL) &&
+ (threads[1] != NULL) &&
+ (threads[2] != NULL) &&
+ (threads[3] != NULL),
+ "thread creation failed");
+test_assert(threads[4] == NULL,
"thread creation not failed");]]></value>
</code>
</step>
@@ -4277,7 +4280,7 @@ test_assert(threads[4] == NULL,
<value />
</tags>
<code>
- <value><![CDATA[test_wait_threads();
+ <value><![CDATA[test_wait_threads();
test_assert_sequence("ABCD", "invalid sequence");]]></value>
</code>
</step>
@@ -4289,8 +4292,8 @@ test_assert_sequence("ABCD", "invalid sequence");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < 4; i++)
- test_assert(chPoolAlloc(&mp1) != NULL, "pool list empty");
+ <value><![CDATA[for (i = 0; i < 4; i++)
+ test_assert(chPoolAlloc(&mp1) != NULL, "pool list empty");
test_assert(chPoolAlloc(&mp1) == NULL, "pool list not empty");]]></value>
</code>
</step>
@@ -4313,85 +4316,85 @@ Objective of the test sequence is to provide a performance index for the most cr
<value />
</condition>
<shared_code>
- <value><![CDATA[#if CH_CFG_USE_SEMAPHORES || defined(__DOXYGEN__)
-static semaphore_t sem1;
-#endif
-#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
-static mutex_t mtx1;
-#endif
-
-static void tmo(void *param) {(void)param;}
-
-#if CH_CFG_USE_MESSAGES
-static THD_FUNCTION(bmk_thread1, p) {
- thread_t *tp;
- msg_t msg;
-
- (void)p;
- do {
- tp = chMsgWait();
- msg = chMsgGet(tp);
- chMsgRelease(tp, msg);
- } while (msg);
-}
-
-NOINLINE static unsigned int msg_loop_test(thread_t *tp) {
- systime_t start, end;
-
- uint32_t n = 0;
- start = test_wait_tick();
- end = start + MS2ST(1000);
- do {
- (void)chMsgSend(tp, 1);
- n++;
-#if defined(SIMULATOR)
- _sim_check_for_interrupts();
-#endif
- } while (chVTIsSystemTimeWithinX(start, end));
- (void)chMsgSend(tp, 0);
- return n;
-}
-#endif
-
-static THD_FUNCTION(bmk_thread3, p) {
-
- chThdExit((msg_t)p);
-}
-
-static THD_FUNCTION(bmk_thread4, p) {
- msg_t msg;
- thread_t *self = chThdGetSelfX();
-
- (void)p;
- chSysLock();
- do {
- chSchGoSleepS(CH_STATE_SUSPENDED);
- msg = self->u.rdymsg;
- } while (msg == MSG_OK);
- chSysUnlock();
-}
-
-#if CH_CFG_USE_SEMAPHORES
-static THD_FUNCTION(bmk_thread7, p) {
-
- (void)p;
- while (!chThdShouldTerminateX())
- chSemWait(&sem1);
-}
-#endif
-
-static THD_FUNCTION(bmk_thread8, p) {
-
- do {
- chThdYield();
- chThdYield();
- chThdYield();
- chThdYield();
- (*(uint32_t *)p) += 4;
-#if defined(SIMULATOR)
- _sim_check_for_interrupts();
-#endif
- } while(!chThdShouldTerminateX());
+ <value><![CDATA[#if CH_CFG_USE_SEMAPHORES || defined(__DOXYGEN__)
+static semaphore_t sem1;
+#endif
+#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
+static mutex_t mtx1;
+#endif
+
+static void tmo(void *param) {(void)param;}
+
+#if CH_CFG_USE_MESSAGES
+static THD_FUNCTION(bmk_thread1, p) {
+ thread_t *tp;
+ msg_t msg;
+
+ (void)p;
+ do {
+ tp = chMsgWait();
+ msg = chMsgGet(tp);
+ chMsgRelease(tp, msg);
+ } while (msg);
+}
+
+NOINLINE static unsigned int msg_loop_test(thread_t *tp) {
+ systime_t start, end;
+
+ uint32_t n = 0;
+ start = test_wait_tick();
+ end = start + TIME_MS2I(1000);
+ do {
+ (void)chMsgSend(tp, 1);
+ n++;
+#if defined(SIMULATOR)
+ _sim_check_for_interrupts();
+#endif
+ } while (chVTIsSystemTimeWithinX(start, end));
+ (void)chMsgSend(tp, 0);
+ return n;
+}
+#endif
+
+static THD_FUNCTION(bmk_thread3, p) {
+
+ chThdExit((msg_t)p);
+}
+
+static THD_FUNCTION(bmk_thread4, p) {
+ msg_t msg;
+ thread_t *self = chThdGetSelfX();
+
+ (void)p;
+ chSysLock();
+ do {
+ chSchGoSleepS(CH_STATE_SUSPENDED);
+ msg = self->u.rdymsg;
+ } while (msg == MSG_OK);
+ chSysUnlock();
+}
+
+#if CH_CFG_USE_SEMAPHORES
+static THD_FUNCTION(bmk_thread7, p) {
+
+ (void)p;
+ while (!chThdShouldTerminateX())
+ chSemWait(&sem1);
+}
+#endif
+
+static THD_FUNCTION(bmk_thread8, p) {
+
+ do {
+ chThdYield();
+ chThdYield();
+ chThdYield();
+ chThdYield();
+ (*(uint32_t *)p) += 4;
+#if defined(SIMULATOR)
+ _sim_check_for_interrupts();
+#endif
+ } while(!chThdShouldTerminateX());
}]]></value>
</shared_code>
<cases>
@@ -4436,7 +4439,7 @@ static THD_FUNCTION(bmk_thread8, p) {
<value />
</tags>
<code>
- <value><![CDATA[n = msg_loop_test(threads[0]);
+ <value><![CDATA[n = msg_loop_test(threads[0]);
test_wait_threads();]]></value>
</code>
</step>
@@ -4448,10 +4451,10 @@ test_wait_threads();]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_print("--- Score : ");
-test_printn(n);
-test_print(" msgs/S, ");
-test_printn(n << 1);
+ <value><![CDATA[test_print("--- Score : ");
+test_printn(n);
+test_print(" msgs/S, ");
+test_printn(n << 1);
test_println(" ctxswc/S");]]></value>
</code>
</step>
@@ -4498,7 +4501,7 @@ test_println(" ctxswc/S");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[n = msg_loop_test(threads[0]);
+ <value><![CDATA[n = msg_loop_test(threads[0]);
test_wait_threads();]]></value>
</code>
</step>
@@ -4510,10 +4513,10 @@ test_wait_threads();]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_print("--- Score : ");
-test_printn(n);
-test_print(" msgs/S, ");
-test_printn(n << 1);
+ <value><![CDATA[test_print("--- Score : ");
+test_printn(n);
+test_print(" msgs/S, ");
+test_printn(n << 1);
test_println(" ctxswc/S");]]></value>
</code>
</step>
@@ -4560,9 +4563,9 @@ test_println(" ctxswc/S");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriorityX()-2, bmk_thread3, NULL);
-threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriorityX()-3, bmk_thread3, NULL);
-threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriorityX()-4, bmk_thread3, NULL);
+ <value><![CDATA[threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriorityX()-2, bmk_thread3, NULL);
+threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriorityX()-3, bmk_thread3, NULL);
+threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriorityX()-4, bmk_thread3, NULL);
threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriorityX()-5, bmk_thread3, NULL);]]></value>
</code>
</step>
@@ -4574,7 +4577,7 @@ threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriorityX()-5, bmk_thread
<value />
</tags>
<code>
- <value><![CDATA[n = msg_loop_test(threads[0]);
+ <value><![CDATA[n = msg_loop_test(threads[0]);
test_wait_threads();]]></value>
</code>
</step>
@@ -4586,10 +4589,10 @@ test_wait_threads();]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_print("--- Score : ");
-test_printn(n);
-test_print(" msgs/S, ");
-test_printn(n << 1);
+ <value><![CDATA[test_print("--- Score : ");
+test_printn(n);
+test_print(" msgs/S, ");
+test_printn(n << 1);
test_println(" ctxswc/S");]]></value>
</code>
</step>
@@ -4614,7 +4617,7 @@ The Context Switch performance is calculated by measuring the number of iteratio
<value />
</teardown_code>
<local_variables>
- <value><![CDATA[thread_t *tp;
+ <value><![CDATA[thread_t *tp;
uint32_t n;]]></value>
</local_variables>
</various_code>
@@ -4627,7 +4630,7 @@ uint32_t n;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[tp = threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()+1,
+ <value><![CDATA[tp = threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()+1,
bmk_thread4, NULL);]]></value>
</code>
</step>
@@ -4639,22 +4642,22 @@ uint32_t n;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[systime_t start, end;
-
-n = 0;
-start = test_wait_tick();
-end = start + MS2ST(1000);
-do {
- chSysLock();
- chSchWakeupS(tp, MSG_OK);
- chSchWakeupS(tp, MSG_OK);
- chSchWakeupS(tp, MSG_OK);
- chSchWakeupS(tp, MSG_OK);
- chSysUnlock();
- n += 4;
-#if defined(SIMULATOR)
- _sim_check_for_interrupts();
-#endif
+ <value><![CDATA[systime_t start, end;
+
+n = 0;
+start = test_wait_tick();
+end = start + TIME_MS2I(1000);
+do {
+ chSysLock();
+ chSchWakeupS(tp, MSG_OK);
+ chSchWakeupS(tp, MSG_OK);
+ chSchWakeupS(tp, MSG_OK);
+ chSchWakeupS(tp, MSG_OK);
+ chSysUnlock();
+ n += 4;
+#if defined(SIMULATOR)
+ _sim_check_for_interrupts();
+#endif
} while (chVTIsSystemTimeWithinX(start, end));]]></value>
</code>
</step>
@@ -4666,9 +4669,9 @@ do {
<value />
</tags>
<code>
- <value><![CDATA[chSysLock();
-chSchWakeupS(tp, MSG_TIMEOUT);
-chSysUnlock();
+ <value><![CDATA[chSysLock();
+chSchWakeupS(tp, MSG_TIMEOUT);
+chSysUnlock();
test_wait_threads();]]></value>
</code>
</step>
@@ -4680,8 +4683,8 @@ test_wait_threads();]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_print("--- Score : ");
-test_printn(n * 2);
+ <value><![CDATA[test_print("--- Score : ");
+test_printn(n * 2);
test_println(" ctxswc/S");]]></value>
</code>
</step>
@@ -4706,8 +4709,8 @@ The performance is calculated by measuring the number of iterations after a seco
<value />
</teardown_code>
<local_variables>
- <value><![CDATA[uint32_t n;
-tprio_t prio = chThdGetPriorityX() - 1;
+ <value><![CDATA[uint32_t n;
+tprio_t prio = chThdGetPriorityX() - 1;
systime_t start, end;]]></value>
</local_variables>
</various_code>
@@ -4720,15 +4723,15 @@ systime_t start, end;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[n = 0;
-start = test_wait_tick();
-end = start + MS2ST(1000);
-do {
- chThdWait(chThdCreateStatic(wa[0], WA_SIZE, prio, bmk_thread3, NULL));
- n++;
-#if defined(SIMULATOR)
- _sim_check_for_interrupts();
-#endif
+ <value><![CDATA[n = 0;
+start = test_wait_tick();
+end = start + TIME_MS2I(1000);
+do {
+ chThdWait(chThdCreateStatic(wa[0], WA_SIZE, prio, bmk_thread3, NULL));
+ n++;
+#if defined(SIMULATOR)
+ _sim_check_for_interrupts();
+#endif
} while (chVTIsSystemTimeWithinX(start, end));]]></value>
</code>
</step>
@@ -4740,8 +4743,8 @@ do {
<value />
</tags>
<code>
- <value><![CDATA[test_print("--- Score : ");
-test_printn(n);
+ <value><![CDATA[test_print("--- Score : ");
+test_printn(n);
test_println(" threads/S");]]></value>
</code>
</step>
@@ -4765,8 +4768,8 @@ test_println(" threads/S");]]></value>
<value />
</teardown_code>
<local_variables>
- <value><![CDATA[uint32_t n;
-tprio_t prio = chThdGetPriorityX() + 1;
+ <value><![CDATA[uint32_t n;
+tprio_t prio = chThdGetPriorityX() + 1;
systime_t start, end;]]></value>
</local_variables>
</various_code>
@@ -4779,19 +4782,19 @@ systime_t start, end;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[n = 0;
-start = test_wait_tick();
-end = start + MS2ST(1000);
-do {
-#if CH_CFG_USE_REGISTRY
- chThdRelease(chThdCreateStatic(wa[0], WA_SIZE, prio, bmk_thread3, NULL));
-#else
- chThdCreateStatic(wa[0], WA_SIZE, prio, bmk_thread3, NULL);
-#endif
- n++;
-#if defined(SIMULATOR)
- _sim_check_for_interrupts();
-#endif
+ <value><![CDATA[n = 0;
+start = test_wait_tick();
+end = start + TIME_MS2I(1000);
+do {
+#if CH_CFG_USE_REGISTRY
+ chThdRelease(chThdCreateStatic(wa[0], WA_SIZE, prio, bmk_thread3, NULL));
+#else
+ chThdCreateStatic(wa[0], WA_SIZE, prio, bmk_thread3, NULL);
+#endif
+ n++;
+#if defined(SIMULATOR)
+ _sim_check_for_interrupts();
+#endif
} while (chVTIsSystemTimeWithinX(start, end));]]></value>
</code>
</step>
@@ -4803,8 +4806,8 @@ do {
<value />
</tags>
<code>
- <value><![CDATA[test_print("--- Score : ");
-test_printn(n);
+ <value><![CDATA[test_print("--- Score : ");
+test_printn(n);
test_println(" threads/S");]]></value>
</code>
</step>
@@ -4841,10 +4844,10 @@ The performance is calculated by measuring the number of iterations after a seco
<value />
</tags>
<code>
- <value><![CDATA[threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()+5, bmk_thread7, NULL);
-threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriorityX()+4, bmk_thread7, NULL);
-threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriorityX()+3, bmk_thread7, NULL);
-threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriorityX()+2, bmk_thread7, NULL);
+ <value><![CDATA[threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()+5, bmk_thread7, NULL);
+threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriorityX()+4, bmk_thread7, NULL);
+threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriorityX()+3, bmk_thread7, NULL);
+threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriorityX()+2, bmk_thread7, NULL);
threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriorityX()+1, bmk_thread7, NULL);]]></value>
</code>
</step>
@@ -4856,17 +4859,17 @@ threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriorityX()+1, bmk_thread
<value />
</tags>
<code>
- <value><![CDATA[systime_t start, end;
-
-n = 0;
-start = test_wait_tick();
-end = start + MS2ST(1000);
-do {
- chSemReset(&sem1, 0);
- n++;
-#if defined(SIMULATOR)
- _sim_check_for_interrupts();
-#endif
+ <value><![CDATA[systime_t start, end;
+
+n = 0;
+start = test_wait_tick();
+end = start + TIME_MS2I(1000);
+do {
+ chSemReset(&sem1, 0);
+ n++;
+#if defined(SIMULATOR)
+ _sim_check_for_interrupts();
+#endif
} while (chVTIsSystemTimeWithinX(start, end));]]></value>
</code>
</step>
@@ -4878,8 +4881,8 @@ do {
<value />
</tags>
<code>
- <value><![CDATA[test_terminate_threads();
-chSemReset(&sem1, 0);
+ <value><![CDATA[test_terminate_threads();
+chSemReset(&sem1, 0);
test_wait_threads();]]></value>
</code>
</step>
@@ -4891,10 +4894,10 @@ test_wait_threads();]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_print("--- Score : ");
-test_printn(n);
-test_print(" reschedules/S, ");
-test_printn(n * 6);
+ <value><![CDATA[test_print("--- Score : ");
+test_printn(n);
+test_print(" reschedules/S, ");
+test_printn(n * 6);
test_println(" ctxswc/S");]]></value>
</code>
</step>
@@ -4931,12 +4934,12 @@ The performance is calculated by measuring the number of iterations after a seco
<value />
</tags>
<code>
- <value><![CDATA[n = 0;
-test_wait_tick();threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()-1, bmk_thread8, (void *)&n);
-
-threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriorityX()-1, bmk_thread8, (void *)&n);
-threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriorityX()-1, bmk_thread8, (void *)&n);
-threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriorityX()-1, bmk_thread8, (void *)&n);
+ <value><![CDATA[n = 0;
+test_wait_tick();threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX()-1, bmk_thread8, (void *)&n);
+
+threads[1] = chThdCreateStatic(wa[1], WA_SIZE, chThdGetPriorityX()-1, bmk_thread8, (void *)&n);
+threads[2] = chThdCreateStatic(wa[2], WA_SIZE, chThdGetPriorityX()-1, bmk_thread8, (void *)&n);
+threads[3] = chThdCreateStatic(wa[3], WA_SIZE, chThdGetPriorityX()-1, bmk_thread8, (void *)&n);
threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriorityX()-1, bmk_thread8, (void *)&n);]]></value>
</code>
</step>
@@ -4948,8 +4951,8 @@ threads[4] = chThdCreateStatic(wa[4], WA_SIZE, chThdGetPriorityX()-1, bmk_thread
<value />
</tags>
<code>
- <value><![CDATA[chThdSleepSeconds(1);
-test_terminate_threads();
+ <value><![CDATA[chThdSleepSeconds(1);
+test_terminate_threads();
test_wait_threads();]]></value>
</code>
</step>
@@ -4961,8 +4964,8 @@ test_wait_threads();]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_print("--- Score : ");
-test_printn(n);
+ <value><![CDATA[test_print("--- Score : ");
+test_printn(n);
test_println(" ctxswc/S");]]></value>
</code>
</step>
@@ -4987,7 +4990,7 @@ The performance is calculated by measuring the number of iterations after a seco
<value />
</teardown_code>
<local_variables>
- <value><![CDATA[static virtual_timer_t vt1, vt2;
+ <value><![CDATA[static virtual_timer_t vt1, vt2;
uint32_t n;]]></value>
</local_variables>
</various_code>
@@ -5000,22 +5003,22 @@ uint32_t n;]]></value>
<value />
</tags>
<code>
- <value><![CDATA[systime_t start, end;
-
-n = 0;
-start = test_wait_tick();
-end = start + MS2ST(1000);
-do {
- chSysLock();
- chVTDoSetI(&vt1, 1, tmo, NULL);
- chVTDoSetI(&vt2, 10000, tmo, NULL);
- chVTDoResetI(&vt1);
- chVTDoResetI(&vt2);
- chSysUnlock();
- n++;
-#if defined(SIMULATOR)
- _sim_check_for_interrupts();
-#endif
+ <value><![CDATA[systime_t start, end;
+
+n = 0;
+start = test_wait_tick();
+end = start + TIME_MS2I(1000);
+do {
+ chSysLock();
+ chVTDoSetI(&vt1, 1, tmo, NULL);
+ chVTDoSetI(&vt2, 10000, tmo, NULL);
+ chVTDoResetI(&vt1);
+ chVTDoResetI(&vt2);
+ chSysUnlock();
+ n++;
+#if defined(SIMULATOR)
+ _sim_check_for_interrupts();
+#endif
} while (chVTIsSystemTimeWithinX(start, end));]]></value>
</code>
</step>
@@ -5027,8 +5030,8 @@ do {
<value />
</tags>
<code>
- <value><![CDATA[test_print("--- Score : ");
-test_printn(n * 2);
+ <value><![CDATA[test_print("--- Score : ");
+test_printn(n * 2);
test_println(" timers/S");]]></value>
</code>
</step>
@@ -5065,24 +5068,24 @@ The performance is calculated by measuring the number of iterations after a seco
<value />
</tags>
<code>
- <value><![CDATA[systime_t start, end;
-
-n = 0;
-start = test_wait_tick();
-end = start + MS2ST(1000);
-do {
- chSemWait(&sem1);
- chSemSignal(&sem1);
- chSemWait(&sem1);
- chSemSignal(&sem1);
- chSemWait(&sem1);
- chSemSignal(&sem1);
- chSemWait(&sem1);
- chSemSignal(&sem1);
- n++;
-#if defined(SIMULATOR)
- _sim_check_for_interrupts();
-#endif
+ <value><![CDATA[systime_t start, end;
+
+n = 0;
+start = test_wait_tick();
+end = start + TIME_MS2I(1000);
+do {
+ chSemWait(&sem1);
+ chSemSignal(&sem1);
+ chSemWait(&sem1);
+ chSemSignal(&sem1);
+ chSemWait(&sem1);
+ chSemSignal(&sem1);
+ chSemWait(&sem1);
+ chSemSignal(&sem1);
+ n++;
+#if defined(SIMULATOR)
+ _sim_check_for_interrupts();
+#endif
} while (chVTIsSystemTimeWithinX(start, end));]]></value>
</code>
</step>
@@ -5094,8 +5097,8 @@ do {
<value />
</tags>
<code>
- <value><![CDATA[test_print("--- Score : ");
-test_printn(n * 4);
+ <value><![CDATA[test_print("--- Score : ");
+test_printn(n * 4);
test_println(" wait+signal/S");]]></value>
</code>
</step>
@@ -5132,24 +5135,24 @@ The performance is calculated by measuring the number of iterations after a seco
<value />
</tags>
<code>
- <value><![CDATA[systime_t start, end;
-
-n = 0;
-start = test_wait_tick();
-end = start + MS2ST(1000);
-do {
- chMtxLock(&mtx1);
- chMtxUnlock(&mtx1);
- chMtxLock(&mtx1);
- chMtxUnlock(&mtx1);
- chMtxLock(&mtx1);
- chMtxUnlock(&mtx1);
- chMtxLock(&mtx1);
- chMtxUnlock(&mtx1);
- n++;
-#if defined(SIMULATOR)
- _sim_check_for_interrupts();
-#endif
+ <value><![CDATA[systime_t start, end;
+
+n = 0;
+start = test_wait_tick();
+end = start + TIME_MS2I(1000);
+do {
+ chMtxLock(&mtx1);
+ chMtxUnlock(&mtx1);
+ chMtxLock(&mtx1);
+ chMtxUnlock(&mtx1);
+ chMtxLock(&mtx1);
+ chMtxUnlock(&mtx1);
+ chMtxLock(&mtx1);
+ chMtxUnlock(&mtx1);
+ n++;
+#if defined(SIMULATOR)
+ _sim_check_for_interrupts();
+#endif
} while (chVTIsSystemTimeWithinX(start, end));]]></value>
</code>
</step>
@@ -5161,8 +5164,8 @@ do {
<value />
</tags>
<code>
- <value><![CDATA[test_print("--- Score : ");
-test_printn(n * 4);
+ <value><![CDATA[test_print("--- Score : ");
+test_printn(n * 4);
test_println(" lock+unlock/S");]]></value>
</code>
</step>
@@ -5198,8 +5201,8 @@ test_println(" lock+unlock/S");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_print("--- System: ");
-test_printn(sizeof(ch_system_t));
+ <value><![CDATA[test_print("--- System: ");
+test_printn(sizeof(ch_system_t));
test_println(" bytes");]]></value>
</code>
</step>
@@ -5211,8 +5214,8 @@ test_println(" bytes");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_print("--- Thread: ");
-test_printn(sizeof(thread_t));
+ <value><![CDATA[test_print("--- Thread: ");
+test_printn(sizeof(thread_t));
test_println(" bytes");]]></value>
</code>
</step>
@@ -5224,8 +5227,8 @@ test_println(" bytes");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[test_print("--- Timer : ");
-test_printn(sizeof(virtual_timer_t));
+ <value><![CDATA[test_print("--- Timer : ");
+test_printn(sizeof(virtual_timer_t));
test_println(" bytes");]]></value>
</code>
</step>
@@ -5237,10 +5240,10 @@ test_println(" bytes");]]></value>
<value />
</tags>
<code>
- <value><![CDATA[#if CH_CFG_USE_SEMAPHORES || defined(__DOXYGEN__)
-test_print("--- Semaph: ");
-test_printn(sizeof(semaphore_t));
-test_println(" bytes");
+ <value><![CDATA[#if CH_CFG_USE_SEMAPHORES || defined(__DOXYGEN__)
+test_print("--- Semaph: ");
+test_printn(sizeof(semaphore_t));
+test_println(" bytes");
#endif]]></value>
</code>
</step>
@@ -5252,10 +5255,10 @@ test_println(" bytes");
<value />
</tags>
<code>
- <value><![CDATA[#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
-test_print("--- Mutex : ");
-test_printn(sizeof(mutex_t));
-test_println(" bytes");
+ <value><![CDATA[#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
+test_print("--- Mutex : ");
+test_printn(sizeof(mutex_t));
+test_println(" bytes");
#endif]]></value>
</code>
</step>
@@ -5267,10 +5270,10 @@ test_println(" bytes");
<value />
</tags>
<code>
- <value><![CDATA[#if CH_CFG_USE_CONDVARS || defined(__DOXYGEN__)
-test_print("--- CondV.: ");
-test_printn(sizeof(condition_variable_t));
-test_println(" bytes");
+ <value><![CDATA[#if CH_CFG_USE_CONDVARS || defined(__DOXYGEN__)
+test_print("--- CondV.: ");
+test_printn(sizeof(condition_variable_t));
+test_println(" bytes");
#endif]]></value>
</code>
</step>
@@ -5282,10 +5285,10 @@ test_println(" bytes");
<value />
</tags>
<code>
- <value><![CDATA[#if CH_CFG_USE_EVENTS || defined(__DOXYGEN__)
-test_print("--- EventS: ");
-test_printn(sizeof(event_source_t));
-test_println(" bytes");
+ <value><![CDATA[#if CH_CFG_USE_EVENTS || defined(__DOXYGEN__)
+test_print("--- EventS: ");
+test_printn(sizeof(event_source_t));
+test_println(" bytes");
#endif]]></value>
</code>
</step>
@@ -5297,10 +5300,10 @@ test_println(" bytes");
<value />
</tags>
<code>
- <value><![CDATA[#if CH_CFG_USE_EVENTS || defined(__DOXYGEN__)
-test_print("--- EventL: ");
-test_printn(sizeof(event_listener_t));
-test_println(" bytes");
+ <value><![CDATA[#if CH_CFG_USE_EVENTS || defined(__DOXYGEN__)
+test_print("--- EventL: ");
+test_printn(sizeof(event_listener_t));
+test_println(" bytes");
#endif]]></value>
</code>
</step>
@@ -5312,10 +5315,10 @@ test_println(" bytes");
<value />
</tags>
<code>
- <value><![CDATA[#if CH_CFG_USE_MAILBOXES || defined(__DOXYGEN__)
-test_print("--- MailB.: ");
-test_printn(sizeof(mailbox_t));
-test_println(" bytes");
+ <value><![CDATA[#if CH_CFG_USE_MAILBOXES || defined(__DOXYGEN__)
+test_print("--- MailB.: ");
+test_printn(sizeof(mailbox_t));
+test_println(" bytes");
#endif]]></value>
</code>
</step>
diff --git a/test/rt/source/test/test_root.c b/test/rt/source/test/rt_test_root.c
index 9e37e78be..8692e3ba1 100644
--- a/test/rt/source/test/test_root.c
+++ b/test/rt/source/test/rt_test_root.c
@@ -21,30 +21,30 @@
* through successive improvements.
*
* <h2>Test Sequences</h2>
- * - @subpage test_sequence_001
- * - @subpage test_sequence_002
- * - @subpage test_sequence_003
- * - @subpage test_sequence_004
- * - @subpage test_sequence_005
- * - @subpage test_sequence_006
- * - @subpage test_sequence_007
- * - @subpage test_sequence_008
- * - @subpage test_sequence_009
- * - @subpage test_sequence_010
- * - @subpage test_sequence_011
- * - @subpage test_sequence_012
- * - @subpage test_sequence_013
+ * - @subpage rt_test_sequence_001
+ * - @subpage rt_test_sequence_002
+ * - @subpage rt_test_sequence_003
+ * - @subpage rt_test_sequence_004
+ * - @subpage rt_test_sequence_005
+ * - @subpage rt_test_sequence_006
+ * - @subpage rt_test_sequence_007
+ * - @subpage rt_test_sequence_008
+ * - @subpage rt_test_sequence_009
+ * - @subpage rt_test_sequence_010
+ * - @subpage rt_test_sequence_011
+ * - @subpage rt_test_sequence_012
+ * - @subpage rt_test_sequence_013
* .
*/
/**
- * @file test_root.c
+ * @file rt_test_root.c
* @brief Test Suite root structures code.
*/
#include "hal.h"
#include "ch_test.h"
-#include "test_root.h"
+#include "rt_test_root.h"
#if !defined(__DOXYGEN__)
@@ -55,36 +55,36 @@
/**
* @brief Array of all the test sequences.
*/
-const testcase_t * const *test_suite[] = {
- test_sequence_001,
- test_sequence_002,
- test_sequence_003,
- test_sequence_004,
+const testcase_t * const *rt_test_suite[] = {
+ rt_test_sequence_001,
+ rt_test_sequence_002,
+ rt_test_sequence_003,
+ rt_test_sequence_004,
#if (CH_CFG_USE_SEMAPHORES) || defined(__DOXYGEN__)
- test_sequence_005,
+ rt_test_sequence_005,
#endif
#if (CH_CFG_USE_MUTEXES) || defined(__DOXYGEN__)
- test_sequence_006,
+ rt_test_sequence_006,
#endif
#if (CH_CFG_USE_MESSAGES) || defined(__DOXYGEN__)
- test_sequence_007,
+ rt_test_sequence_007,
#endif
#if (CH_CFG_USE_EVENTS) || defined(__DOXYGEN__)
- test_sequence_008,
+ rt_test_sequence_008,
#endif
#if (CH_CFG_USE_MAILBOXES) || defined(__DOXYGEN__)
- test_sequence_009,
+ rt_test_sequence_009,
#endif
#if (CH_CFG_USE_MEMPOOLS) || defined(__DOXYGEN__)
- test_sequence_010,
+ rt_test_sequence_010,
#endif
#if (CH_CFG_USE_HEAP) || defined(__DOXYGEN__)
- test_sequence_011,
+ rt_test_sequence_011,
#endif
#if (CH_CFG_USE_DYNAMIC) || defined(__DOXYGEN__)
- test_sequence_012,
+ rt_test_sequence_012,
#endif
- test_sequence_013,
+ rt_test_sequence_013,
NULL
};
diff --git a/test/rt/source/test/test_root.h b/test/rt/source/test/rt_test_root.h
index fd0f32772..81d661176 100644
--- a/test/rt/source/test/test_root.h
+++ b/test/rt/source/test/rt_test_root.h
@@ -15,26 +15,26 @@
*/
/**
- * @file test_root.h
+ * @file rt_test_root.h
* @brief Test Suite root structures header.
*/
-#ifndef TEST_ROOT_H
-#define TEST_ROOT_H
-
-#include "test_sequence_001.h"
-#include "test_sequence_002.h"
-#include "test_sequence_003.h"
-#include "test_sequence_004.h"
-#include "test_sequence_005.h"
-#include "test_sequence_006.h"
-#include "test_sequence_007.h"
-#include "test_sequence_008.h"
-#include "test_sequence_009.h"
-#include "test_sequence_010.h"
-#include "test_sequence_011.h"
-#include "test_sequence_012.h"
-#include "test_sequence_013.h"
+#ifndef RT_TEST_ROOT_H
+#define RT_TEST_ROOT_H
+
+#include "rt_test_sequence_001.h"
+#include "rt_test_sequence_002.h"
+#include "rt_test_sequence_003.h"
+#include "rt_test_sequence_004.h"
+#include "rt_test_sequence_005.h"
+#include "rt_test_sequence_006.h"
+#include "rt_test_sequence_007.h"
+#include "rt_test_sequence_008.h"
+#include "rt_test_sequence_009.h"
+#include "rt_test_sequence_010.h"
+#include "rt_test_sequence_011.h"
+#include "rt_test_sequence_012.h"
+#include "rt_test_sequence_013.h"
#if !defined(__DOXYGEN__)
@@ -42,7 +42,7 @@
/* External declarations. */
/*===========================================================================*/
-extern const testcase_t * const *test_suite[];
+extern const testcase_t * const *rt_test_suite[];
#ifdef __cplusplus
extern "C" {
@@ -60,7 +60,7 @@ extern "C" {
/*
* Allowed delay in timeout checks.
*/
-#define ALLOWED_DELAY MS2ST(2)
+#define ALLOWED_DELAY TIME_MS2I(2)
/*
* Maximum number of test threads.
@@ -99,4 +99,4 @@ systime_t test_wait_tick(void);
#endif /* !defined(__DOXYGEN__) */
-#endif /* TEST_ROOT_H */
+#endif /* RT_TEST_ROOT_H */
diff --git a/test/rt/source/test/test_sequence_001.c b/test/rt/source/test/rt_test_sequence_001.c
index ce1396823..1db1b491e 100644
--- a/test/rt/source/test/test_sequence_001.c
+++ b/test/rt/source/test/rt_test_sequence_001.c
@@ -16,23 +16,23 @@
#include "hal.h"
#include "ch_test.h"
-#include "test_root.h"
+#include "rt_test_root.h"
/**
- * @file test_sequence_001.c
+ * @file rt_test_sequence_001.c
* @brief Test Sequence 001 code.
*
- * @page test_sequence_001 [1] Information
+ * @page rt_test_sequence_001 [1] Information
*
- * File: @ref test_sequence_001.c
+ * File: @ref rt_test_sequence_001.c
*
* <h2>Description</h2>
* This sequence reports configuration and version information about
* the RT kernel.
*
* <h2>Test Cases</h2>
- * - @subpage test_001_001
- * - @subpage test_001_002
+ * - @subpage rt_test_001_001
+ * - @subpage rt_test_001_002
* .
*/
@@ -47,7 +47,7 @@
****************************************************************************/
/**
- * @page test_001_001 [1.1] Kernel Info
+ * @page rt_test_001_001 [1.1] Kernel Info
*
* <h2>Description</h2>
* The version numbers are reported.
@@ -57,7 +57,7 @@
* .
*/
-static void test_001_001_execute(void) {
+static void rt_test_001_001_execute(void) {
/* [1.1.1] Prints the version string.*/
test_set_step(1);
@@ -80,15 +80,15 @@ static void test_001_001_execute(void) {
}
}
-static const testcase_t test_001_001 = {
+static const testcase_t rt_test_001_001 = {
"Kernel Info",
NULL,
NULL,
- test_001_001_execute
+ rt_test_001_001_execute
};
/**
- * @page test_001_002 [1.2] Kernel Settings
+ * @page rt_test_001_002 [1.2] Kernel Settings
*
* <h2>Description</h2>
* The static kernel settings are reported.
@@ -98,7 +98,7 @@ static const testcase_t test_001_001 = {
* .
*/
-static void test_001_002_execute(void) {
+static void rt_test_001_002_execute(void) {
/* [1.2.1] Prints the configuration options settings.*/
test_set_step(1);
@@ -208,11 +208,11 @@ static void test_001_002_execute(void) {
}
}
-static const testcase_t test_001_002 = {
+static const testcase_t rt_test_001_002 = {
"Kernel Settings",
NULL,
NULL,
- test_001_002_execute
+ rt_test_001_002_execute
};
/****************************************************************************
@@ -222,8 +222,8 @@ static const testcase_t test_001_002 = {
/**
* @brief Information.
*/
-const testcase_t * const test_sequence_001[] = {
- &test_001_001,
- &test_001_002,
+const testcase_t * const rt_test_sequence_001[] = {
+ &rt_test_001_001,
+ &rt_test_001_002,
NULL
};
diff --git a/test/rt/source/test/test_sequence_001.h b/test/rt/source/test/rt_test_sequence_001.h
index 9684d47f6..b760bda6c 100644
--- a/test/rt/source/test/test_sequence_001.h
+++ b/test/rt/source/test/rt_test_sequence_001.h
@@ -15,13 +15,13 @@
*/
/**
- * @file test_sequence_001.h
+ * @file rt_test_sequence_001.h
* @brief Test Sequence 001 header.
*/
-#ifndef TEST_SEQUENCE_001_H
-#define TEST_SEQUENCE_001_H
+#ifndef RT_TEST_SEQUENCE_001_H
+#define RT_TEST_SEQUENCE_001_H
-extern const testcase_t * const test_sequence_001[];
+extern const testcase_t * const rt_test_sequence_001[];
-#endif /* TEST_SEQUENCE_001_H */
+#endif /* RT_TEST_SEQUENCE_001_H */
diff --git a/test/rt/source/test/test_sequence_002.c b/test/rt/source/test/rt_test_sequence_002.c
index 7f3afc82f..9d82e6a48 100644
--- a/test/rt/source/test/test_sequence_002.c
+++ b/test/rt/source/test/rt_test_sequence_002.c
@@ -16,15 +16,15 @@
#include "hal.h"
#include "ch_test.h"
-#include "test_root.h"
+#include "rt_test_root.h"
/**
- * @file test_sequence_002.c
+ * @file rt_test_sequence_002.c
* @brief Test Sequence 002 code.
*
- * @page test_sequence_002 [2] System layer and port interface
+ * @page rt_test_sequence_002 [2] System layer and port interface
*
- * File: @ref test_sequence_002.c
+ * File: @ref rt_test_sequence_002.c
*
* <h2>Description</h2>
* The functionality of the system layer and port interface is tested.
@@ -34,10 +34,10 @@
* (CH_DBG_STATE_CHECKER=TRUE).
*
* <h2>Test Cases</h2>
- * - @subpage test_002_001
- * - @subpage test_002_002
- * - @subpage test_002_003
- * - @subpage test_002_004
+ * - @subpage rt_test_002_001
+ * - @subpage rt_test_002_002
+ * - @subpage rt_test_002_003
+ * - @subpage rt_test_002_004
* .
*/
@@ -67,7 +67,7 @@ static void vtcb(void *p) {
****************************************************************************/
/**
- * @page test_002_001 [2.1] System integrity functionality
+ * @page rt_test_002_001 [2.1] System integrity functionality
*
* <h2>Description</h2>
* The system self-test functionality is invoked in order to make an
@@ -81,7 +81,7 @@ static void vtcb(void *p) {
* .
*/
-static void test_002_001_execute(void) {
+static void rt_test_002_001_execute(void) {
bool result;
/* [2.1.1] Testing Ready List integrity.*/
@@ -121,15 +121,15 @@ static void test_002_001_execute(void) {
}
}
-static const testcase_t test_002_001 = {
+static const testcase_t rt_test_002_001 = {
"System integrity functionality",
NULL,
NULL,
- test_002_001_execute
+ rt_test_002_001_execute
};
/**
- * @page test_002_002 [2.2] Critical zones functionality
+ * @page rt_test_002_002 [2.2] Critical zones functionality
*
* <h2>Description</h2>
* The critical zones API is invoked for coverage.
@@ -145,7 +145,7 @@ static const testcase_t test_002_001 = {
* .
*/
-static void test_002_002_execute(void) {
+static void rt_test_002_002_execute(void) {
syssts_t sts;
virtual_timer_t vt;
@@ -194,15 +194,15 @@ static void test_002_002_execute(void) {
}
}
-static const testcase_t test_002_002 = {
+static const testcase_t rt_test_002_002 = {
"Critical zones functionality",
NULL,
NULL,
- test_002_002_execute
+ rt_test_002_002_execute
};
/**
- * @page test_002_003 [2.3] Interrupts handling functionality
+ * @page rt_test_002_003 [2.3] Interrupts handling functionality
*
* <h2>Description</h2>
* The interrupts handling API is invoked for coverage.
@@ -212,7 +212,7 @@ static const testcase_t test_002_002 = {
* .
*/
-static void test_002_003_execute(void) {
+static void rt_test_002_003_execute(void) {
/* [2.3.1] Testing chSysSuspend(), chSysDisable() and
chSysEnable().*/
@@ -225,15 +225,15 @@ static void test_002_003_execute(void) {
}
}
-static const testcase_t test_002_003 = {
+static const testcase_t rt_test_002_003 = {
"Interrupts handling functionality",
NULL,
NULL,
- test_002_003_execute
+ rt_test_002_003_execute
};
/**
- * @page test_002_004 [2.4] System Tick Counter functionality
+ * @page rt_test_002_004 [2.4] System Tick Counter functionality
*
* <h2>Description</h2>
* The functionality of the API @p chVTGetSystemTimeX() is tested.
@@ -244,7 +244,7 @@ static const testcase_t test_002_003 = {
* .
*/
-static void test_002_004_execute(void) {
+static void rt_test_002_004_execute(void) {
/* [2.4.1] A System Tick Counter increment is expected, the test
simply hangs if it does not happen.*/
@@ -259,11 +259,11 @@ static void test_002_004_execute(void) {
}
}
-static const testcase_t test_002_004 = {
+static const testcase_t rt_test_002_004 = {
"System Tick Counter functionality",
NULL,
NULL,
- test_002_004_execute
+ rt_test_002_004_execute
};
/****************************************************************************
@@ -273,10 +273,10 @@ static const testcase_t test_002_004 = {
/**
* @brief System layer and port interface.
*/
-const testcase_t * const test_sequence_002[] = {
- &test_002_001,
- &test_002_002,
- &test_002_003,
- &test_002_004,
+const testcase_t * const rt_test_sequence_002[] = {
+ &rt_test_002_001,
+ &rt_test_002_002,
+ &rt_test_002_003,
+ &rt_test_002_004,
NULL
};
diff --git a/test/rt/source/test/test_sequence_002.h b/test/rt/source/test/rt_test_sequence_002.h
index 190f9ca46..8575165c3 100644
--- a/test/rt/source/test/test_sequence_002.h
+++ b/test/rt/source/test/rt_test_sequence_002.h
@@ -15,13 +15,13 @@
*/
/**
- * @file test_sequence_002.h
+ * @file rt_test_sequence_002.h
* @brief Test Sequence 002 header.
*/
-#ifndef TEST_SEQUENCE_002_H
-#define TEST_SEQUENCE_002_H
+#ifndef RT_TEST_SEQUENCE_002_H
+#define RT_TEST_SEQUENCE_002_H
-extern const testcase_t * const test_sequence_002[];
+extern const testcase_t * const rt_test_sequence_002[];
-#endif /* TEST_SEQUENCE_002_H */
+#endif /* RT_TEST_SEQUENCE_002_H */
diff --git a/test/rt/source/test/test_sequence_003.c b/test/rt/source/test/rt_test_sequence_003.c
index b081f24a9..b481e68c6 100644
--- a/test/rt/source/test/test_sequence_003.c
+++ b/test/rt/source/test/rt_test_sequence_003.c
@@ -16,25 +16,25 @@
#include "hal.h"
#include "ch_test.h"
-#include "test_root.h"
+#include "rt_test_root.h"
/**
- * @file test_sequence_003.c
+ * @file rt_test_sequence_003.c
* @brief Test Sequence 003 code.
*
- * @page test_sequence_003 [3] Threads Functionality
+ * @page rt_test_sequence_003 [3] Threads Functionality
*
- * File: @ref test_sequence_003.c
+ * File: @ref rt_test_sequence_003.c
*
* <h2>Description</h2>
* This sequence tests the ChibiOS/RT functionalities related to
* threading.
*
* <h2>Test Cases</h2>
- * - @subpage test_003_001
- * - @subpage test_003_002
- * - @subpage test_003_003
- * - @subpage test_003_004
+ * - @subpage rt_test_003_001
+ * - @subpage rt_test_003_002
+ * - @subpage rt_test_003_003
+ * - @subpage rt_test_003_004
* .
*/
@@ -52,7 +52,7 @@ static THD_FUNCTION(thread, p) {
****************************************************************************/
/**
- * @page test_003_001 [3.1] Thread Sleep functionality
+ * @page rt_test_003_001 [3.1] Thread Sleep functionality
*
* <h2>Description</h2>
* The functionality of @p chThdSleep() and derivatives is tested.
@@ -74,7 +74,7 @@ static THD_FUNCTION(thread, p) {
* .
*/
-static void test_003_001_execute(void) {
+static void rt_test_003_001_execute(void) {
systime_t time;
/* [3.1.1] The current system time is read then a sleep is performed
@@ -96,8 +96,8 @@ static void test_003_001_execute(void) {
{
time = chVTGetSystemTimeX();
chThdSleepMicroseconds(100000);
- test_assert_time_window(time + US2ST(100000),
- time + US2ST(100000) + CH_CFG_ST_TIMEDELTA + 1,
+ test_assert_time_window(time + TIME_US2I(100000),
+ time + TIME_US2I(100000) + CH_CFG_ST_TIMEDELTA + 1,
"out of time window");
}
@@ -108,8 +108,8 @@ static void test_003_001_execute(void) {
{
time = chVTGetSystemTimeX();
chThdSleepMilliseconds(100);
- test_assert_time_window(time + MS2ST(100),
- time + MS2ST(100) + CH_CFG_ST_TIMEDELTA + 1,
+ test_assert_time_window(time + TIME_MS2I(100),
+ time + TIME_MS2I(100) + CH_CFG_ST_TIMEDELTA + 1,
"out of time window");
}
@@ -119,8 +119,8 @@ static void test_003_001_execute(void) {
{
time = chVTGetSystemTimeX();
chThdSleepSeconds(1);
- test_assert_time_window(time + S2ST(1),
- time + S2ST(1) + CH_CFG_ST_TIMEDELTA + 1,
+ test_assert_time_window(time + TIME_S2I(1),
+ time + TIME_S2I(1) + CH_CFG_ST_TIMEDELTA + 1,
"out of time window");
}
@@ -136,15 +136,15 @@ static void test_003_001_execute(void) {
}
}
-static const testcase_t test_003_001 = {
+static const testcase_t rt_test_003_001 = {
"Thread Sleep functionality",
NULL,
NULL,
- test_003_001_execute
+ rt_test_003_001_execute
};
/**
- * @page test_003_002 [3.2] Ready List functionality, threads priority order
+ * @page rt_test_003_002 [3.2] Ready List functionality, threads priority order
*
* <h2>Description</h2>
* Five threads, are enqueued in the ready list and atomically
@@ -161,7 +161,7 @@ static const testcase_t test_003_001 = {
* .
*/
-static void test_003_002_execute(void) {
+static void rt_test_003_002_execute(void) {
/* [3.2.1] Creating 5 threads with increasing priority, execution
sequence is tested.*/
@@ -203,15 +203,15 @@ static void test_003_002_execute(void) {
}
}
-static const testcase_t test_003_002 = {
+static const testcase_t rt_test_003_002 = {
"Ready List functionality, threads priority order",
NULL,
NULL,
- test_003_002_execute
+ rt_test_003_002_execute
};
/**
- * @page test_003_003 [3.3] Priority change test
+ * @page rt_test_003_003 [3.3] Priority change test
*
* <h2>Description</h2>
* A series of priority changes are performed on the current thread in
@@ -225,7 +225,7 @@ static const testcase_t test_003_002 = {
* .
*/
-static void test_003_003_execute(void) {
+static void rt_test_003_003_execute(void) {
tprio_t prio, p1;
/* [3.3.1] Thread priority is increased by one then a check is
@@ -248,16 +248,16 @@ static void test_003_003_execute(void) {
}
}
-static const testcase_t test_003_003 = {
+static const testcase_t rt_test_003_003 = {
"Priority change test",
NULL,
NULL,
- test_003_003_execute
+ rt_test_003_003_execute
};
#if (CH_CFG_USE_MUTEXES) || defined(__DOXYGEN__)
/**
- * @page test_003_004 [3.4] Priority change test with Priority Inheritance
+ * @page rt_test_003_004 [3.4] Priority change test with Priority Inheritance
*
* <h2>Description</h2>
* A series of priority changes are performed on the current thread in
@@ -278,7 +278,7 @@ static const testcase_t test_003_003 = {
* .
*/
-static void test_003_004_execute(void) {
+static void rt_test_003_004_execute(void) {
tprio_t prio, p1;
/* [3.4.1] Simulating a priority boost situation (prio > realprio).*/
@@ -318,11 +318,11 @@ static void test_003_004_execute(void) {
}
}
-static const testcase_t test_003_004 = {
+static const testcase_t rt_test_003_004 = {
"Priority change test with Priority Inheritance",
NULL,
NULL,
- test_003_004_execute
+ rt_test_003_004_execute
};
#endif /* CH_CFG_USE_MUTEXES */
@@ -333,12 +333,12 @@ static const testcase_t test_003_004 = {
/**
* @brief Threads Functionality.
*/
-const testcase_t * const test_sequence_003[] = {
- &test_003_001,
- &test_003_002,
- &test_003_003,
+const testcase_t * const rt_test_sequence_003[] = {
+ &rt_test_003_001,
+ &rt_test_003_002,
+ &rt_test_003_003,
#if (CH_CFG_USE_MUTEXES) || defined(__DOXYGEN__)
- &test_003_004,
+ &rt_test_003_004,
#endif
NULL
};
diff --git a/test/rt/source/test/test_sequence_003.h b/test/rt/source/test/rt_test_sequence_003.h
index 2de592a2f..ac7917de2 100644
--- a/test/rt/source/test/test_sequence_003.h
+++ b/test/rt/source/test/rt_test_sequence_003.h
@@ -15,13 +15,13 @@
*/
/**
- * @file test_sequence_003.h
+ * @file rt_test_sequence_003.h
* @brief Test Sequence 003 header.
*/
-#ifndef TEST_SEQUENCE_003_H
-#define TEST_SEQUENCE_003_H
+#ifndef RT_TEST_SEQUENCE_003_H
+#define RT_TEST_SEQUENCE_003_H
-extern const testcase_t * const test_sequence_003[];
+extern const testcase_t * const rt_test_sequence_003[];
-#endif /* TEST_SEQUENCE_003_H */
+#endif /* RT_TEST_SEQUENCE_003_H */
diff --git a/test/rt/source/test/test_sequence_004.c b/test/rt/source/test/rt_test_sequence_004.c
index 75b927a80..0b1e8646a 100644
--- a/test/rt/source/test/test_sequence_004.c
+++ b/test/rt/source/test/rt_test_sequence_004.c
@@ -16,22 +16,22 @@
#include "hal.h"
#include "ch_test.h"
-#include "test_root.h"
+#include "rt_test_root.h"
/**
- * @file test_sequence_004.c
+ * @file rt_test_sequence_004.c
* @brief Test Sequence 004 code.
*
- * @page test_sequence_004 [4] Suspend/Resume
+ * @page rt_test_sequence_004 [4] Suspend/Resume
*
- * File: @ref test_sequence_004.c
+ * File: @ref rt_test_sequence_004.c
*
* <h2>Description</h2>
* This sequence tests the ChibiOS/RT functionalities related to
* threads suspend/resume.
*
* <h2>Test Cases</h2>
- * - @subpage test_004_001
+ * - @subpage rt_test_004_001
* .
*/
@@ -55,7 +55,7 @@ static THD_FUNCTION(thread1, p) {
****************************************************************************/
/**
- * @page test_004_001 [4.1] Suspend and Resume functionality
+ * @page rt_test_004_001 [4.1] Suspend and Resume functionality
*
* <h2>Description</h2>
* The functionality of chThdSuspendTimeoutS() and chThdResumeI() is
@@ -71,11 +71,11 @@ static THD_FUNCTION(thread1, p) {
* .
*/
-static void test_004_001_setup(void) {
+static void rt_test_004_001_setup(void) {
tr1 = NULL;
}
-static void test_004_001_execute(void) {
+static void rt_test_004_001_execute(void) {
systime_t time;
msg_t msg;
@@ -100,21 +100,21 @@ static void test_004_001_execute(void) {
{
chSysLock();
time = chVTGetSystemTimeX();
- msg = chThdSuspendTimeoutS(&tr1, MS2ST(1000));
+ msg = chThdSuspendTimeoutS(&tr1, TIME_MS2I(1000));
chSysUnlock();
- test_assert_time_window(time + MS2ST(1000),
- time + MS2ST(1000) + CH_CFG_ST_TIMEDELTA + 1,
+ test_assert_time_window(time + TIME_MS2I(1000),
+ time + TIME_MS2I(1000) + CH_CFG_ST_TIMEDELTA + 1,
"out of time window");
test_assert(NULL == tr1, "not NULL");
test_assert(MSG_TIMEOUT == msg, "wrong returned message");
}
}
-static const testcase_t test_004_001 = {
+static const testcase_t rt_test_004_001 = {
"Suspend and Resume functionality",
- test_004_001_setup,
+ rt_test_004_001_setup,
NULL,
- test_004_001_execute
+ rt_test_004_001_execute
};
/****************************************************************************
@@ -124,7 +124,7 @@ static const testcase_t test_004_001 = {
/**
* @brief Suspend/Resume.
*/
-const testcase_t * const test_sequence_004[] = {
- &test_004_001,
+const testcase_t * const rt_test_sequence_004[] = {
+ &rt_test_004_001,
NULL
};
diff --git a/test/rt/source/test/test_sequence_004.h b/test/rt/source/test/rt_test_sequence_004.h
index 19d8c1bd7..30cb4aa6b 100644
--- a/test/rt/source/test/test_sequence_004.h
+++ b/test/rt/source/test/rt_test_sequence_004.h
@@ -15,13 +15,13 @@
*/
/**
- * @file test_sequence_004.h
+ * @file rt_test_sequence_004.h
* @brief Test Sequence 004 header.
*/
-#ifndef TEST_SEQUENCE_004_H
-#define TEST_SEQUENCE_004_H
+#ifndef RT_TEST_SEQUENCE_004_H
+#define RT_TEST_SEQUENCE_004_H
-extern const testcase_t * const test_sequence_004[];
+extern const testcase_t * const rt_test_sequence_004[];
-#endif /* TEST_SEQUENCE_004_H */
+#endif /* RT_TEST_SEQUENCE_004_H */
diff --git a/test/rt/source/test/test_sequence_005.c b/test/rt/source/test/rt_test_sequence_005.c
index 91579d0d4..5005e1fc2 100644
--- a/test/rt/source/test/test_sequence_005.c
+++ b/test/rt/source/test/rt_test_sequence_005.c
@@ -16,15 +16,15 @@
#include "hal.h"
#include "ch_test.h"
-#include "test_root.h"
+#include "rt_test_root.h"
/**
- * @file test_sequence_005.c
+ * @file rt_test_sequence_005.c
* @brief Test Sequence 005 code.
*
- * @page test_sequence_005 [5] Counter and Binary Semaphores
+ * @page rt_test_sequence_005 [5] Counter and Binary Semaphores
*
- * File: @ref test_sequence_005.c
+ * File: @ref rt_test_sequence_005.c
*
* <h2>Description</h2>
* This sequence tests the ChibiOS/RT functionalities related to
@@ -37,12 +37,12 @@
* .
*
* <h2>Test Cases</h2>
- * - @subpage test_005_001
- * - @subpage test_005_002
- * - @subpage test_005_003
- * - @subpage test_005_004
- * - @subpage test_005_005
- * - @subpage test_005_006
+ * - @subpage rt_test_005_001
+ * - @subpage rt_test_005_002
+ * - @subpage rt_test_005_003
+ * - @subpage rt_test_005_004
+ * - @subpage rt_test_005_005
+ * - @subpage rt_test_005_006
* .
*/
@@ -89,7 +89,7 @@ static THD_FUNCTION(thread4, p) {
****************************************************************************/
/**
- * @page test_005_001 [5.1] Semaphore primitives, no state change
+ * @page rt_test_005_001 [5.1] Semaphore primitives, no state change
*
* <h2>Description</h2>
* Wait, Signal and Reset primitives are tested. The testing thread
@@ -105,15 +105,15 @@ static THD_FUNCTION(thread4, p) {
* .
*/
-static void test_005_001_setup(void) {
+static void rt_test_005_001_setup(void) {
chSemObjectInit(&sem1, 1);
}
-static void test_005_001_teardown(void) {
+static void rt_test_005_001_teardown(void) {
chSemReset(&sem1, 0);
}
-static void test_005_001_execute(void) {
+static void rt_test_005_001_execute(void) {
/* [5.1.1] The function chSemWait() is invoked, after return the
counter and the returned message are tested.*/
@@ -143,15 +143,15 @@ static void test_005_001_execute(void) {
}
}
-static const testcase_t test_005_001 = {
+static const testcase_t rt_test_005_001 = {
"Semaphore primitives, no state change",
- test_005_001_setup,
- test_005_001_teardown,
- test_005_001_execute
+ rt_test_005_001_setup,
+ rt_test_005_001_teardown,
+ rt_test_005_001_execute
};
/**
- * @page test_005_002 [5.2] Semaphore enqueuing test
+ * @page rt_test_005_002 [5.2] Semaphore enqueuing test
*
* <h2>Description</h2>
* Five threads with randomized priorities are enqueued to a semaphore
@@ -168,11 +168,11 @@ static const testcase_t test_005_001 = {
* .
*/
-static void test_005_002_setup(void) {
+static void rt_test_005_002_setup(void) {
chSemObjectInit(&sem1, 0);
}
-static void test_005_002_execute(void) {
+static void rt_test_005_002_execute(void) {
/* [5.2.1] Five threads are created with mixed priority levels (not
increasing nor decreasing). Threads enqueue on a semaphore
@@ -204,15 +204,15 @@ static void test_005_002_execute(void) {
}
}
-static const testcase_t test_005_002 = {
+static const testcase_t rt_test_005_002 = {
"Semaphore enqueuing test",
- test_005_002_setup,
+ rt_test_005_002_setup,
NULL,
- test_005_002_execute
+ rt_test_005_002_execute
};
/**
- * @page test_005_003 [5.3] Semaphore timeout test
+ * @page rt_test_005_003 [5.3] Semaphore timeout test
*
* <h2>Description</h2>
* The three possible semaphore waiting modes (do not wait, wait with
@@ -228,11 +228,11 @@ static const testcase_t test_005_002 = {
* .
*/
-static void test_005_003_setup(void) {
+static void rt_test_005_003_setup(void) {
chSemObjectInit(&sem1, 0);
}
-static void test_005_003_execute(void) {
+static void rt_test_005_003_execute(void) {
unsigned i;
systime_t target_time;
msg_t msg;
@@ -251,7 +251,7 @@ static void test_005_003_execute(void) {
{
threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() - 1,
thread2, 0);
- msg = chSemWaitTimeout(&sem1, MS2ST(500));
+ msg = chSemWaitTimeout(&sem1, TIME_MS2I(500));
test_wait_threads();
test_assert(msg == MSG_OK, "wrong wake-up message");
test_assert(queue_isempty(&sem1.queue), "queue not empty");
@@ -261,10 +261,10 @@ static void test_005_003_execute(void) {
/* [5.3.3] Testing timeout condition.*/
test_set_step(3);
{
- target_time = test_wait_tick() + MS2ST(5 * 50);
+ target_time = test_wait_tick() + TIME_MS2I(5 * 50);
for (i = 0; i < 5; i++) {
test_emit_token('A' + i);
- msg = chSemWaitTimeout(&sem1, MS2ST(50));
+ msg = chSemWaitTimeout(&sem1, TIME_MS2I(50));
test_assert(msg == MSG_TIMEOUT, "wrong wake-up message");
test_assert(queue_isempty(&sem1.queue), "queue not empty");
test_assert(sem1.cnt == 0, "counter not zero");
@@ -275,15 +275,15 @@ static void test_005_003_execute(void) {
}
}
-static const testcase_t test_005_003 = {
+static const testcase_t rt_test_005_003 = {
"Semaphore timeout test",
- test_005_003_setup,
+ rt_test_005_003_setup,
NULL,
- test_005_003_execute
+ rt_test_005_003_execute
};
/**
- * @page test_005_004 [5.4] Testing chSemAddCounterI() functionality
+ * @page rt_test_005_004 [5.4] Testing chSemAddCounterI() functionality
*
* <h2>Description</h2>
* The functon is tested by waking up a thread then the semaphore
@@ -296,11 +296,11 @@ static const testcase_t test_005_003 = {
* .
*/
-static void test_005_004_setup(void) {
+static void rt_test_005_004_setup(void) {
chSemObjectInit(&sem1, 0);
}
-static void test_005_004_execute(void) {
+static void rt_test_005_004_execute(void) {
/* [5.4.1] A thread is created, it goes to wait on the semaphore.*/
test_set_step(1);
@@ -322,15 +322,15 @@ static void test_005_004_execute(void) {
}
}
-static const testcase_t test_005_004 = {
+static const testcase_t rt_test_005_004 = {
"Testing chSemAddCounterI() functionality",
- test_005_004_setup,
+ rt_test_005_004_setup,
NULL,
- test_005_004_execute
+ rt_test_005_004_execute
};
/**
- * @page test_005_005 [5.5] Testing chSemWaitSignal() functionality
+ * @page rt_test_005_005 [5.5] Testing chSemWaitSignal() functionality
*
* <h2>Description</h2>
* This test case explicitly addresses the @p chSemWaitSignal()
@@ -352,15 +352,15 @@ static const testcase_t test_005_004 = {
* .
*/
-static void test_005_005_setup(void) {
+static void rt_test_005_005_setup(void) {
chSemObjectInit(&sem1, 0);
}
-static void test_005_005_teardown(void) {
+static void rt_test_005_005_teardown(void) {
test_wait_threads();
}
-static void test_005_005_execute(void) {
+static void rt_test_005_005_execute(void) {
/* [5.5.1] An higher priority thread is created that performs
non-atomical wait and signal operations on a semaphore.*/
@@ -390,15 +390,15 @@ static void test_005_005_execute(void) {
}
}
-static const testcase_t test_005_005 = {
+static const testcase_t rt_test_005_005 = {
"Testing chSemWaitSignal() functionality",
- test_005_005_setup,
- test_005_005_teardown,
- test_005_005_execute
+ rt_test_005_005_setup,
+ rt_test_005_005_teardown,
+ rt_test_005_005_execute
};
/**
- * @page test_005_006 [5.6] Testing Binary Semaphores special case
+ * @page rt_test_005_006 [5.6] Testing Binary Semaphores special case
*
* <h2>Description</h2>
* This test case tests the binary semaphores functionality. The test
@@ -421,11 +421,11 @@ static const testcase_t test_005_005 = {
* .
*/
-static void test_005_006_teardown(void) {
+static void rt_test_005_006_teardown(void) {
test_wait_threads();
}
-static void test_005_006_execute(void) {
+static void rt_test_005_006_execute(void) {
binary_semaphore_t bsem;
msg_t msg;
@@ -481,11 +481,11 @@ static void test_005_006_execute(void) {
}
}
-static const testcase_t test_005_006 = {
+static const testcase_t rt_test_005_006 = {
"Testing Binary Semaphores special case",
NULL,
- test_005_006_teardown,
- test_005_006_execute
+ rt_test_005_006_teardown,
+ rt_test_005_006_execute
};
/****************************************************************************
@@ -495,13 +495,13 @@ static const testcase_t test_005_006 = {
/**
* @brief Counter and Binary Semaphores.
*/
-const testcase_t * const test_sequence_005[] = {
- &test_005_001,
- &test_005_002,
- &test_005_003,
- &test_005_004,
- &test_005_005,
- &test_005_006,
+const testcase_t * const rt_test_sequence_005[] = {
+ &rt_test_005_001,
+ &rt_test_005_002,
+ &rt_test_005_003,
+ &rt_test_005_004,
+ &rt_test_005_005,
+ &rt_test_005_006,
NULL
};
diff --git a/test/rt/source/test/test_sequence_005.h b/test/rt/source/test/rt_test_sequence_005.h
index d2df83307..3ef60743b 100644
--- a/test/rt/source/test/test_sequence_005.h
+++ b/test/rt/source/test/rt_test_sequence_005.h
@@ -15,13 +15,13 @@
*/
/**
- * @file test_sequence_005.h
+ * @file rt_test_sequence_005.h
* @brief Test Sequence 005 header.
*/
-#ifndef TEST_SEQUENCE_005_H
-#define TEST_SEQUENCE_005_H
+#ifndef RT_TEST_SEQUENCE_005_H
+#define RT_TEST_SEQUENCE_005_H
-extern const testcase_t * const test_sequence_005[];
+extern const testcase_t * const rt_test_sequence_005[];
-#endif /* TEST_SEQUENCE_005_H */
+#endif /* RT_TEST_SEQUENCE_005_H */
diff --git a/test/rt/source/test/test_sequence_006.c b/test/rt/source/test/rt_test_sequence_006.c
index b15d61b38..7c6847b51 100644
--- a/test/rt/source/test/test_sequence_006.c
+++ b/test/rt/source/test/rt_test_sequence_006.c
@@ -16,15 +16,15 @@
#include "hal.h"
#include "ch_test.h"
-#include "test_root.h"
+#include "rt_test_root.h"
/**
- * @file test_sequence_006.c
+ * @file rt_test_sequence_006.c
* @brief Test Sequence 006 code.
*
- * @page test_sequence_006 [6] Mutexes, Condition Variables and Priority Inheritance
+ * @page rt_test_sequence_006 [6] Mutexes, Condition Variables and Priority Inheritance
*
- * File: @ref test_sequence_006.c
+ * File: @ref rt_test_sequence_006.c
*
* <h2>Description</h2>
* This sequence tests the ChibiOS/RT functionalities related to
@@ -37,15 +37,15 @@
* .
*
* <h2>Test Cases</h2>
- * - @subpage test_006_001
- * - @subpage test_006_002
- * - @subpage test_006_003
- * - @subpage test_006_004
- * - @subpage test_006_005
- * - @subpage test_006_006
- * - @subpage test_006_007
- * - @subpage test_006_008
- * - @subpage test_006_009
+ * - @subpage rt_test_006_001
+ * - @subpage rt_test_006_002
+ * - @subpage rt_test_006_003
+ * - @subpage rt_test_006_004
+ * - @subpage rt_test_006_005
+ * - @subpage rt_test_006_006
+ * - @subpage rt_test_006_007
+ * - @subpage rt_test_006_008
+ * - @subpage rt_test_006_009
* .
*/
@@ -72,7 +72,7 @@ void test_cpu_pulse(unsigned duration) {
systime_t start, end, now;
start = chThdGetTicksX(chThdGetSelfX());
- end = start + MS2ST(duration);
+ end = start + TIME_MS2I(duration);
do {
now = chThdGetTicksX(chThdGetSelfX());
#if defined(SIMULATOR)
@@ -234,7 +234,7 @@ static THD_FUNCTION(thread9, p) {
****************************************************************************/
/**
- * @page test_006_001 [6.1] Priority enqueuing test
+ * @page rt_test_006_001 [6.1] Priority enqueuing test
*
* <h2>Description</h2>
* Five threads, with increasing priority, are enqueued on a locked
@@ -253,11 +253,11 @@ static THD_FUNCTION(thread9, p) {
* .
*/
-static void test_006_001_setup(void) {
+static void rt_test_006_001_setup(void) {
chMtxObjectInit(&m1);
}
-static void test_006_001_execute(void) {
+static void rt_test_006_001_execute(void) {
tprio_t prio;
/* [6.1.1] Getting the initial priority.*/
@@ -295,16 +295,16 @@ static void test_006_001_execute(void) {
}
}
-static const testcase_t test_006_001 = {
+static const testcase_t rt_test_006_001 = {
"Priority enqueuing test",
- test_006_001_setup,
+ rt_test_006_001_setup,
NULL,
- test_006_001_execute
+ rt_test_006_001_execute
};
#if (CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__)
/**
- * @page test_006_002 [6.2] Priority inheritance, simple case
+ * @page rt_test_006_002 [6.2] Priority inheritance, simple case
*
* <h2>Description</h2>
* Three threads are involved in the classic priority inversion
@@ -330,11 +330,11 @@ static const testcase_t test_006_001 = {
* .
*/
-static void test_006_002_setup(void) {
+static void rt_test_006_002_setup(void) {
chMtxObjectInit(&m1);
}
-static void test_006_002_execute(void) {
+static void rt_test_006_002_execute(void) {
systime_t time;
/* [6.2.1] Getting the system time for test duration measurement.*/
@@ -359,22 +359,22 @@ static void test_006_002_execute(void) {
time windows (100mS...100mS+ALLOWED_DELAY).*/
test_set_step(3);
{
- test_assert_time_window(time + MS2ST(100), time + MS2ST(100) + ALLOWED_DELAY,
+ test_assert_time_window(time + TIME_MS2I(100), time + TIME_MS2I(100) + ALLOWED_DELAY,
"out of time window");
}
}
-static const testcase_t test_006_002 = {
+static const testcase_t rt_test_006_002 = {
"Priority inheritance, simple case",
- test_006_002_setup,
+ rt_test_006_002_setup,
NULL,
- test_006_002_execute
+ rt_test_006_002_execute
};
#endif /* CH_DBG_THREADS_PROFILING */
#if (CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__)
/**
- * @page test_006_003 [6.3] Priority inheritance, complex case
+ * @page rt_test_006_003 [6.3] Priority inheritance, complex case
*
* <h2>Description</h2>
* Five threads are involved in the complex priority inversion
@@ -399,12 +399,12 @@ static const testcase_t test_006_002 = {
* .
*/
-static void test_006_003_setup(void) {
+static void rt_test_006_003_setup(void) {
chMtxObjectInit(&m1); /* Mutex B.*/
chMtxObjectInit(&m2); /* Mutex A.*/
}
-static void test_006_003_execute(void) {
+static void rt_test_006_003_execute(void) {
systime_t time;
/* [6.3.1] Getting the system time for test duration measurement.*/
@@ -431,21 +431,21 @@ static void test_006_003_execute(void) {
time windows (110mS...110mS+ALLOWED_DELAY).*/
test_set_step(3);
{
- test_assert_time_window(time + MS2ST(110), time + MS2ST(110) + ALLOWED_DELAY,
+ test_assert_time_window(time + TIME_MS2I(110), time + TIME_MS2I(110) + ALLOWED_DELAY,
"out of time window");
}
}
-static const testcase_t test_006_003 = {
+static const testcase_t rt_test_006_003 = {
"Priority inheritance, complex case",
- test_006_003_setup,
+ rt_test_006_003_setup,
NULL,
- test_006_003_execute
+ rt_test_006_003_execute
};
#endif /* CH_DBG_THREADS_PROFILING */
/**
- * @page test_006_004 [6.4] Priority return verification
+ * @page rt_test_006_004 [6.4] Priority return verification
*
* <h2>Description</h2>
* Two threads are spawned that try to lock the mutexes already locked
@@ -476,16 +476,16 @@ static const testcase_t test_006_003 = {
* .
*/
-static void test_006_004_setup(void) {
+static void rt_test_006_004_setup(void) {
chMtxObjectInit(&m1);
chMtxObjectInit(&m2);
}
-static void test_006_004_teardown(void) {
+static void rt_test_006_004_teardown(void) {
test_wait_threads();
}
-static void test_006_004_execute(void) {
+static void rt_test_006_004_execute(void) {
tprio_t p, pa, pb;
/* [6.4.1] Getting current thread priority P(0) and assigning to the
@@ -555,16 +555,16 @@ static void test_006_004_execute(void) {
}
}
-static const testcase_t test_006_004 = {
+static const testcase_t rt_test_006_004 = {
"Priority return verification",
- test_006_004_setup,
- test_006_004_teardown,
- test_006_004_execute
+ rt_test_006_004_setup,
+ rt_test_006_004_teardown,
+ rt_test_006_004_execute
};
#if (!CH_CFG_USE_MUTEXES_RECURSIVE) || defined(__DOXYGEN__)
/**
- * @page test_006_005 [6.5] Repeated locks, non recursive scenario
+ * @page rt_test_006_005 [6.5] Repeated locks, non recursive scenario
*
* <h2>Description</h2>
* The behavior of multiple mutex locks from the same thread is tested
@@ -590,11 +590,11 @@ static const testcase_t test_006_004 = {
* .
*/
-static void test_006_005_setup(void) {
+static void rt_test_006_005_setup(void) {
chMtxObjectInit(&m1);
}
-static void test_006_005_execute(void) {
+static void rt_test_006_005_execute(void) {
bool b;
tprio_t prio;
@@ -655,17 +655,17 @@ static void test_006_005_execute(void) {
}
}
-static const testcase_t test_006_005 = {
+static const testcase_t rt_test_006_005 = {
"Repeated locks, non recursive scenario",
- test_006_005_setup,
+ rt_test_006_005_setup,
NULL,
- test_006_005_execute
+ rt_test_006_005_execute
};
#endif /* !CH_CFG_USE_MUTEXES_RECURSIVE */
#if (CH_CFG_USE_MUTEXES_RECURSIVE) || defined(__DOXYGEN__)
/**
- * @page test_006_006 [6.6] Repeated locks using, recursive scenario
+ * @page rt_test_006_006 [6.6] Repeated locks using, recursive scenario
*
* <h2>Description</h2>
* The behavior of multiple mutex locks from the same thread is tested
@@ -696,11 +696,11 @@ static const testcase_t test_006_005 = {
* .
*/
-static void test_006_006_setup(void) {
+static void rt_test_006_006_setup(void) {
chMtxObjectInit(&m1);
}
-static void test_006_006_execute(void) {
+static void rt_test_006_006_execute(void) {
bool b;
tprio_t prio;
@@ -792,17 +792,17 @@ static void test_006_006_execute(void) {
}
}
-static const testcase_t test_006_006 = {
+static const testcase_t rt_test_006_006 = {
"Repeated locks using, recursive scenario",
- test_006_006_setup,
+ rt_test_006_006_setup,
NULL,
- test_006_006_execute
+ rt_test_006_006_execute
};
#endif /* CH_CFG_USE_MUTEXES_RECURSIVE */
#if (CH_CFG_USE_CONDVARS) || defined(__DOXYGEN__)
/**
- * @page test_006_007 [6.7] Condition Variable signal test
+ * @page rt_test_006_007 [6.7] Condition Variable signal test
*
* <h2>Description</h2>
* Five threads take a mutex and then enter a conditional variable
@@ -826,12 +826,12 @@ static const testcase_t test_006_006 = {
* .
*/
-static void test_006_007_setup(void) {
+static void rt_test_006_007_setup(void) {
chCondObjectInit(&c1);
chMtxObjectInit(&m1);
}
-static void test_006_007_execute(void) {
+static void rt_test_006_007_execute(void) {
/* [6.7.1] Starting the five threads with increasing priority, the
threads will queue on the condition variable.*/
@@ -863,17 +863,17 @@ static void test_006_007_execute(void) {
}
}
-static const testcase_t test_006_007 = {
+static const testcase_t rt_test_006_007 = {
"Condition Variable signal test",
- test_006_007_setup,
+ rt_test_006_007_setup,
NULL,
- test_006_007_execute
+ rt_test_006_007_execute
};
#endif /* CH_CFG_USE_CONDVARS */
#if (CH_CFG_USE_CONDVARS) || defined(__DOXYGEN__)
/**
- * @page test_006_008 [6.8] Condition Variable broadcast test
+ * @page rt_test_006_008 [6.8] Condition Variable broadcast test
*
* <h2>Description</h2>
* Five threads take a mutex and then enter a conditional variable
@@ -895,12 +895,12 @@ static const testcase_t test_006_007 = {
* .
*/
-static void test_006_008_setup(void) {
+static void rt_test_006_008_setup(void) {
chCondObjectInit(&c1);
chMtxObjectInit(&m1);
}
-static void test_006_008_execute(void) {
+static void rt_test_006_008_execute(void) {
/* [6.8.1] Starting the five threads with increasing priority, the
threads will queue on the condition variable.*/
@@ -924,17 +924,17 @@ static void test_006_008_execute(void) {
}
}
-static const testcase_t test_006_008 = {
+static const testcase_t rt_test_006_008 = {
"Condition Variable broadcast test",
- test_006_008_setup,
+ rt_test_006_008_setup,
NULL,
- test_006_008_execute
+ rt_test_006_008_execute
};
#endif /* CH_CFG_USE_CONDVARS */
#if (CH_CFG_USE_CONDVARS) || defined(__DOXYGEN__)
/**
- * @page test_006_009 [6.9] Condition Variable priority boost test
+ * @page rt_test_006_009 [6.9] Condition Variable priority boost test
*
* <h2>Description</h2>
* This test case verifies the priority boost of a thread waiting on a
@@ -966,13 +966,13 @@ static const testcase_t test_006_008 = {
* .
*/
-static void test_006_009_setup(void) {
+static void rt_test_006_009_setup(void) {
chCondObjectInit(&c1);
chMtxObjectInit(&m1);
chMtxObjectInit(&m2);
}
-static void test_006_009_execute(void) {
+static void rt_test_006_009_execute(void) {
tprio_t prio;
/* [6.9.1] Reading current base priority.*/
@@ -1024,11 +1024,11 @@ static void test_006_009_execute(void) {
}
}
-static const testcase_t test_006_009 = {
+static const testcase_t rt_test_006_009 = {
"Condition Variable priority boost test",
- test_006_009_setup,
+ rt_test_006_009_setup,
NULL,
- test_006_009_execute
+ rt_test_006_009_execute
};
#endif /* CH_CFG_USE_CONDVARS */
@@ -1039,29 +1039,29 @@ static const testcase_t test_006_009 = {
/**
* @brief Mutexes, Condition Variables and Priority Inheritance.
*/
-const testcase_t * const test_sequence_006[] = {
- &test_006_001,
+const testcase_t * const rt_test_sequence_006[] = {
+ &rt_test_006_001,
#if (CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__)
- &test_006_002,
+ &rt_test_006_002,
#endif
#if (CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__)
- &test_006_003,
+ &rt_test_006_003,
#endif
- &test_006_004,
+ &rt_test_006_004,
#if (!CH_CFG_USE_MUTEXES_RECURSIVE) || defined(__DOXYGEN__)
- &test_006_005,
+ &rt_test_006_005,
#endif
#if (CH_CFG_USE_MUTEXES_RECURSIVE) || defined(__DOXYGEN__)
- &test_006_006,
+ &rt_test_006_006,
#endif
#if (CH_CFG_USE_CONDVARS) || defined(__DOXYGEN__)
- &test_006_007,
+ &rt_test_006_007,
#endif
#if (CH_CFG_USE_CONDVARS) || defined(__DOXYGEN__)
- &test_006_008,
+ &rt_test_006_008,
#endif
#if (CH_CFG_USE_CONDVARS) || defined(__DOXYGEN__)
- &test_006_009,
+ &rt_test_006_009,
#endif
NULL
};
diff --git a/test/rt/source/test/test_sequence_006.h b/test/rt/source/test/rt_test_sequence_006.h
index 959689dc1..1e6fc5f1c 100644
--- a/test/rt/source/test/test_sequence_006.h
+++ b/test/rt/source/test/rt_test_sequence_006.h
@@ -15,13 +15,13 @@
*/
/**
- * @file test_sequence_006.h
+ * @file rt_test_sequence_006.h
* @brief Test Sequence 006 header.
*/
-#ifndef TEST_SEQUENCE_006_H
-#define TEST_SEQUENCE_006_H
+#ifndef RT_TEST_SEQUENCE_006_H
+#define RT_TEST_SEQUENCE_006_H
-extern const testcase_t * const test_sequence_006[];
+extern const testcase_t * const rt_test_sequence_006[];
-#endif /* TEST_SEQUENCE_006_H */
+#endif /* RT_TEST_SEQUENCE_006_H */
diff --git a/test/rt/source/test/test_sequence_007.c b/test/rt/source/test/rt_test_sequence_007.c
index e472cac4e..8344eb220 100644
--- a/test/rt/source/test/test_sequence_007.c
+++ b/test/rt/source/test/rt_test_sequence_007.c
@@ -16,15 +16,15 @@
#include "hal.h"
#include "ch_test.h"
-#include "test_root.h"
+#include "rt_test_root.h"
/**
- * @file test_sequence_007.c
+ * @file rt_test_sequence_007.c
* @brief Test Sequence 007 code.
*
- * @page test_sequence_007 [7] Synchronous Messages
+ * @page rt_test_sequence_007 [7] Synchronous Messages
*
- * File: @ref test_sequence_007.c
+ * File: @ref rt_test_sequence_007.c
*
* <h2>Description</h2>
* This module implements the test sequence for the Synchronous
@@ -37,7 +37,7 @@
* .
*
* <h2>Test Cases</h2>
- * - @subpage test_007_001
+ * - @subpage rt_test_007_001
* .
*/
@@ -60,7 +60,7 @@ static THD_FUNCTION(msg_thread1, p) {
****************************************************************************/
/**
- * @page test_007_001 [7.1] Messages Server loop
+ * @page rt_test_007_001 [7.1] Messages Server loop
*
* <h2>Description</h2>
* A messenger thread is spawned that sends four messages back to the
@@ -73,7 +73,7 @@ static THD_FUNCTION(msg_thread1, p) {
* .
*/
-static void test_007_001_execute(void) {
+static void rt_test_007_001_execute(void) {
thread_t *tp;
msg_t msg;
@@ -101,11 +101,11 @@ static void test_007_001_execute(void) {
}
}
-static const testcase_t test_007_001 = {
+static const testcase_t rt_test_007_001 = {
"Messages Server loop",
NULL,
NULL,
- test_007_001_execute
+ rt_test_007_001_execute
};
/****************************************************************************
@@ -115,8 +115,8 @@ static const testcase_t test_007_001 = {
/**
* @brief Synchronous Messages.
*/
-const testcase_t * const test_sequence_007[] = {
- &test_007_001,
+const testcase_t * const rt_test_sequence_007[] = {
+ &rt_test_007_001,
NULL
};
diff --git a/test/rt/source/test/test_sequence_007.h b/test/rt/source/test/rt_test_sequence_007.h
index b0b926223..09022befe 100644
--- a/test/rt/source/test/test_sequence_007.h
+++ b/test/rt/source/test/rt_test_sequence_007.h
@@ -15,13 +15,13 @@
*/
/**
- * @file test_sequence_007.h
+ * @file rt_test_sequence_007.h
* @brief Test Sequence 007 header.
*/
-#ifndef TEST_SEQUENCE_007_H
-#define TEST_SEQUENCE_007_H
+#ifndef RT_TEST_SEQUENCE_007_H
+#define RT_TEST_SEQUENCE_007_H
-extern const testcase_t * const test_sequence_007[];
+extern const testcase_t * const rt_test_sequence_007[];
-#endif /* TEST_SEQUENCE_007_H */
+#endif /* RT_TEST_SEQUENCE_007_H */
diff --git a/test/rt/source/test/test_sequence_008.c b/test/rt/source/test/rt_test_sequence_008.c
index 6ae56aa7a..f66180feb 100644
--- a/test/rt/source/test/test_sequence_008.c
+++ b/test/rt/source/test/rt_test_sequence_008.c
@@ -16,15 +16,15 @@
#include "hal.h"
#include "ch_test.h"
-#include "test_root.h"
+#include "rt_test_root.h"
/**
- * @file test_sequence_008.c
+ * @file rt_test_sequence_008.c
* @brief Test Sequence 008 code.
*
- * @page test_sequence_008 [8] Event Sources and Event Flags
+ * @page rt_test_sequence_008 [8] Event Sources and Event Flags
*
- * File: @ref test_sequence_008.c
+ * File: @ref rt_test_sequence_008.c
*
* <h2>Description</h2>
* This module implements the test sequence for the Events subsystem.
@@ -36,13 +36,13 @@
* .
*
* <h2>Test Cases</h2>
- * - @subpage test_008_001
- * - @subpage test_008_002
- * - @subpage test_008_003
- * - @subpage test_008_004
- * - @subpage test_008_005
- * - @subpage test_008_006
- * - @subpage test_008_007
+ * - @subpage rt_test_008_001
+ * - @subpage rt_test_008_002
+ * - @subpage rt_test_008_003
+ * - @subpage rt_test_008_004
+ * - @subpage rt_test_008_005
+ * - @subpage rt_test_008_006
+ * - @subpage rt_test_008_007
* .
*/
@@ -79,7 +79,7 @@ static THD_FUNCTION(evt_thread7, p) {
****************************************************************************/
/**
- * @page test_008_001 [8.1] Events registration
+ * @page rt_test_008_001 [8.1] Events registration
*
* <h2>Description</h2>
* Two event listeners are registered on an event source and then
@@ -99,7 +99,7 @@ static THD_FUNCTION(evt_thread7, p) {
* .
*/
-static void test_008_001_execute(void) {
+static void rt_test_008_001_execute(void) {
event_listener_t el1, el2;
/* [8.1.1] An Event Source is initialized.*/
@@ -134,15 +134,15 @@ static void test_008_001_execute(void) {
}
}
-static const testcase_t test_008_001 = {
+static const testcase_t rt_test_008_001 = {
"Events registration",
NULL,
NULL,
- test_008_001_execute
+ rt_test_008_001_execute
};
/**
- * @page test_008_002 [8.2] Event Flags dispatching
+ * @page rt_test_008_002 [8.2] Event Flags dispatching
*
* <h2>Description</h2>
* The test dispatches three event flags and verifies that the
@@ -154,11 +154,11 @@ static const testcase_t test_008_001 = {
* .
*/
-static void test_008_002_setup(void) {
+static void rt_test_008_002_setup(void) {
chEvtGetAndClearEvents(ALL_EVENTS);
}
-static void test_008_002_execute(void) {
+static void rt_test_008_002_execute(void) {
/* [8.2.1] Three evenf flag bits are raised then chEvtDispatch() is
invoked, the sequence of handlers calls is tested.*/
@@ -169,15 +169,15 @@ static void test_008_002_execute(void) {
}
}
-static const testcase_t test_008_002 = {
+static const testcase_t rt_test_008_002 = {
"Event Flags dispatching",
- test_008_002_setup,
+ rt_test_008_002_setup,
NULL,
- test_008_002_execute
+ rt_test_008_002_execute
};
/**
- * @page test_008_003 [8.3] Events Flags wait using chEvtWaitOne()
+ * @page rt_test_008_003 [8.3] Events Flags wait using chEvtWaitOne()
*
* <h2>Description</h2>
* Functionality of chEvtWaitOne() is tested under various scenarios.
@@ -194,11 +194,11 @@ static const testcase_t test_008_002 = {
* .
*/
-static void test_008_003_setup(void) {
+static void rt_test_008_003_setup(void) {
chEvtGetAndClearEvents(ALL_EVENTS);
}
-static void test_008_003_execute(void) {
+static void rt_test_008_003_execute(void) {
eventmask_t m;
systime_t target_time;
@@ -226,7 +226,7 @@ static void test_008_003_execute(void) {
thread will set an event flag after 50mS.*/
test_set_step(3);
{
- target_time = test_wait_tick() + MS2ST(50);
+ target_time = test_wait_tick() + TIME_MS2I(50);
threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() - 1,
evt_thread3, chThdGetSelfX());
}
@@ -246,15 +246,15 @@ static void test_008_003_execute(void) {
}
}
-static const testcase_t test_008_003 = {
+static const testcase_t rt_test_008_003 = {
"Events Flags wait using chEvtWaitOne()",
- test_008_003_setup,
+ rt_test_008_003_setup,
NULL,
- test_008_003_execute
+ rt_test_008_003_execute
};
/**
- * @page test_008_004 [8.4] Events Flags wait using chEvtWaitAny()
+ * @page rt_test_008_004 [8.4] Events Flags wait using chEvtWaitAny()
*
* <h2>Description</h2>
* Functionality of chEvtWaitAny() is tested under various scenarios.
@@ -271,11 +271,11 @@ static const testcase_t test_008_003 = {
* .
*/
-static void test_008_004_setup(void) {
+static void rt_test_008_004_setup(void) {
chEvtGetAndClearEvents(ALL_EVENTS);
}
-static void test_008_004_execute(void) {
+static void rt_test_008_004_execute(void) {
eventmask_t m;
systime_t target_time;
@@ -299,7 +299,7 @@ static void test_008_004_execute(void) {
thread will set an event flag after 50mS.*/
test_set_step(3);
{
- target_time = test_wait_tick() + MS2ST(50);
+ target_time = test_wait_tick() + TIME_MS2I(50);
threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() - 1,
evt_thread3, chThdGetSelfX());
}
@@ -319,15 +319,15 @@ static void test_008_004_execute(void) {
}
}
-static const testcase_t test_008_004 = {
+static const testcase_t rt_test_008_004 = {
"Events Flags wait using chEvtWaitAny()",
- test_008_004_setup,
+ rt_test_008_004_setup,
NULL,
- test_008_004_execute
+ rt_test_008_004_execute
};
/**
- * @page test_008_005 [8.5] Events Flags wait using chEvtWaitAll()
+ * @page rt_test_008_005 [8.5] Events Flags wait using chEvtWaitAll()
*
* <h2>Description</h2>
* Functionality of chEvtWaitAll() is tested under various scenarios.
@@ -345,11 +345,11 @@ static const testcase_t test_008_004 = {
* .
*/
-static void test_008_005_setup(void) {
+static void rt_test_008_005_setup(void) {
chEvtGetAndClearEvents(ALL_EVENTS);
}
-static void test_008_005_execute(void) {
+static void rt_test_008_005_execute(void) {
eventmask_t m;
systime_t target_time;
@@ -379,7 +379,7 @@ static void test_008_005_execute(void) {
thread will set another event flag after 50mS.*/
test_set_step(4);
{
- target_time = test_wait_tick() + MS2ST(50);
+ target_time = test_wait_tick() + TIME_MS2I(50);
threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() - 1,
evt_thread3, chThdGetSelfX());
}
@@ -399,16 +399,16 @@ static void test_008_005_execute(void) {
}
}
-static const testcase_t test_008_005 = {
+static const testcase_t rt_test_008_005 = {
"Events Flags wait using chEvtWaitAll()",
- test_008_005_setup,
+ rt_test_008_005_setup,
NULL,
- test_008_005_execute
+ rt_test_008_005_execute
};
#if (CH_CFG_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__)
/**
- * @page test_008_006 [8.6] Events Flags wait timeouts
+ * @page rt_test_008_006 [8.6] Events Flags wait timeouts
*
* <h2>Description</h2>
* Timeout functionality is tested for chEvtWaitOneTimeout(),
@@ -428,11 +428,11 @@ static const testcase_t test_008_005 = {
* .
*/
-static void test_008_006_setup(void) {
+static void rt_test_008_006_setup(void) {
chEvtGetAndClearEvents(ALL_EVENTS);
}
-static void test_008_006_execute(void) {
+static void rt_test_008_006_execute(void) {
eventmask_t m;
/* [8.6.1] The functions are invoked first with TIME_IMMEDIATE
@@ -451,25 +451,25 @@ static void test_008_006_execute(void) {
timeout condition is tested.*/
test_set_step(2);
{
- m = chEvtWaitOneTimeout(ALL_EVENTS, MS2ST(50));
+ m = chEvtWaitOneTimeout(ALL_EVENTS, TIME_MS2I(50));
test_assert(m == 0, "spurious event");
- m = chEvtWaitAnyTimeout(ALL_EVENTS, MS2ST(50));
+ m = chEvtWaitAnyTimeout(ALL_EVENTS, TIME_MS2I(50));
test_assert(m == 0, "spurious event");
- m = chEvtWaitAllTimeout(ALL_EVENTS, MS2ST(50));
+ m = chEvtWaitAllTimeout(ALL_EVENTS, TIME_MS2I(50));
test_assert(m == 0, "spurious event");
}
}
-static const testcase_t test_008_006 = {
+static const testcase_t rt_test_008_006 = {
"Events Flags wait timeouts",
- test_008_006_setup,
+ rt_test_008_006_setup,
NULL,
- test_008_006_execute
+ rt_test_008_006_execute
};
#endif /* CH_CFG_USE_EVENTS_TIMEOUT */
/**
- * @page test_008_007 [8.7] Broadcasting using chEvtBroadcast()
+ * @page rt_test_008_007 [8.7] Broadcasting using chEvtBroadcast()
*
* <h2>Description</h2>
* Functionality of chEvtBroadcast() is tested.
@@ -487,13 +487,13 @@ static const testcase_t test_008_006 = {
* .
*/
-static void test_008_007_setup(void) {
+static void rt_test_008_007_setup(void) {
chEvtGetAndClearEvents(ALL_EVENTS);
chEvtObjectInit(&es1);
chEvtObjectInit(&es2);
}
-static void test_008_007_execute(void) {
+static void rt_test_008_007_execute(void) {
eventmask_t m;
event_listener_t el1, el2;
systime_t target_time;
@@ -511,7 +511,7 @@ static void test_008_007_execute(void) {
other after 50mS.*/
test_set_step(2);
{
- target_time = test_wait_tick() + MS2ST(50);
+ target_time = test_wait_tick() + TIME_MS2I(50);
threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriorityX() - 1,
evt_thread7, "A");
}
@@ -539,11 +539,11 @@ static void test_008_007_execute(void) {
}
}
-static const testcase_t test_008_007 = {
+static const testcase_t rt_test_008_007 = {
"Broadcasting using chEvtBroadcast()",
- test_008_007_setup,
+ rt_test_008_007_setup,
NULL,
- test_008_007_execute
+ rt_test_008_007_execute
};
/****************************************************************************
@@ -553,16 +553,16 @@ static const testcase_t test_008_007 = {
/**
* @brief Event Sources and Event Flags.
*/
-const testcase_t * const test_sequence_008[] = {
- &test_008_001,
- &test_008_002,
- &test_008_003,
- &test_008_004,
- &test_008_005,
+const testcase_t * const rt_test_sequence_008[] = {
+ &rt_test_008_001,
+ &rt_test_008_002,
+ &rt_test_008_003,
+ &rt_test_008_004,
+ &rt_test_008_005,
#if (CH_CFG_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__)
- &test_008_006,
+ &rt_test_008_006,
#endif
- &test_008_007,
+ &rt_test_008_007,
NULL
};
diff --git a/test/rt/source/test/test_sequence_008.h b/test/rt/source/test/rt_test_sequence_008.h
index 5824b2cc1..3f9c4f412 100644
--- a/test/rt/source/test/test_sequence_008.h
+++ b/test/rt/source/test/rt_test_sequence_008.h
@@ -15,13 +15,13 @@
*/
/**
- * @file test_sequence_008.h
+ * @file rt_test_sequence_008.h
* @brief Test Sequence 008 header.
*/
-#ifndef TEST_SEQUENCE_008_H
-#define TEST_SEQUENCE_008_H
+#ifndef RT_TEST_SEQUENCE_008_H
+#define RT_TEST_SEQUENCE_008_H
-extern const testcase_t * const test_sequence_008[];
+extern const testcase_t * const rt_test_sequence_008[];
-#endif /* TEST_SEQUENCE_008_H */
+#endif /* RT_TEST_SEQUENCE_008_H */
diff --git a/test/rt/source/test/test_sequence_009.c b/test/rt/source/test/rt_test_sequence_009.c
index 92ec11b77..d43bf0fec 100644
--- a/test/rt/source/test/test_sequence_009.c
+++ b/test/rt/source/test/rt_test_sequence_009.c
@@ -16,15 +16,15 @@
#include "hal.h"
#include "ch_test.h"
-#include "test_root.h"
+#include "rt_test_root.h"
/**
- * @file test_sequence_009.c
+ * @file rt_test_sequence_009.c
* @brief Test Sequence 009 code.
*
- * @page test_sequence_009 [9] Mailboxes
+ * @page rt_test_sequence_009 [9] Mailboxes
*
- * File: @ref test_sequence_009.c
+ * File: @ref rt_test_sequence_009.c
*
* <h2>Description</h2>
* This sequence tests the ChibiOS/RT functionalities related to
@@ -37,9 +37,9 @@
* .
*
* <h2>Test Cases</h2>
- * - @subpage test_009_001
- * - @subpage test_009_002
- * - @subpage test_009_003
+ * - @subpage rt_test_009_001
+ * - @subpage rt_test_009_002
+ * - @subpage rt_test_009_003
* .
*/
@@ -59,7 +59,7 @@ static MAILBOX_DECL(mb1, mb_buffer, MB_SIZE);
****************************************************************************/
/**
- * @page test_009_001 [9.1] Mailbox normal API, non-blocking tests
+ * @page rt_test_009_001 [9.1] Mailbox normal API, non-blocking tests
*
* <h2>Description</h2>
* The mailbox normal API is tested without triggering blocking
@@ -84,15 +84,15 @@ static MAILBOX_DECL(mb1, mb_buffer, MB_SIZE);
* .
*/
-static void test_009_001_setup(void) {
+static void rt_test_009_001_setup(void) {
chMBObjectInit(&mb1, mb_buffer, MB_SIZE);
}
-static void test_009_001_teardown(void) {
+static void rt_test_009_001_teardown(void) {
chMBReset(&mb1);
}
-static void test_009_001_execute(void) {
+static void rt_test_009_001_execute(void) {
msg_t msg1, msg2;
unsigned i;
@@ -180,15 +180,15 @@ static void test_009_001_execute(void) {
}
}
-static const testcase_t test_009_001 = {
+static const testcase_t rt_test_009_001 = {
"Mailbox normal API, non-blocking tests",
- test_009_001_setup,
- test_009_001_teardown,
- test_009_001_execute
+ rt_test_009_001_setup,
+ rt_test_009_001_teardown,
+ rt_test_009_001_execute
};
/**
- * @page test_009_002 [9.2] Mailbox I-Class API, non-blocking tests
+ * @page rt_test_009_002 [9.2] Mailbox I-Class API, non-blocking tests
*
* <h2>Description</h2>
* The mailbox I-Class API is tested without triggering blocking
@@ -211,15 +211,15 @@ static const testcase_t test_009_001 = {
* .
*/
-static void test_009_002_setup(void) {
+static void rt_test_009_002_setup(void) {
chMBObjectInit(&mb1, mb_buffer, MB_SIZE);
}
-static void test_009_002_teardown(void) {
+static void rt_test_009_002_teardown(void) {
chMBReset(&mb1);
}
-static void test_009_002_execute(void) {
+static void rt_test_009_002_execute(void) {
msg_t msg1, msg2;
unsigned i;
@@ -303,15 +303,15 @@ static void test_009_002_execute(void) {
}
}
-static const testcase_t test_009_002 = {
+static const testcase_t rt_test_009_002 = {
"Mailbox I-Class API, non-blocking tests",
- test_009_002_setup,
- test_009_002_teardown,
- test_009_002_execute
+ rt_test_009_002_setup,
+ rt_test_009_002_teardown,
+ rt_test_009_002_execute
};
/**
- * @page test_009_003 [9.3] Mailbox timeouts
+ * @page rt_test_009_003 [9.3] Mailbox timeouts
*
* <h2>Description</h2>
* The mailbox API is tested for timeouts.
@@ -326,15 +326,15 @@ static const testcase_t test_009_002 = {
* .
*/
-static void test_009_003_setup(void) {
+static void rt_test_009_003_setup(void) {
chMBObjectInit(&mb1, mb_buffer, MB_SIZE);
}
-static void test_009_003_teardown(void) {
+static void rt_test_009_003_teardown(void) {
chMBReset(&mb1);
}
-static void test_009_003_execute(void) {
+static void rt_test_009_003_execute(void) {
msg_t msg1, msg2;
unsigned i;
@@ -385,11 +385,11 @@ static void test_009_003_execute(void) {
}
}
-static const testcase_t test_009_003 = {
+static const testcase_t rt_test_009_003 = {
"Mailbox timeouts",
- test_009_003_setup,
- test_009_003_teardown,
- test_009_003_execute
+ rt_test_009_003_setup,
+ rt_test_009_003_teardown,
+ rt_test_009_003_execute
};
/****************************************************************************
@@ -399,10 +399,10 @@ static const testcase_t test_009_003 = {
/**
* @brief Mailboxes.
*/
-const testcase_t * const test_sequence_009[] = {
- &test_009_001,
- &test_009_002,
- &test_009_003,
+const testcase_t * const rt_test_sequence_009[] = {
+ &rt_test_009_001,
+ &rt_test_009_002,
+ &rt_test_009_003,
NULL
};
diff --git a/test/rt/source/test/test_sequence_009.h b/test/rt/source/test/rt_test_sequence_009.h
index 81eaa7aaa..ffe13dfa1 100644
--- a/test/rt/source/test/test_sequence_009.h
+++ b/test/rt/source/test/rt_test_sequence_009.h
@@ -15,13 +15,13 @@
*/
/**
- * @file test_sequence_009.h
+ * @file rt_test_sequence_009.h
* @brief Test Sequence 009 header.
*/
-#ifndef TEST_SEQUENCE_009_H
-#define TEST_SEQUENCE_009_H
+#ifndef RT_TEST_SEQUENCE_009_H
+#define RT_TEST_SEQUENCE_009_H
-extern const testcase_t * const test_sequence_009[];
+extern const testcase_t * const rt_test_sequence_009[];
-#endif /* TEST_SEQUENCE_009_H */
+#endif /* RT_TEST_SEQUENCE_009_H */
diff --git a/test/rt/source/test/test_sequence_010.c b/test/rt/source/test/rt_test_sequence_010.c
index ebdf7acac..80a81430c 100644
--- a/test/rt/source/test/test_sequence_010.c
+++ b/test/rt/source/test/rt_test_sequence_010.c
@@ -16,15 +16,15 @@
#include "hal.h"
#include "ch_test.h"
-#include "test_root.h"
+#include "rt_test_root.h"
/**
- * @file test_sequence_010.c
+ * @file rt_test_sequence_010.c
* @brief Test Sequence 010 code.
*
- * @page test_sequence_010 [10] Memory Pools
+ * @page rt_test_sequence_010 [10] Memory Pools
*
- * File: @ref test_sequence_010.c
+ * File: @ref rt_test_sequence_010.c
*
* <h2>Description</h2>
* This sequence tests the ChibiOS/RT functionalities related to memory
@@ -37,9 +37,9 @@
* .
*
* <h2>Test Cases</h2>
- * - @subpage test_010_001
- * - @subpage test_010_002
- * - @subpage test_010_003
+ * - @subpage rt_test_010_001
+ * - @subpage rt_test_010_002
+ * - @subpage rt_test_010_003
* .
*/
@@ -71,7 +71,7 @@ static void *null_provider(size_t size, unsigned align) {
****************************************************************************/
/**
- * @page test_010_001 [10.1] Loading and emptying a memory pool
+ * @page rt_test_010_001 [10.1] Loading and emptying a memory pool
*
* <h2>Description</h2>
* The memory pool functionality is tested by loading and emptying it,
@@ -89,11 +89,11 @@ static void *null_provider(size_t size, unsigned align) {
* .
*/
-static void test_010_001_setup(void) {
+static void rt_test_010_001_setup(void) {
chPoolObjectInit(&mp1, sizeof (uint32_t), NULL);
}
-static void test_010_001_execute(void) {
+static void rt_test_010_001_execute(void) {
unsigned i;
/* [10.1.1] Adding the objects to the pool using chPoolLoadArray().*/
@@ -144,16 +144,16 @@ static void test_010_001_execute(void) {
}
}
-static const testcase_t test_010_001 = {
+static const testcase_t rt_test_010_001 = {
"Loading and emptying a memory pool",
- test_010_001_setup,
+ rt_test_010_001_setup,
NULL,
- test_010_001_execute
+ rt_test_010_001_execute
};
#if (CH_CFG_USE_SEMAPHORES) || defined(__DOXYGEN__)
/**
- * @page test_010_002 [10.2] Loading and emptying a guarded memory pool without waiting
+ * @page rt_test_010_002 [10.2] Loading and emptying a guarded memory pool without waiting
*
* <h2>Description</h2>
* The memory pool functionality is tested by loading and emptying it,
@@ -177,11 +177,11 @@ static const testcase_t test_010_001 = {
* .
*/
-static void test_010_002_setup(void) {
+static void rt_test_010_002_setup(void) {
chGuardedPoolObjectInit(&gmp1, sizeof (uint32_t));
}
-static void test_010_002_execute(void) {
+static void rt_test_010_002_execute(void) {
unsigned i;
/* [10.2.1] Adding the objects to the pool using
@@ -227,17 +227,17 @@ static void test_010_002_execute(void) {
}
}
-static const testcase_t test_010_002 = {
+static const testcase_t rt_test_010_002 = {
"Loading and emptying a guarded memory pool without waiting",
- test_010_002_setup,
+ rt_test_010_002_setup,
NULL,
- test_010_002_execute
+ rt_test_010_002_execute
};
#endif /* CH_CFG_USE_SEMAPHORES */
#if (CH_CFG_USE_SEMAPHORES) || defined(__DOXYGEN__)
/**
- * @page test_010_003 [10.3] Guarded Memory Pools timeout
+ * @page rt_test_010_003 [10.3] Guarded Memory Pools timeout
*
* <h2>Description</h2>
* The timeout features for the Guarded Memory Pools is tested.
@@ -254,25 +254,25 @@ static const testcase_t test_010_002 = {
* .
*/
-static void test_010_003_setup(void) {
+static void rt_test_010_003_setup(void) {
chGuardedPoolObjectInit(&gmp1, sizeof (uint32_t));
}
-static void test_010_003_execute(void) {
+static void rt_test_010_003_execute(void) {
/* [10.3.1] Trying to allocate with 100mS timeout, must fail because
the pool is empty.*/
test_set_step(1);
{
- test_assert(chGuardedPoolAllocTimeout(&gmp1, MS2ST(100)) == NULL, "list not empty");
+ test_assert(chGuardedPoolAllocTimeout(&gmp1, TIME_MS2I(100)) == NULL, "list not empty");
}
}
-static const testcase_t test_010_003 = {
+static const testcase_t rt_test_010_003 = {
"Guarded Memory Pools timeout",
- test_010_003_setup,
+ rt_test_010_003_setup,
NULL,
- test_010_003_execute
+ rt_test_010_003_execute
};
#endif /* CH_CFG_USE_SEMAPHORES */
@@ -283,13 +283,13 @@ static const testcase_t test_010_003 = {
/**
* @brief Memory Pools.
*/
-const testcase_t * const test_sequence_010[] = {
- &test_010_001,
+const testcase_t * const rt_test_sequence_010[] = {
+ &rt_test_010_001,
#if (CH_CFG_USE_SEMAPHORES) || defined(__DOXYGEN__)
- &test_010_002,
+ &rt_test_010_002,
#endif
#if (CH_CFG_USE_SEMAPHORES) || defined(__DOXYGEN__)
- &test_010_003,
+ &rt_test_010_003,
#endif
NULL
};
diff --git a/test/rt/source/test/test_sequence_010.h b/test/rt/source/test/rt_test_sequence_010.h
index bd94c5032..ed3fb97c6 100644
--- a/test/rt/source/test/test_sequence_010.h
+++ b/test/rt/source/test/rt_test_sequence_010.h
@@ -15,13 +15,13 @@
*/
/**
- * @file test_sequence_010.h
+ * @file rt_test_sequence_010.h
* @brief Test Sequence 010 header.
*/
-#ifndef TEST_SEQUENCE_010_H
-#define TEST_SEQUENCE_010_H
+#ifndef RT_TEST_SEQUENCE_010_H
+#define RT_TEST_SEQUENCE_010_H
-extern const testcase_t * const test_sequence_010[];
+extern const testcase_t * const rt_test_sequence_010[];
-#endif /* TEST_SEQUENCE_010_H */
+#endif /* RT_TEST_SEQUENCE_010_H */
diff --git a/test/rt/source/test/test_sequence_011.c b/test/rt/source/test/rt_test_sequence_011.c
index 398e4da3f..7c4ec8a63 100644
--- a/test/rt/source/test/test_sequence_011.c
+++ b/test/rt/source/test/rt_test_sequence_011.c
@@ -16,15 +16,15 @@
#include "hal.h"
#include "ch_test.h"
-#include "test_root.h"
+#include "rt_test_root.h"
/**
- * @file test_sequence_011.c
+ * @file rt_test_sequence_011.c
* @brief Test Sequence 011 code.
*
- * @page test_sequence_011 [11] Memory Heaps
+ * @page rt_test_sequence_011 [11] Memory Heaps
*
- * File: @ref test_sequence_011.c
+ * File: @ref rt_test_sequence_011.c
*
* <h2>Description</h2>
* This sequence tests the ChibiOS/RT functionalities related to memory
@@ -37,8 +37,8 @@
* .
*
* <h2>Test Cases</h2>
- * - @subpage test_011_001
- * - @subpage test_011_002
+ * - @subpage rt_test_011_001
+ * - @subpage rt_test_011_002
* .
*/
@@ -58,7 +58,7 @@ memory_heap_t test_heap;
****************************************************************************/
/**
- * @page test_011_001 [11.1] Allocation and fragmentation
+ * @page rt_test_011_001 [11.1] Allocation and fragmentation
*
* <h2>Description</h2>
* Series of allocations/deallocations are performed in carefully
@@ -87,11 +87,11 @@ memory_heap_t test_heap;
* .
*/
-static void test_011_001_setup(void) {
+static void rt_test_011_001_setup(void) {
chHeapObjectInit(&test_heap, test_buffer, sizeof(test_buffer));
}
-static void test_011_001_execute(void) {
+static void rt_test_011_001_execute(void) {
void *p1, *p2, *p3;
size_t n, sz;
@@ -206,15 +206,15 @@ static void test_011_001_execute(void) {
}
}
-static const testcase_t test_011_001 = {
+static const testcase_t rt_test_011_001 = {
"Allocation and fragmentation",
- test_011_001_setup,
+ rt_test_011_001_setup,
NULL,
- test_011_001_execute
+ rt_test_011_001_execute
};
/**
- * @page test_011_002 [11.2] Default Heap
+ * @page rt_test_011_002 [11.2] Default Heap
*
* <h2>Description</h2>
* The default heap is pre-allocated in the system. We test base
@@ -227,7 +227,7 @@ static const testcase_t test_011_001 = {
* .
*/
-static void test_011_002_execute(void) {
+static void rt_test_011_002_execute(void) {
void *p1;
size_t total_size, largest_size;
@@ -249,11 +249,11 @@ static void test_011_002_execute(void) {
}
}
-static const testcase_t test_011_002 = {
+static const testcase_t rt_test_011_002 = {
"Default Heap",
NULL,
NULL,
- test_011_002_execute
+ rt_test_011_002_execute
};
/****************************************************************************
@@ -263,9 +263,9 @@ static const testcase_t test_011_002 = {
/**
* @brief Memory Heaps.
*/
-const testcase_t * const test_sequence_011[] = {
- &test_011_001,
- &test_011_002,
+const testcase_t * const rt_test_sequence_011[] = {
+ &rt_test_011_001,
+ &rt_test_011_002,
NULL
};
diff --git a/test/rt/source/test/test_sequence_011.h b/test/rt/source/test/rt_test_sequence_011.h
index 7f2faedb5..2fc129c72 100644
--- a/test/rt/source/test/test_sequence_011.h
+++ b/test/rt/source/test/rt_test_sequence_011.h
@@ -15,13 +15,13 @@
*/
/**
- * @file test_sequence_011.h
+ * @file rt_test_sequence_011.h
* @brief Test Sequence 011 header.
*/
-#ifndef TEST_SEQUENCE_011_H
-#define TEST_SEQUENCE_011_H
+#ifndef RT_TEST_SEQUENCE_011_H
+#define RT_TEST_SEQUENCE_011_H
-extern const testcase_t * const test_sequence_011[];
+extern const testcase_t * const rt_test_sequence_011[];
-#endif /* TEST_SEQUENCE_011_H */
+#endif /* RT_TEST_SEQUENCE_011_H */
diff --git a/test/rt/source/test/test_sequence_012.c b/test/rt/source/test/rt_test_sequence_012.c
index 35ea29585..fd426002b 100644
--- a/test/rt/source/test/test_sequence_012.c
+++ b/test/rt/source/test/rt_test_sequence_012.c
@@ -16,15 +16,15 @@
#include "hal.h"
#include "ch_test.h"
-#include "test_root.h"
+#include "rt_test_root.h"
/**
- * @file test_sequence_012.c
+ * @file rt_test_sequence_012.c
* @brief Test Sequence 012 code.
*
- * @page test_sequence_012 [12] Dynamic threads
+ * @page rt_test_sequence_012 [12] Dynamic threads
*
- * File: @ref test_sequence_012.c
+ * File: @ref rt_test_sequence_012.c
*
* <h2>Description</h2>
* This module implements the test sequence for the dynamic thread
@@ -37,8 +37,8 @@
* .
*
* <h2>Test Cases</h2>
- * - @subpage test_012_001
- * - @subpage test_012_002
+ * - @subpage rt_test_012_001
+ * - @subpage rt_test_012_002
* .
*/
@@ -66,7 +66,7 @@ static THD_FUNCTION(dyn_thread1, p) {
#if (CH_CFG_USE_HEAP) || defined(__DOXYGEN__)
/**
- * @page test_012_001 [12.1] Threads creation from Memory Heap
+ * @page rt_test_012_001 [12.1] Threads creation from Memory Heap
*
* <h2>Description</h2>
* Two threads are started by allocating the memory from the Memory
@@ -92,11 +92,11 @@ static THD_FUNCTION(dyn_thread1, p) {
* .
*/
-static void test_012_001_setup(void) {
+static void rt_test_012_001_setup(void) {
chHeapObjectInit(&heap1, test_buffer, sizeof test_buffer);
}
-static void test_012_001_execute(void) {
+static void rt_test_012_001_execute(void) {
size_t n1, total1, largest1;
size_t n2, total2, largest2;
tprio_t prio;
@@ -162,17 +162,17 @@ static void test_012_001_execute(void) {
}
}
-static const testcase_t test_012_001 = {
+static const testcase_t rt_test_012_001 = {
"Threads creation from Memory Heap",
- test_012_001_setup,
+ rt_test_012_001_setup,
NULL,
- test_012_001_execute
+ rt_test_012_001_execute
};
#endif /* CH_CFG_USE_HEAP */
#if (CH_CFG_USE_MEMPOOLS) || defined(__DOXYGEN__)
/**
- * @page test_012_002 [12.2] Threads creation from Memory Pool
+ * @page rt_test_012_002 [12.2] Threads creation from Memory Pool
*
* <h2>Description</h2>
* Five thread creation are attempted from a pool containing only four
@@ -196,11 +196,11 @@ static const testcase_t test_012_001 = {
* .
*/
-static void test_012_002_setup(void) {
+static void rt_test_012_002_setup(void) {
chPoolObjectInit(&mp1, THD_WORKING_AREA_SIZE(THREADS_STACK_SIZE), NULL);
}
-static void test_012_002_execute(void) {
+static void rt_test_012_002_execute(void) {
unsigned i;
tprio_t prio;
@@ -256,11 +256,11 @@ static void test_012_002_execute(void) {
}
}
-static const testcase_t test_012_002 = {
+static const testcase_t rt_test_012_002 = {
"Threads creation from Memory Pool",
- test_012_002_setup,
+ rt_test_012_002_setup,
NULL,
- test_012_002_execute
+ rt_test_012_002_execute
};
#endif /* CH_CFG_USE_MEMPOOLS */
@@ -271,12 +271,12 @@ static const testcase_t test_012_002 = {
/**
* @brief Dynamic threads.
*/
-const testcase_t * const test_sequence_012[] = {
+const testcase_t * const rt_test_sequence_012[] = {
#if (CH_CFG_USE_HEAP) || defined(__DOXYGEN__)
- &test_012_001,
+ &rt_test_012_001,
#endif
#if (CH_CFG_USE_MEMPOOLS) || defined(__DOXYGEN__)
- &test_012_002,
+ &rt_test_012_002,
#endif
NULL
};
diff --git a/test/rt/source/test/test_sequence_012.h b/test/rt/source/test/rt_test_sequence_012.h
index 893a5cadc..204e4e833 100644
--- a/test/rt/source/test/test_sequence_012.h
+++ b/test/rt/source/test/rt_test_sequence_012.h
@@ -15,13 +15,13 @@
*/
/**
- * @file test_sequence_012.h
+ * @file rt_test_sequence_012.h
* @brief Test Sequence 012 header.
*/
-#ifndef TEST_SEQUENCE_012_H
-#define TEST_SEQUENCE_012_H
+#ifndef RT_TEST_SEQUENCE_012_H
+#define RT_TEST_SEQUENCE_012_H
-extern const testcase_t * const test_sequence_012[];
+extern const testcase_t * const rt_test_sequence_012[];
-#endif /* TEST_SEQUENCE_012_H */
+#endif /* RT_TEST_SEQUENCE_012_H */
diff --git a/test/rt/source/test/test_sequence_013.c b/test/rt/source/test/rt_test_sequence_013.c
index 22fb3beb9..5b413a338 100644
--- a/test/rt/source/test/test_sequence_013.c
+++ b/test/rt/source/test/rt_test_sequence_013.c
@@ -16,15 +16,15 @@
#include "hal.h"
#include "ch_test.h"
-#include "test_root.h"
+#include "rt_test_root.h"
/**
- * @file test_sequence_013.c
+ * @file rt_test_sequence_013.c
* @brief Test Sequence 013 code.
*
- * @page test_sequence_013 [13] Benchmarks
+ * @page rt_test_sequence_013 [13] Benchmarks
*
- * File: @ref test_sequence_013.c
+ * File: @ref rt_test_sequence_013.c
*
* <h2>Description</h2>
* This module implements a series of system benchmarks. The benchmarks
@@ -35,18 +35,18 @@
* regressions between successive ChibiOS/RT releases.
*
* <h2>Test Cases</h2>
- * - @subpage test_013_001
- * - @subpage test_013_002
- * - @subpage test_013_003
- * - @subpage test_013_004
- * - @subpage test_013_005
- * - @subpage test_013_006
- * - @subpage test_013_007
- * - @subpage test_013_008
- * - @subpage test_013_009
- * - @subpage test_013_010
- * - @subpage test_013_011
- * - @subpage test_013_012
+ * - @subpage rt_test_013_001
+ * - @subpage rt_test_013_002
+ * - @subpage rt_test_013_003
+ * - @subpage rt_test_013_004
+ * - @subpage rt_test_013_005
+ * - @subpage rt_test_013_006
+ * - @subpage rt_test_013_007
+ * - @subpage rt_test_013_008
+ * - @subpage rt_test_013_009
+ * - @subpage rt_test_013_010
+ * - @subpage rt_test_013_011
+ * - @subpage rt_test_013_012
* .
*/
@@ -81,7 +81,7 @@ NOINLINE static unsigned int msg_loop_test(thread_t *tp) {
uint32_t n = 0;
start = test_wait_tick();
- end = start + MS2ST(1000);
+ end = start + TIME_MS2I(1000);
do {
(void)chMsgSend(tp, 1);
n++;
@@ -141,7 +141,7 @@ static THD_FUNCTION(bmk_thread8, p) {
#if (CH_CFG_USE_MESSAGES) || defined(__DOXYGEN__)
/**
- * @page test_013_001 [13.1] Messages performance #1
+ * @page rt_test_013_001 [13.1] Messages performance #1
*
* <h2>Description</h2>
* A message server thread is created with a lower priority than the
@@ -163,7 +163,7 @@ static THD_FUNCTION(bmk_thread8, p) {
* .
*/
-static void test_013_001_execute(void) {
+static void rt_test_013_001_execute(void) {
uint32_t n;
/* [13.1.1] The messenger thread is started at a lower priority than
@@ -192,17 +192,17 @@ static void test_013_001_execute(void) {
}
}
-static const testcase_t test_013_001 = {
+static const testcase_t rt_test_013_001 = {
"Messages performance #1",
NULL,
NULL,
- test_013_001_execute
+ rt_test_013_001_execute
};
#endif /* CH_CFG_USE_MESSAGES */
#if (CH_CFG_USE_MESSAGES) || defined(__DOXYGEN__)
/**
- * @page test_013_002 [13.2] Messages performance #2
+ * @page rt_test_013_002 [13.2] Messages performance #2
*
* <h2>Description</h2>
* A message server thread is created with an higher priority than the
@@ -224,7 +224,7 @@ static const testcase_t test_013_001 = {
* .
*/
-static void test_013_002_execute(void) {
+static void rt_test_013_002_execute(void) {
uint32_t n;
/* [13.2.1] The messenger thread is started at an higher priority
@@ -253,17 +253,17 @@ static void test_013_002_execute(void) {
}
}
-static const testcase_t test_013_002 = {
+static const testcase_t rt_test_013_002 = {
"Messages performance #2",
NULL,
NULL,
- test_013_002_execute
+ rt_test_013_002_execute
};
#endif /* CH_CFG_USE_MESSAGES */
#if (CH_CFG_USE_MESSAGES) || defined(__DOXYGEN__)
/**
- * @page test_013_003 [13.3] Messages performance #3
+ * @page rt_test_013_003 [13.3] Messages performance #3
*
* <h2>Description</h2>
* A message server thread is created with an higher priority than the
@@ -288,7 +288,7 @@ static const testcase_t test_013_002 = {
* .
*/
-static void test_013_003_execute(void) {
+static void rt_test_013_003_execute(void) {
uint32_t n;
/* [13.3.1] The messenger thread is started at an higher priority
@@ -327,16 +327,16 @@ static void test_013_003_execute(void) {
}
}
-static const testcase_t test_013_003 = {
+static const testcase_t rt_test_013_003 = {
"Messages performance #3",
NULL,
NULL,
- test_013_003_execute
+ rt_test_013_003_execute
};
#endif /* CH_CFG_USE_MESSAGES */
/**
- * @page test_013_004 [13.4] Context Switch performance
+ * @page rt_test_013_004 [13.4] Context Switch performance
*
* <h2>Description</h2>
* A thread is created that just performs a @p chSchGoSleepS() into a
@@ -354,7 +354,7 @@ static const testcase_t test_013_003 = {
* .
*/
-static void test_013_004_execute(void) {
+static void rt_test_013_004_execute(void) {
thread_t *tp;
uint32_t n;
@@ -373,7 +373,7 @@ static void test_013_004_execute(void) {
n = 0;
start = test_wait_tick();
- end = start + MS2ST(1000);
+ end = start + TIME_MS2I(1000);
do {
chSysLock();
chSchWakeupS(tp, MSG_OK);
@@ -406,15 +406,15 @@ static void test_013_004_execute(void) {
}
}
-static const testcase_t test_013_004 = {
+static const testcase_t rt_test_013_004 = {
"Context Switch performance",
NULL,
NULL,
- test_013_004_execute
+ rt_test_013_004_execute
};
/**
- * @page test_013_005 [13.5] Threads performance, full cycle
+ * @page rt_test_013_005 [13.5] Threads performance, full cycle
*
* <h2>Description</h2>
* Threads are continuously created and terminated into a loop. A full
@@ -431,7 +431,7 @@ static const testcase_t test_013_004 = {
* .
*/
-static void test_013_005_execute(void) {
+static void rt_test_013_005_execute(void) {
uint32_t n;
tprio_t prio = chThdGetPriorityX() - 1;
systime_t start, end;
@@ -443,7 +443,7 @@ static void test_013_005_execute(void) {
{
n = 0;
start = test_wait_tick();
- end = start + MS2ST(1000);
+ end = start + TIME_MS2I(1000);
do {
chThdWait(chThdCreateStatic(wa[0], WA_SIZE, prio, bmk_thread3, NULL));
n++;
@@ -462,15 +462,15 @@ static void test_013_005_execute(void) {
}
}
-static const testcase_t test_013_005 = {
+static const testcase_t rt_test_013_005 = {
"Threads performance, full cycle",
NULL,
NULL,
- test_013_005_execute
+ rt_test_013_005_execute
};
/**
- * @page test_013_006 [13.6] Threads performance, create/exit only
+ * @page rt_test_013_006 [13.6] Threads performance, create/exit only
*
* <h2>Description</h2>
* Threads are continuously created and terminated into a loop. A
@@ -488,7 +488,7 @@ static const testcase_t test_013_005 = {
* .
*/
-static void test_013_006_execute(void) {
+static void rt_test_013_006_execute(void) {
uint32_t n;
tprio_t prio = chThdGetPriorityX() + 1;
systime_t start, end;
@@ -500,7 +500,7 @@ static void test_013_006_execute(void) {
{
n = 0;
start = test_wait_tick();
- end = start + MS2ST(1000);
+ end = start + TIME_MS2I(1000);
do {
#if CH_CFG_USE_REGISTRY
chThdRelease(chThdCreateStatic(wa[0], WA_SIZE, prio, bmk_thread3, NULL));
@@ -523,16 +523,16 @@ static void test_013_006_execute(void) {
}
}
-static const testcase_t test_013_006 = {
+static const testcase_t rt_test_013_006 = {
"Threads performance, create/exit only",
NULL,
NULL,
- test_013_006_execute
+ rt_test_013_006_execute
};
#if (CH_CFG_USE_SEMAPHORES) || defined(__DOXYGEN__)
/**
- * @page test_013_007 [13.7] Mass reschedule performance
+ * @page rt_test_013_007 [13.7] Mass reschedule performance
*
* <h2>Description</h2>
* Five threads are created and atomically rescheduled by resetting the
@@ -556,11 +556,11 @@ static const testcase_t test_013_006 = {
* .
*/
-static void test_013_007_setup(void) {
+static void rt_test_013_007_setup(void) {
chSemObjectInit(&sem1, 0);
}
-static void test_013_007_execute(void) {
+static void rt_test_013_007_execute(void) {
uint32_t n;
/* [13.7.1] Five threads are created at higher priority that
@@ -582,7 +582,7 @@ static void test_013_007_execute(void) {
n = 0;
start = test_wait_tick();
- end = start + MS2ST(1000);
+ end = start + TIME_MS2I(1000);
do {
chSemReset(&sem1, 0);
n++;
@@ -611,16 +611,16 @@ static void test_013_007_execute(void) {
}
}
-static const testcase_t test_013_007 = {
+static const testcase_t rt_test_013_007 = {
"Mass reschedule performance",
- test_013_007_setup,
+ rt_test_013_007_setup,
NULL,
- test_013_007_execute
+ rt_test_013_007_execute
};
#endif /* CH_CFG_USE_SEMAPHORES */
/**
- * @page test_013_008 [13.8] Round-Robin voluntary reschedule
+ * @page rt_test_013_008 [13.8] Round-Robin voluntary reschedule
*
* <h2>Description</h2>
* Five threads are created at equal priority, each thread just
@@ -637,7 +637,7 @@ static const testcase_t test_013_007 = {
* .
*/
-static void test_013_008_execute(void) {
+static void rt_test_013_008_execute(void) {
uint32_t n;
/* [13.8.1] The five threads are created at lower priority. The
@@ -671,15 +671,15 @@ static void test_013_008_execute(void) {
}
}
-static const testcase_t test_013_008 = {
+static const testcase_t rt_test_013_008 = {
"Round-Robin voluntary reschedule",
NULL,
NULL,
- test_013_008_execute
+ rt_test_013_008_execute
};
/**
- * @page test_013_009 [13.9] Virtual Timers set/reset performance
+ * @page rt_test_013_009 [13.9] Virtual Timers set/reset performance
*
* <h2>Description</h2>
* A virtual timer is set and immediately reset into a continuous
@@ -694,7 +694,7 @@ static const testcase_t test_013_008 = {
* .
*/
-static void test_013_009_execute(void) {
+static void rt_test_013_009_execute(void) {
static virtual_timer_t vt1, vt2;
uint32_t n;
@@ -707,7 +707,7 @@ static void test_013_009_execute(void) {
n = 0;
start = test_wait_tick();
- end = start + MS2ST(1000);
+ end = start + TIME_MS2I(1000);
do {
chSysLock();
chVTDoSetI(&vt1, 1, tmo, NULL);
@@ -731,16 +731,16 @@ static void test_013_009_execute(void) {
}
}
-static const testcase_t test_013_009 = {
+static const testcase_t rt_test_013_009 = {
"Virtual Timers set/reset performance",
NULL,
NULL,
- test_013_009_execute
+ rt_test_013_009_execute
};
#if (CH_CFG_USE_SEMAPHORES) || defined(__DOXYGEN__)
/**
- * @page test_013_010 [13.10] Semaphores wait/signal performance
+ * @page rt_test_013_010 [13.10] Semaphores wait/signal performance
*
* <h2>Description</h2>
* A counting semaphore is taken/released into a continuous loop, no
@@ -761,11 +761,11 @@ static const testcase_t test_013_009 = {
* .
*/
-static void test_013_010_setup(void) {
+static void rt_test_013_010_setup(void) {
chSemObjectInit(&sem1, 1);
}
-static void test_013_010_execute(void) {
+static void rt_test_013_010_execute(void) {
uint32_t n;
/* [13.10.1] A semaphore is teken and released. The operation is
@@ -776,7 +776,7 @@ static void test_013_010_execute(void) {
n = 0;
start = test_wait_tick();
- end = start + MS2ST(1000);
+ end = start + TIME_MS2I(1000);
do {
chSemWait(&sem1);
chSemSignal(&sem1);
@@ -802,17 +802,17 @@ static void test_013_010_execute(void) {
}
}
-static const testcase_t test_013_010 = {
+static const testcase_t rt_test_013_010 = {
"Semaphores wait/signal performance",
- test_013_010_setup,
+ rt_test_013_010_setup,
NULL,
- test_013_010_execute
+ rt_test_013_010_execute
};
#endif /* CH_CFG_USE_SEMAPHORES */
#if (CH_CFG_USE_MUTEXES) || defined(__DOXYGEN__)
/**
- * @page test_013_011 [13.11] Mutexes lock/unlock performance
+ * @page rt_test_013_011 [13.11] Mutexes lock/unlock performance
*
* <h2>Description</h2>
* A mutex is locked/unlocked into a continuous loop, no Context Switch
@@ -833,11 +833,11 @@ static const testcase_t test_013_010 = {
* .
*/
-static void test_013_011_setup(void) {
+static void rt_test_013_011_setup(void) {
chMtxObjectInit(&mtx1);
}
-static void test_013_011_execute(void) {
+static void rt_test_013_011_execute(void) {
uint32_t n;
/* [13.11.1] A mutex is locked and unlocked. The operation is
@@ -848,7 +848,7 @@ static void test_013_011_execute(void) {
n = 0;
start = test_wait_tick();
- end = start + MS2ST(1000);
+ end = start + TIME_MS2I(1000);
do {
chMtxLock(&mtx1);
chMtxUnlock(&mtx1);
@@ -874,16 +874,16 @@ static void test_013_011_execute(void) {
}
}
-static const testcase_t test_013_011 = {
+static const testcase_t rt_test_013_011 = {
"Mutexes lock/unlock performance",
- test_013_011_setup,
+ rt_test_013_011_setup,
NULL,
- test_013_011_execute
+ rt_test_013_011_execute
};
#endif /* CH_CFG_USE_MUTEXES */
/**
- * @page test_013_012 [13.12] RAM Footprint
+ * @page rt_test_013_012 [13.12] RAM Footprint
*
* <h2>Description</h2>
* The memory size of the various kernel objects is printed.
@@ -901,7 +901,7 @@ static const testcase_t test_013_011 = {
* .
*/
-static void test_013_012_execute(void) {
+static void rt_test_013_012_execute(void) {
/* [13.12.1] The size of the system area is printed.*/
test_set_step(1);
@@ -988,11 +988,11 @@ static void test_013_012_execute(void) {
}
}
-static const testcase_t test_013_012 = {
+static const testcase_t rt_test_013_012 = {
"RAM Footprint",
NULL,
NULL,
- test_013_012_execute
+ rt_test_013_012_execute
};
/****************************************************************************
@@ -1002,30 +1002,30 @@ static const testcase_t test_013_012 = {
/**
* @brief Benchmarks.
*/
-const testcase_t * const test_sequence_013[] = {
+const testcase_t * const rt_test_sequence_013[] = {
#if (CH_CFG_USE_MESSAGES) || defined(__DOXYGEN__)
- &test_013_001,
+ &rt_test_013_001,
#endif
#if (CH_CFG_USE_MESSAGES) || defined(__DOXYGEN__)
- &test_013_002,
+ &rt_test_013_002,
#endif
#if (CH_CFG_USE_MESSAGES) || defined(__DOXYGEN__)
- &test_013_003,
+ &rt_test_013_003,
#endif
- &test_013_004,
- &test_013_005,
- &test_013_006,
+ &rt_test_013_004,
+ &rt_test_013_005,
+ &rt_test_013_006,
#if (CH_CFG_USE_SEMAPHORES) || defined(__DOXYGEN__)
- &test_013_007,
+ &rt_test_013_007,
#endif
- &test_013_008,
- &test_013_009,
+ &rt_test_013_008,
+ &rt_test_013_009,
#if (CH_CFG_USE_SEMAPHORES) || defined(__DOXYGEN__)
- &test_013_010,
+ &rt_test_013_010,
#endif
#if (CH_CFG_USE_MUTEXES) || defined(__DOXYGEN__)
- &test_013_011,
+ &rt_test_013_011,
#endif
- &test_013_012,
+ &rt_test_013_012,
NULL
};
diff --git a/test/rt/source/test/test_sequence_013.h b/test/rt/source/test/rt_test_sequence_013.h
index 9bbcb7b0d..7171c09ad 100644
--- a/test/rt/source/test/test_sequence_013.h
+++ b/test/rt/source/test/rt_test_sequence_013.h
@@ -15,13 +15,13 @@
*/
/**
- * @file test_sequence_013.h
+ * @file rt_test_sequence_013.h
* @brief Test Sequence 013 header.
*/
-#ifndef TEST_SEQUENCE_013_H
-#define TEST_SEQUENCE_013_H
+#ifndef RT_TEST_SEQUENCE_013_H
+#define RT_TEST_SEQUENCE_013_H
-extern const testcase_t * const test_sequence_013[];
+extern const testcase_t * const rt_test_sequence_013[];
-#endif /* TEST_SEQUENCE_013_H */
+#endif /* RT_TEST_SEQUENCE_013_H */
diff --git a/test/rt/test.mk b/test/rt/test.mk
index e9c74676a..d3eb41f63 100644
--- a/test/rt/test.mk
+++ b/test/rt/test.mk
@@ -1,19 +1,19 @@
# List of all the ChibiOS/RT test files.
TESTSRC = ${CHIBIOS}/test/lib/ch_test.c \
- ${CHIBIOS}/test/rt/source/test/test_root.c \
- ${CHIBIOS}/test/rt/source/test/test_sequence_001.c \
- ${CHIBIOS}/test/rt/source/test/test_sequence_002.c \
- ${CHIBIOS}/test/rt/source/test/test_sequence_003.c \
- ${CHIBIOS}/test/rt/source/test/test_sequence_004.c \
- ${CHIBIOS}/test/rt/source/test/test_sequence_005.c \
- ${CHIBIOS}/test/rt/source/test/test_sequence_006.c \
- ${CHIBIOS}/test/rt/source/test/test_sequence_007.c \
- ${CHIBIOS}/test/rt/source/test/test_sequence_008.c \
- ${CHIBIOS}/test/rt/source/test/test_sequence_009.c \
- ${CHIBIOS}/test/rt/source/test/test_sequence_010.c \
- ${CHIBIOS}/test/rt/source/test/test_sequence_011.c \
- ${CHIBIOS}/test/rt/source/test/test_sequence_012.c \
- ${CHIBIOS}/test/rt/source/test/test_sequence_013.c
+ ${CHIBIOS}/test/rt/source/test/rt_test_root.c \
+ ${CHIBIOS}/test/rt/source/test/rt_test_sequence_001.c \
+ ${CHIBIOS}/test/rt/source/test/rt_test_sequence_002.c \
+ ${CHIBIOS}/test/rt/source/test/rt_test_sequence_003.c \
+ ${CHIBIOS}/test/rt/source/test/rt_test_sequence_004.c \
+ ${CHIBIOS}/test/rt/source/test/rt_test_sequence_005.c \
+ ${CHIBIOS}/test/rt/source/test/rt_test_sequence_006.c \
+ ${CHIBIOS}/test/rt/source/test/rt_test_sequence_007.c \
+ ${CHIBIOS}/test/rt/source/test/rt_test_sequence_008.c \
+ ${CHIBIOS}/test/rt/source/test/rt_test_sequence_009.c \
+ ${CHIBIOS}/test/rt/source/test/rt_test_sequence_010.c \
+ ${CHIBIOS}/test/rt/source/test/rt_test_sequence_011.c \
+ ${CHIBIOS}/test/rt/source/test/rt_test_sequence_012.c \
+ ${CHIBIOS}/test/rt/source/test/rt_test_sequence_013.c
# Required include directories
TESTINC = ${CHIBIOS}/test/lib \