diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-03-11 15:39:22 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-03-11 15:39:22 +0000 |
commit | d6dd34c381e8e7631cb04032f01d83ff272afdcc (patch) | |
tree | 227fdba7ede3fa1faa415dff56706037b056b372 /test/nasa_osal/configuration.xml | |
parent | 8f30e605e6611b5d5c61c24d5d0cfb17589f117d (diff) | |
download | ChibiOS-d6dd34c381e8e7631cb04032f01d83ff272afdcc.tar.gz ChibiOS-d6dd34c381e8e7631cb04032f01d83ff272afdcc.tar.bz2 ChibiOS-d6dd34c381e8e7631cb04032f01d83ff272afdcc.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9076 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'test/nasa_osal/configuration.xml')
-rw-r--r-- | test/nasa_osal/configuration.xml | 473 |
1 files changed, 449 insertions, 24 deletions
diff --git a/test/nasa_osal/configuration.xml b/test/nasa_osal/configuration.xml index ac37ce262..323193671 100644 --- a/test/nasa_osal/configuration.xml +++ b/test/nasa_osal/configuration.xml @@ -925,7 +925,7 @@ test_assert_sequence("", "queue write errors occurred");]]></value> <value>OS_QueueGet() with timeout functionality</value>
</brief>
<description>
- <value>OS_QueueGetIdByName is tested.</value>
+ <value>OS_QueueGet() timeout functionality is tested.</value>
</description>
<condition>
<value />
@@ -1008,13 +1008,13 @@ test_assert(err == OS_QUEUE_EMPTY, "unexpected error code");]]></value> #include "osapi.h" -uint32 tmid;
+uint32 tmid; uint32 cnt; static void tmr_callback(uint32 timer_id) { - (void)timer_id;
-
+ (void)timer_id; + cnt++; }]]></value>
</shared_code>
@@ -1289,7 +1289,7 @@ test_assert(err == OS_ERR_NAME_TOO_LONG, "name limit not detected");]]></value> <various_code>
<setup_code>
<value><![CDATA[uint32 accuracy; -
+ cnt = 0; tmid = 0; (void) OS_TimerCreate(&tmid, "test timer", &accuracy, tmr_callback);]]></value>
@@ -1326,9 +1326,9 @@ test_assert(err == OS_SUCCESS, "timer not found");]]></value> <value />
</tags>
<code>
- <value><![CDATA[uint32 err;
-
-err = OS_TimerSet(local_tmid, 70000, 0);
+ <value><![CDATA[uint32 err; + +err = OS_TimerSet(local_tmid, 70000, 0); test_assert(err == OS_SUCCESS, "timer setup failed");]]></value>
</code>
</step>
@@ -1340,7 +1340,7 @@ test_assert(err == OS_SUCCESS, "timer setup failed");]]></value> <value />
</tags>
<code>
- <value><![CDATA[(void) OS_TaskDelay(1000);
+ <value><![CDATA[(void) OS_TaskDelay(1000); test_assert(cnt == 1, "wrong ticks");]]></value>
</code>
</step>
@@ -1358,14 +1358,14 @@ test_assert(cnt == 1, "wrong ticks");]]></value> </condition>
<various_code>
<setup_code>
- <value><![CDATA[uint32 accuracy;
-
-cnt = 0;
-tmid = 0;
+ <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>
@@ -1383,9 +1383,9 @@ tmid = 0; <value />
</tags>
<code>
- <value><![CDATA[int32 err;
-
-err = OS_TimerGetIdByName(&local_tmid, "test timer");
+ <value><![CDATA[int32 err; + +err = OS_TimerGetIdByName(&local_tmid, "test timer"); test_assert(err == OS_SUCCESS, "timer not found");]]></value>
</code>
</step>
@@ -1397,9 +1397,9 @@ test_assert(err == OS_SUCCESS, "timer not found");]]></value> <value />
</tags>
<code>
- <value><![CDATA[uint32 err;
-
-err = OS_TimerSet(local_tmid, 70000, 70000);
+ <value><![CDATA[uint32 err; + +err = OS_TimerSet(local_tmid, 70000, 70000); test_assert(err == OS_SUCCESS, "timer setup failed");]]></value>
</code>
</step>
@@ -1411,7 +1411,7 @@ test_assert(err == OS_SUCCESS, "timer setup failed");]]></value> <value />
</tags>
<code>
- <value><![CDATA[(void) OS_TaskDelay(1000);
+ <value><![CDATA[(void) OS_TaskDelay(1000); test_assert(cnt == 14, "wrong ticks");]]></value>
</code>
</step>
@@ -1423,9 +1423,9 @@ test_assert(cnt == 14, "wrong ticks");]]></value> <value />
</tags>
<code>
- <value><![CDATA[uint32 err;
-
-err = OS_TimerSet(local_tmid, 0, 0);
+ <value><![CDATA[uint32 err; + +err = OS_TimerSet(local_tmid, 0, 0); test_assert(err == OS_SUCCESS, "timer stop failed");]]></value>
</code>
</step>
@@ -1433,6 +1433,431 @@ test_assert(err == OS_SUCCESS, "timer stop failed");]]></value> </case>
</cases>
</sequence>
+ <sequence>
+ <type index="0">
+ <value>Internal Tests</value>
+ </type>
+ <brief>
+ <value>Binary Semaphores Functionality</value>
+ </brief>
+ <description>
+ <value>This sequence tests the NASA OSAL over ChibiOS/RT functionalities related to binary semaphores.</value>
+ </description>
+ <shared_code>
+ <value><![CDATA[#include "osapi.h" + +uint32 bsid;]]></value>
+ </shared_code>
+ <cases>
+ <case>
+ <brief>
+ <value>OS_TimerCreate() and OS_TimerDelete() errors</value>
+ </brief>
+ <description>
+ <value>Parameters checking in OS_BinSemCreate() and OS_BinSemDelete() 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_BinSemCreate() is invoked with sem_id set to NULL, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; + +err = OS_BinSemCreate(NULL, /* Error.*/ + "failing semaphore", + 0, + 0); +test_assert(err == OS_INVALID_POINTER, "NULL not detected");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>OS_BinSemCreate() is invoked with sem_name set to NULL, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; + +err = OS_BinSemCreate(&bsid, + NULL, /* Error.*/ + 0, + 0); +test_assert(err == OS_INVALID_POINTER, "NULL not detected");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>OS_BinSemCreate() is invoked with an invalid sem_initial_value, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; + +err = OS_BinSemCreate(&bsid, + "failing semaphore", + 2, /* Error.*/ + 0); +test_assert(err == OS_INVALID_INT_NUM, "counter error not detected");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>OS_BinSemCreate() is invoked with a very long timer name, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[#if 0 /* Semaphore name currently not implemented.*/ +int32 err; + +err = OS_BinSemCreate(&bsid, + "very very long semaphore name", /* Error.*/ + 0, + 0); +test_assert(err == OS_ERR_NAME_TOO_LONG, "name limit not detected"); +#endif]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>OS_BinSemDelete() is invoked with timer_id set to -1, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; + +err = OS_BinSemDelete((uint32)-1); +test_assert(err == OS_ERR_INVALID_ID, "wrong semaphore 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 bsid1; /*, bsid2;*/ + +err = OS_BinSemCreate(&bsid1, "my semaphore", 0, 0); +test_assert(err == OS_SUCCESS, "semaphore creation failed"); + +#if 0 /* Semaphore name currently not implemented.*/ +err = OS_BinSemCreate(&bsid2, "my semaphore", 0, 0); +test_assert(err == OS_ERR_NAME_TAKEN, "name conflict not detected"); +#endif + +err = OS_BinSemDelete(bsid1); +test_assert(err == OS_SUCCESS, "semaphore deletion failed");]]></value>
+ </code>
+ </step>
+ </steps>
+ </case>
+ <case>
+ <brief>
+ <value>OS_BinSemFlush() errors</value>
+ </brief>
+ <description>
+ <value>Parameters checking in OS_BinSemFlush() 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_BinSemFlush() is invoked with sem_id set to -1, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; + +err = OS_BinSemFlush((uint32)-1); +test_assert(err == OS_ERR_INVALID_ID, "invalid sem_id not detected");]]></value>
+ </code>
+ </step>
+ </steps>
+ </case>
+ <case>
+ <brief>
+ <value>OS_BinSemGive() errors</value>
+ </brief>
+ <description>
+ <value>Parameters checking in OS_BinSemGive() 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_BinSemGive() is invoked with sem_id set to -1, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; + +err = OS_BinSemGive((uint32)-1); +test_assert(err == OS_ERR_INVALID_ID, "invalid sem_id not detected");]]></value>
+ </code>
+ </step>
+ </steps>
+ </case>
+ <case>
+ <brief>
+ <value>OS_BinSemTake() errors</value>
+ </brief>
+ <description>
+ <value>Parameters checking in OS_BinSemTake() 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_BinSemTake() is invoked with sem_id set to -1, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; + +err = OS_BinSemTake((uint32)-1); +test_assert(err == OS_ERR_INVALID_ID, "invalid sem_id not detected");]]></value>
+ </code>
+ </step>
+ </steps>
+ </case>
+ <case>
+ <brief>
+ <value>OS_BinSemTimedWait() errors</value>
+ </brief>
+ <description>
+ <value>Parameters checking in OS_BinSemTimedWait() is tested.</value>
+ </description>
+ <condition>
+ <value />
+ </condition>
+ <various_code>
+ <setup_code>
+ <value><![CDATA[bsid = 0; +(void) OS_BinSemCreate(&bsid, "test semaphore", 0, 0);]]></value>
+ </setup_code>
+ <teardown_code>
+ <value><![CDATA[if (bsid > 0) { + (void) OS_BinSemDelete(bsid); +}]]></value>
+ </teardown_code>
+ <local_variables>
+ <value />
+ </local_variables>
+ </various_code>
+ <steps>
+ <step>
+ <description>
+ <value>OS_BinSemTimedWait() is invoked with sem_id set to -1, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; + +err = OS_BinSemTimedWait((uint32)-1, 1000); +test_assert(err == OS_ERR_INVALID_ID, "invalid sem_id not detected");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>OS_BinSemTimedWait() is invoked with msecs set to 0, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; + +err = OS_BinSemTimedWait(bsid, 0); +test_assert(err == OS_INVALID_INT_NUM, "invalid msec not detected");]]></value>
+ </code>
+ </step>
+ </steps>
+ </case>
+ <case>
+ <brief>
+ <value>OS_BinSemGetIdByName() errors</value>
+ </brief>
+ <description>
+ <value>Parameters checking in OS_BinSemGetIdByName() 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_BinSemGetIdByName() is invoked with sem_id set to NULL, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; + +err = OS_BinSemGetIdByName(NULL, "semaphore"); +test_assert(err == OS_INVALID_POINTER, "NULL not detected");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>OS_BinSemGetIdByName() is invoked with semaphore name set to NULL, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; + +err = OS_BinSemGetIdByName(&bsid, NULL); +test_assert(err == OS_INVALID_POINTER, "NULL not detected");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>OS_BinSemGetIdByName() is invoked with a very long task name, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; + +err = OS_BinSemGetIdByName(&bsid, "very very long semaphore name"); +test_assert(err == OS_ERR_NAME_TOO_LONG, "name limit not detected");]]></value>
+ </code>
+ </step>
+ </steps>
+ </case>
+ <case>
+ <brief>
+ <value>OS_BinSemTimedWait() timeout functionality</value>
+ </brief>
+ <description>
+ <value>OS_BinSemCreate() timeout functionality is tested.</value>
+ </description>
+ <condition>
+ <value />
+ </condition>
+ <various_code>
+ <setup_code>
+ <value><![CDATA[bsid = 0; +(void) OS_BinSemCreate(&bsid, "test semaphore", 0, 0);]]></value>
+ </setup_code>
+ <teardown_code>
+ <value><![CDATA[if (bsid > 0) { + (void) OS_BinSemDelete(bsid); +}]]></value>
+ </teardown_code>
+ <local_variables>
+ <value />
+ </local_variables>
+ </various_code>
+ <steps>
+ <step>
+ <description>
+ <value>OS_BinSemTimedWait() is invoked with timeout set to one second, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; + +err = OS_BinSemTimedWait(bsid, 1000); +test_assert(err == OS_SEM_TIMEOUT, "unexpected error code");]]></value>
+ </code>
+ </step>
+ </steps>
+ </case>
+ </cases>
+ </sequence>
</sequences>
</instance>
</instances>
|