diff options
Diffstat (limited to 'test/nasa_osal/configuration.xml')
-rw-r--r-- | test/nasa_osal/configuration.xml | 349 |
1 files changed, 340 insertions, 9 deletions
diff --git a/test/nasa_osal/configuration.xml b/test/nasa_osal/configuration.xml index 6924cd1a4..df5342bff 100644 --- a/test/nasa_osal/configuration.xml +++ b/test/nasa_osal/configuration.xml @@ -734,7 +734,7 @@ test_assert(err == OS_ERR_INVALID_ID, "wrong queue id not detected");]]></value> </step>
<step>
<description>
- <value>OS_QueueCreate() is invoked twice with duplicated name, an error is expected, then the queue is deleted using OS_DeleteQueue().</value>
+ <value>OS_QueueCreate() is invoked twice with duplicated name, an error is expected, then the queue is deleted using OS_QueueDelete().</value>
</description>
<tags>
<value />
@@ -941,8 +941,8 @@ test_assert(err == OS_ERR_NAME_TOO_LONG, "name limit not detected");]]></value> }]]></value>
</teardown_code>
<local_variables>
- <value><![CDATA[uint32 local_qid;
-uint32 copied;
+ <value><![CDATA[uint32 local_qid; +uint32 copied; char data[MESSAGE_SIZE];]]></value>
</local_variables>
</various_code>
@@ -969,9 +969,9 @@ test_assert(err == OS_SUCCESS, "queue not found");]]></value> <value />
</tags>
<code>
- <value><![CDATA[int32 err;
-
-err = OS_QueueGet(qid, data, MESSAGE_SIZE, &copied, OS_Milli2Ticks(1000));
+ <value><![CDATA[int32 err; + +err = OS_QueueGet(qid, data, MESSAGE_SIZE, &copied, OS_Milli2Ticks(1000)); test_assert(err == OS_QUEUE_TIMEOUT, "unexpected error code");]]></value>
</code>
</step>
@@ -983,9 +983,9 @@ test_assert(err == OS_QUEUE_TIMEOUT, "unexpected error code");]]></value> <value />
</tags>
<code>
- <value><![CDATA[int32 err;
-
-err = OS_QueueGet(qid, data, MESSAGE_SIZE, &copied, OS_CHECK);
+ <value><![CDATA[int32 err; + +err = OS_QueueGet(qid, data, MESSAGE_SIZE, &copied, OS_CHECK); test_assert(err == OS_QUEUE_EMPTY, "unexpected error code");]]></value>
</code>
</step>
@@ -993,6 +993,337 @@ test_assert(err == OS_QUEUE_EMPTY, "unexpected error code");]]></value> </case>
</cases>
</sequence>
+ <sequence>
+ <type index="0">
+ <value>Internal Tests</value>
+ </type>
+ <brief>
+ <value>Timers Functionality</value>
+ </brief>
+ <description>
+ <value>This sequence tests the NASA OSAL over ChibiOS/RT functionalities related to timers</value>
+ </description>
+ <shared_code>
+ <value><![CDATA[#include <string.h> + +#include "osapi.h"
+
+uint32 tmid;
+
+static void tmr_callback(uint32 timer_id) {
+
+ (void)timer_id;
+}]]></value>
+ </shared_code>
+ <cases>
+ <case>
+ <brief>
+ <value>OS_TimerCreate() and OS_TimerDelete() errors</value>
+ </brief>
+ <description>
+ <value>Parameters checking in OS_TimerCreate() and OS_TimerDelete() is tested.</value>
+ </description>
+ <condition>
+ <value />
+ </condition>
+ <various_code>
+ <setup_code>
+ <value />
+ </setup_code>
+ <teardown_code>
+ <value />
+ </teardown_code>
+ <local_variables>
+ <value />
+ </local_variables>
+ </various_code>
+ <steps>
+ <step>
+ <description>
+ <value>OS_TimerCreate() is invoked with timer_id set to NULL, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; +uint32 accuracy; + +err = OS_TimerCreate(NULL, /* Error.*/ + "failing timer", + &accuracy, + tmr_callback); +test_assert(err == OS_INVALID_POINTER, "NULL not detected");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>OS_TimerCreate() is invoked with timer_name set to NULL, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; +uint32 tmid; +uint32 accuracy; + +err = OS_TimerCreate(&tmid, + NULL, /* Error.*/ + &accuracy, + tmr_callback); +test_assert(err == OS_INVALID_POINTER, "NULL not detected");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>OS_TimerCreate() is invoked with accuracy set to NULL, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; +uint32 tmid; + +err = OS_TimerCreate(&tmid, + "failing timer", + NULL, /* Error.*/ + tmr_callback); +test_assert(err == OS_INVALID_POINTER, "NULL not detected");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>OS_TimerCreate() is invoked with callback_ptr set to NULL, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; +uint32 tmid; +uint32 accuracy; + +err = OS_TimerCreate(&tmid, + "failing timer", + &accuracy, + NULL); /* Error.*/ +test_assert(err == OS_INVALID_POINTER, "NULL not detected");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>OS_TimerCreate() is invoked with a very long timer name, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; +uint32 tmid; +uint32 accuracy; + +err = OS_TimerCreate(&tmid, + "very very long timer name", /* Error.*/ + &accuracy, + tmr_callback); +test_assert(err == OS_ERR_NAME_TOO_LONG, "name limit not detected");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>OS_TimerDelete() is invoked with timer_id set to -1, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; + +err = OS_TimerDelete((uint32)-1); +test_assert(err == OS_ERR_INVALID_ID, "wrong timer id not detected");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>OS_TimerCreate() is invoked twice with duplicated name, an error is expected, then the queue is deleted using OS_TimerDelete().</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; +uint32 qid1, qid2; + +err = OS_QueueCreate(&qid1, "my queue", 4, 128, 0); +test_assert(err == OS_SUCCESS, "queue creation failed"); + +err = OS_QueueCreate(&qid2, "my queue", 4, 128, 0); +test_assert(err == OS_ERR_NAME_TAKEN, "name conflict not detected"); + +err = OS_QueueDelete(qid1); +test_assert(err == OS_SUCCESS, "queue deletion failed");]]></value>
+ </code>
+ </step>
+ </steps>
+ </case>
+ <case>
+ <brief>
+ <value>OS_TimerSet() errors</value>
+ </brief>
+ <description>
+ <value>Parameters checking in OS_TimerSet() is tested.</value>
+ </description>
+ <condition>
+ <value />
+ </condition>
+ <various_code>
+ <setup_code>
+ <value />
+ </setup_code>
+ <teardown_code>
+ <value />
+ </teardown_code>
+ <local_variables>
+ <value />
+ </local_variables>
+ </various_code>
+ <steps>
+ <step>
+ <description>
+ <value>OS_TimerSet() is invoked with timer_id set to -1, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; + +err = OS_TimerSet((uint32)-1, 10, 10); +test_assert(err == OS_ERR_INVALID_ID, "invalid timer_id not detected");]]></value>
+ </code>
+ </step>
+ </steps>
+ </case>
+ <case>
+ <brief>
+ <value>OS_TimerGetIdByName() errors</value>
+ </brief>
+ <description>
+ <value>Parameters checking in OS_TimerGetIdByName() is tested.</value>
+ </description>
+ <condition>
+ <value />
+ </condition>
+ <various_code>
+ <setup_code>
+ <value />
+ </setup_code>
+ <teardown_code>
+ <value />
+ </teardown_code>
+ <local_variables>
+ <value />
+ </local_variables>
+ </various_code>
+ <steps>
+ <step>
+ <description>
+ <value>OS_TimerGetIdByName() is invoked with timer_id set to NULL, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; + +err = OS_TimerGetIdByName(NULL, "timer"); +test_assert(err == OS_INVALID_POINTER, "NULL not detected");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>OS_TimerGetIdByName() is invoked with timer name set to NULL, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; + +err = OS_TimerGetIdByName(&tmid, NULL); +test_assert(err == OS_INVALID_POINTER, "NULL not detected");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>OS_TimerGetIdByName() is invoked with a very long task name, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; + +err = OS_TimerGetIdByName(&tmid, "very very long timer name"); +test_assert(err == OS_ERR_NAME_TOO_LONG, "name limit not detected");]]></value>
+ </code>
+ </step>
+ </steps>
+ </case>
+ <case>
+ <brief>
+ <value>OS_TimerSet() one-shot functionality</value>
+ </brief>
+ <description>
+ <value>A timer is tested in one-shot mode.</value>
+ </description>
+ <condition>
+ <value />
+ </condition>
+ <various_code>
+ <setup_code>
+ <value><![CDATA[tmid = 0;]]></value>
+ </setup_code>
+ <teardown_code>
+ <value><![CDATA[if (tmid != 0) { + (void) OS_TimerDelete(tmid); +}]]></value>
+ </teardown_code>
+ <local_variables>
+ <value />
+ </local_variables>
+ </various_code>
+ <steps />
+ </case>
+ <case>
+ <brief>
+ <value>OS_TimerSet() periodic functionality</value>
+ </brief>
+ <description>
+ <value>A timer is tested in periodic mode.</value>
+ </description>
+ <condition>
+ <value />
+ </condition>
+ <various_code>
+ <setup_code>
+ <value><![CDATA[tmid = 0;]]></value>
+ </setup_code>
+ <teardown_code>
+ <value><![CDATA[if (tmid != 0) { + (void) OS_TimerDelete(tmid); +}]]></value>
+ </teardown_code>
+ <local_variables>
+ <value />
+ </local_variables>
+ </various_code>
+ <steps />
+ </case>
+ </cases>
+ </sequence>
</sequences>
</instance>
</instances>
|