diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-03-09 14:35:51 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-03-09 14:35:51 +0000 |
commit | 8795d6011446bb4d12968c7e155e047a8467e3db (patch) | |
tree | 02299fb686f5699c31ec9fbbd4c4ed9829122060 /test/nasa_osal/configuration.xml | |
parent | 8b32e5715ec1c99b5407f582551cc88975d2a001 (diff) | |
download | ChibiOS-8795d6011446bb4d12968c7e155e047a8467e3db.tar.gz ChibiOS-8795d6011446bb4d12968c7e155e047a8467e3db.tar.bz2 ChibiOS-8795d6011446bb4d12968c7e155e047a8467e3db.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9057 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'test/nasa_osal/configuration.xml')
-rw-r--r-- | test/nasa_osal/configuration.xml | 139 |
1 files changed, 135 insertions, 4 deletions
diff --git a/test/nasa_osal/configuration.xml b/test/nasa_osal/configuration.xml index 732f80946..e13b79ffa 100644 --- a/test/nasa_osal/configuration.xml +++ b/test/nasa_osal/configuration.xml @@ -593,12 +593,143 @@ test_assert(err == OS_SUCCESS, "deletable task creation failed");]]></value> <value />
</tags>
<code>
+ <value><![CDATA[int32 err; + +(void) OS_TaskDelay(50); +err = OS_TaskDelete(tid); +test_assert(err == OS_SUCCESS, "delete failed"); +test_assert_sequence("ABC", "events order violation");]]></value>
+ </code>
+ </step>
+ </steps>
+ </case>
+ </cases>
+ </sequence>
+ <sequence>
+ <type index="0">
+ <value>Internal Tests</value>
+ </type>
+ <brief>
+ <value>Queues Functionality.</value>
+ </brief>
+ <description>
+ <value>This sequence tests the NASA OSAL over ChibiOS/RT functionalities related to queues</value>
+ </description>
+ <shared_code>
+ <value><![CDATA[#include "osapi.h"]]></value>
+ </shared_code>
+ <cases>
+ <case>
+ <brief>
+ <value>OS_QueueCreate() and OS_QueueDelete() errors</value>
+ </brief>
+ <description>
+ <value>Parameters checking in OS_QueueCreate() and OS_QueueDelete() 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_QueueCreate() is invoked with queue_id set to NULL, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; + +err = OS_QueueCreate(NULL, /* Error.*/ + "failing queue", + 4, + 128, + 0); +test_assert(err == OS_INVALID_POINTER, "NULL not detected");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>OS_QueueCreate() is invoked with task_name set to NULL, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
<value><![CDATA[int32 err;
+uint32 qid;
-(void) OS_TaskDelay(50);
-err = OS_TaskDelete(tid);
-test_assert(err == OS_SUCCESS, "delete failed");
-test_assert_sequence("ABC", "events order violation");]]></value>
+err = OS_QueueCreate(&qid,
+ NULL, /* Error.*/
+ 4,
+ 128,
+ 0);
+test_assert(err == OS_INVALID_POINTER, "NULL not detected");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>OS_QueueCreate() is invoked with a very long task name, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err;
+uint32 qid;
+
+err = OS_QueueCreate(&qid,
+ "very very long queue name", /* Error.*/
+ 4,
+ 128,
+ 0);
+test_assert(err == OS_ERR_NAME_TOO_LONG, "name limit not detected");]]></value>
+ </code>
+ </step>
+ <step>
+ <description>
+ <value>OS_QueueDelete() is invoked with queue_id set to -1, an error is expected.</value>
+ </description>
+ <tags>
+ <value />
+ </tags>
+ <code>
+ <value><![CDATA[int32 err; + +err = OS_QueueDelete((uint32)-1); +test_assert(err == OS_ERR_INVALID_ID, "wrong queue id not detected");]]></value>
+ </code>
+ </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>
+ </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>
|