diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-03-10 14:57:26 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-03-10 14:57:26 +0000 |
commit | ade53fbc15fcf754ccb29e90f19cb2f921a90288 (patch) | |
tree | 85d37e1a28065648ba0244046479f2a62da03b37 /test/nasa_osal/configuration.xml | |
parent | 6495240dcd6df5d7026429f75f2d0a2bfd87018a (diff) | |
download | ChibiOS-ade53fbc15fcf754ccb29e90f19cb2f921a90288.tar.gz ChibiOS-ade53fbc15fcf754ccb29e90f19cb2f921a90288.tar.bz2 ChibiOS-ade53fbc15fcf754ccb29e90f19cb2f921a90288.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9065 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'test/nasa_osal/configuration.xml')
-rw-r--r-- | test/nasa_osal/configuration.xml | 264 |
1 files changed, 186 insertions, 78 deletions
diff --git a/test/nasa_osal/configuration.xml b/test/nasa_osal/configuration.xml index df5342bff..eef897b28 100644 --- a/test/nasa_osal/configuration.xml +++ b/test/nasa_osal/configuration.xml @@ -757,37 +757,29 @@ test_assert(err == OS_SUCCESS, "queue deletion failed");]]></value> </case>
<case>
<brief>
- <value>OS_QueuePut() and OS_QueueGet() functionality</value>
+ <value>OS_QueueGetIdByName() errors</value>
</brief>
<description>
- <value>A task writes on a queue, the messages are retrieved on the other side in blocking mode.</value>
+ <value>Parameters checking in OS_QueueGetIdByName() is tested.</value>
</description>
<condition>
<value />
</condition>
<various_code>
<setup_code>
- <value><![CDATA[qid = 0; -tid = 0;]]></value>
+ <value />
</setup_code>
<teardown_code>
- <value><![CDATA[if (qid != 0) { - (void) OS_QueueDelete(qid); -} - -if (tid != 0) { - (void) OS_TaskWait(tid); -}]]></value>
+ <value />
</teardown_code>
<local_variables>
- <value><![CDATA[uint32 tid; -unsigned i;]]></value>
+ <value />
</local_variables>
</various_code>
<steps>
<step>
<description>
- <value>Creataing a queue with depth 4 and message size 20</value>
+ <value>OS_QueueGetIdByName() is invoked with queue_id set to NULL, an error is expected.</value>
</description>
<tags>
<value />
@@ -795,13 +787,13 @@ unsigned i;]]></value> <code>
<value><![CDATA[int32 err; -err = OS_QueueCreate(&qid, "test queue", 4, MESSAGE_SIZE, 0); -test_assert(err == OS_SUCCESS, "queue creation failed");]]></value>
+err = OS_QueueGetIdByName(NULL, "queue"); +test_assert(err == OS_INVALID_POINTER, "NULL not detected");]]></value>
</code>
</step>
<step>
<description>
- <value>Creating the writer task.</value>
+ <value>OS_QueueGetIdByName() is invoked with queue_name set to NULL, an error is expected.</value>
</description>
<tags>
<value />
@@ -809,76 +801,59 @@ test_assert(err == OS_SUCCESS, "queue creation failed");]]></value> <code>
<value><![CDATA[int32 err; -err = OS_TaskCreate(&tid, - "writer task", - test_task_writer, - (uint32 *)wa_test1, - sizeof wa_test1, - TASKS_BASE_PRIORITY, - 0); -test_assert(err == OS_SUCCESS, "writer task creation failed");]]></value>
+err = OS_QueueGetIdByName(&qid, NULL); +test_assert(err == OS_INVALID_POINTER, "NULL not detected");]]></value>
</code>
</step>
<step>
<description>
- <value>Reading messages from the writer task.</value>
+ <value>OS_QueueGetIdByName() is invoked with a very long task name, an error is expected.</value>
</description>
<tags>
<value />
</tags>
<code>
- <value><![CDATA[for (i = 0; i < WRITER_NUM_MESSAGES; i++) { - int32 err; - char data[MESSAGE_SIZE]; - uint32 copied; + <value><![CDATA[int32 err; - err = OS_QueueGet(qid, data, MESSAGE_SIZE, &copied, OS_Milli2Ticks(200)); - test_assert(err == OS_SUCCESS, "timed out"); - test_assert(strncmp(data, "Hello World", sizeof (data)) == 0, - "wrong message"); -}]]></value>
- </code>
- </step>
- <step>
- <description>
- <value>Waiting for task termination then checking for errors.</value>
- </description>
- <tags>
- <value />
- </tags>
- <code>
- <value><![CDATA[(void) OS_TaskWait(tid); -tid = 0; -test_assert_sequence("", "queue write errors occurred");]]></value>
+err = OS_QueueGetIdByName(&qid, "very very long queue name"); +test_assert(err == OS_ERR_NAME_TOO_LONG, "name limit not detected");]]></value>
</code>
</step>
</steps>
</case>
<case>
<brief>
- <value>OS_QueueGetIdByName() errors</value>
+ <value>OS_QueuePut() and OS_QueueGet() functionality</value>
</brief>
<description>
- <value>Parameters checking in OS_QueueGetIdByName() is tested.</value>
+ <value>A task writes on a queue, the messages are retrieved on the other side in blocking mode.</value>
</description>
<condition>
<value />
</condition>
<various_code>
<setup_code>
- <value />
+ <value><![CDATA[qid = 0; +tid = 0;]]></value>
</setup_code>
<teardown_code>
- <value />
+ <value><![CDATA[if (qid != 0) { + (void) OS_QueueDelete(qid); +} + +if (tid != 0) { + (void) OS_TaskWait(tid); +}]]></value>
</teardown_code>
<local_variables>
- <value />
+ <value><![CDATA[uint32 tid; +unsigned i;]]></value>
</local_variables>
</various_code>
<steps>
<step>
<description>
- <value>OS_QueueGetIdByName() is invoked with queue_id set to NULL, an error is expected.</value>
+ <value>Creataing a queue with depth 4 and message size 20</value>
</description>
<tags>
<value />
@@ -886,13 +861,13 @@ test_assert_sequence("", "queue write errors occurred");]]></value> <code>
<value><![CDATA[int32 err; -err = OS_QueueGetIdByName(NULL, "queue"); -test_assert(err == OS_INVALID_POINTER, "NULL not detected");]]></value>
+err = OS_QueueCreate(&qid, "test queue", 4, MESSAGE_SIZE, 0); +test_assert(err == OS_SUCCESS, "queue creation failed");]]></value>
</code>
</step>
<step>
<description>
- <value>OS_QueueGetIdByName() is invoked with queue_name set to NULL, an error is expected.</value>
+ <value>Creating the writer task.</value>
</description>
<tags>
<value />
@@ -900,29 +875,54 @@ test_assert(err == OS_INVALID_POINTER, "NULL not detected");]]></value> <code>
<value><![CDATA[int32 err; -err = OS_QueueGetIdByName(&qid, NULL); -test_assert(err == OS_INVALID_POINTER, "NULL not detected");]]></value>
+err = OS_TaskCreate(&tid, + "writer task", + test_task_writer, + (uint32 *)wa_test1, + sizeof wa_test1, + TASKS_BASE_PRIORITY, + 0); +test_assert(err == OS_SUCCESS, "writer task creation failed");]]></value>
</code>
</step>
<step>
<description>
- <value>OS_QueueGetIdByName() is invoked with a very long task name, an error is expected.</value>
+ <value>Reading messages from the writer task.</value>
</description>
<tags>
<value />
</tags>
<code>
- <value><![CDATA[int32 err; + <value><![CDATA[for (i = 0; i < WRITER_NUM_MESSAGES; i++) { + int32 err; + char data[MESSAGE_SIZE]; + uint32 copied; -err = OS_QueueGetIdByName(&qid, "very very long queue name"); -test_assert(err == OS_ERR_NAME_TOO_LONG, "name limit not detected");]]></value>
+ err = OS_QueueGet(qid, data, MESSAGE_SIZE, &copied, OS_Milli2Ticks(200)); + test_assert(err == OS_SUCCESS, "timed out"); + test_assert(strncmp(data, "Hello World", sizeof (data)) == 0, + "wrong message"); +}]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>Waiting for task termination then checking for errors.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[(void) OS_TaskWait(tid); +tid = 0; +test_assert_sequence("", "queue write errors occurred");]]></value>
</code>
</step>
</steps>
</case>
<case>
<brief>
- <value>OS_QueueGet() with timeout</value>
+ <value>OS_QueueGet() with timeout functionality</value>
</brief>
<description>
<value>OS_QueueGetIdByName is tested.</value>
@@ -949,7 +949,7 @@ char data[MESSAGE_SIZE];]]></value> <steps>
<step>
<description>
- <value>Retrieving the queue name.</value>
+ <value>Retrieving the queue by name.</value>
</description>
<tags>
<value />
@@ -1006,13 +1006,16 @@ test_assert(err == OS_QUEUE_EMPTY, "unexpected error code");]]></value> <shared_code>
<value><![CDATA[#include <string.h> -#include "osapi.h"
-
+#include "osapi.h" + uint32 tmid;
-
-static void tmr_callback(uint32 timer_id) {
-
+uint32 cnt; + +static void tmr_callback(uint32 timer_id) { + (void)timer_id;
+
+ cnt++; }]]></value>
</shared_code>
<cases>
@@ -1109,7 +1112,7 @@ err = OS_TimerCreate(&tmid, "failing timer", &accuracy, NULL); /* Error.*/ -test_assert(err == OS_INVALID_POINTER, "NULL not detected");]]></value>
+test_assert(err == OS_TIMER_ERR_INVALID_ARGS, "NULL not detected");]]></value>
</code>
</step>
<step>
@@ -1284,7 +1287,11 @@ test_assert(err == OS_ERR_NAME_TOO_LONG, "name limit not detected");]]></value> </condition>
<various_code>
<setup_code>
- <value><![CDATA[tmid = 0;]]></value>
+ <value><![CDATA[uint32 accuracy; +
+cnt = 0; +tmid = 0; +(void) OS_TimerCreate(&tmid, "test timer", &accuracy, tmr_callback);]]></value>
</setup_code>
<teardown_code>
<value><![CDATA[if (tmid != 0) { @@ -1292,10 +1299,51 @@ test_assert(err == OS_ERR_NAME_TOO_LONG, "name limit not detected");]]></value> }]]></value>
</teardown_code>
<local_variables>
- <value />
+ <value><![CDATA[uint32 local_tmid;]]></value>
</local_variables>
</various_code>
- <steps />
+ <steps>
+ <step>
+ <description>
+ <value>Retrieving the timer by name.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; + +err = OS_TimerGetIdByName(&local_tmid, "test timer"); +test_assert(err == OS_SUCCESS, "timer not found");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>Setting up the timer for a 70mS one-shot tick.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[uint32 err;
+
+err = OS_TimerSet(local_tmid, 70000, 0);
+test_assert(err == OS_SUCCESS, "timer setup failed");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>Waiting one second then counting the occurred ticks.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[(void) OS_TaskDelay(1000);
+test_assert(cnt == 1, "wrong ticks");]]></value>
+ </code>
+ </step>
+ </steps>
</case>
<case>
<brief>
@@ -1309,18 +1357,78 @@ test_assert(err == OS_ERR_NAME_TOO_LONG, "name limit not detected");]]></value> </condition>
<various_code>
<setup_code>
- <value><![CDATA[tmid = 0;]]></value>
+ <value><![CDATA[uint32 accuracy;
+
+cnt = 0;
+tmid = 0;
+(void) OS_TimerCreate(&tmid, "test timer", &accuracy, tmr_callback);]]></value>
</setup_code>
<teardown_code>
- <value><![CDATA[if (tmid != 0) { + <value><![CDATA[if (tmid != 0) {
+ (void) OS_TimerSet(tmid, 0, 0); (void) OS_TimerDelete(tmid); }]]></value>
</teardown_code>
<local_variables>
- <value />
+ <value><![CDATA[uint32 local_tmid;]]></value>
</local_variables>
</various_code>
- <steps />
+ <steps>
+ <step>
+ <description>
+ <value>Retrieving the timer by name.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err;
+
+err = OS_TimerGetIdByName(&local_tmid, "test timer");
+test_assert(err == OS_SUCCESS, "timer not found");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>Setting up the timer for a 70mS periodic tick.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[uint32 err;
+
+err = OS_TimerSet(local_tmid, 70000, 70000);
+test_assert(err == OS_SUCCESS, "timer setup failed");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>Waiting one second then counting the occurred ticks.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[(void) OS_TaskDelay(1000);
+test_assert(cnt == 14, "wrong ticks");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>Stopping the timer.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[uint32 err;
+
+err = OS_TimerSet(local_tmid, 0, 0);
+test_assert(err == OS_SUCCESS, "timer stop failed");]]></value>
+ </code>
+ </step>
+ </steps>
</case>
</cases>
</sequence>
|