aboutsummaryrefslogtreecommitdiffstats
path: root/test/nasa_osal
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-03-22 10:55:31 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-03-22 10:55:31 +0000
commit79bd7cc8ea69d9229d229e69fd5db558ddcb1553 (patch)
tree47aa9a671a40579dedf416504a32ee47d8ed316c /test/nasa_osal
parentd82ac0a69a90df8a74e44e2090e68ae86e930bc1 (diff)
downloadChibiOS-79bd7cc8ea69d9229d229e69fd5db558ddcb1553.tar.gz
ChibiOS-79bd7cc8ea69d9229d229e69fd5db558ddcb1553.tar.bz2
ChibiOS-79bd7cc8ea69d9229d229e69fd5db558ddcb1553.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9147 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'test/nasa_osal')
-rw-r--r--test/nasa_osal/configuration.xml18
-rw-r--r--test/nasa_osal/source/test/test_root.c29
-rw-r--r--test/nasa_osal/source/test/test_root.h41
-rw-r--r--test/nasa_osal/source/test/test_sequence_001.c206
-rw-r--r--test/nasa_osal/source/test/test_sequence_001.h16
-rw-r--r--test/nasa_osal/source/test/test_sequence_002.c161
-rw-r--r--test/nasa_osal/source/test/test_sequence_002.h16
-rw-r--r--test/nasa_osal/source/test/test_sequence_003.c168
-rw-r--r--test/nasa_osal/source/test/test_sequence_003.h16
-rw-r--r--test/nasa_osal/source/test/test_sequence_004.c154
-rw-r--r--test/nasa_osal/source/test/test_sequence_004.h16
-rw-r--r--test/nasa_osal/source/test/test_sequence_005.c140
-rw-r--r--test/nasa_osal/source/test/test_sequence_005.h16
-rw-r--r--test/nasa_osal/source/test/test_sequence_006.c110
-rw-r--r--test/nasa_osal/source/test/test_sequence_006.h16
15 files changed, 478 insertions, 645 deletions
diff --git a/test/nasa_osal/configuration.xml b/test/nasa_osal/configuration.xml
index 1afc1c907..1aadc9b04 100644
--- a/test/nasa_osal/configuration.xml
+++ b/test/nasa_osal/configuration.xml
@@ -46,6 +46,9 @@ THD_WORKING_AREA(wa_test4, TASKS_STACK_SIZE);]]></value>
<description>
<value>This sequence tests the NASA OSAL over ChibiOS/RT functionalities related to threading.</value>
</description>
+ <condition>
+ <value />
+ </condition>
<shared_code>
<value><![CDATA[#include "osapi.h"
@@ -620,6 +623,9 @@ test_assert_sequence("ABC", "events order violation");]]></value>
<description>
<value>This sequence tests the NASA OSAL over ChibiOS/RT functionalities related to queues</value>
</description>
+ <condition>
+ <value />
+ </condition>
<shared_code>
<value><![CDATA[#include <string.h>
@@ -1006,6 +1012,9 @@ test_assert(err == OS_QUEUE_EMPTY, "unexpected error code");]]></value>
<description>
<value>This sequence tests the NASA OSAL over ChibiOS/RT functionalities related to timers</value>
</description>
+ <condition>
+ <value />
+ </condition>
<shared_code>
<value><![CDATA[#include <string.h>
@@ -1446,6 +1455,9 @@ test_assert(err == OS_SUCCESS, "timer stop failed");]]></value>
<description>
<value>This sequence tests the NASA OSAL over ChibiOS/RT functionalities related to binary semaphores.</value>
</description>
+ <condition>
+ <value />
+ </condition>
<shared_code>
<value><![CDATA[#include "osapi.h"
@@ -1871,6 +1883,9 @@ test_assert(err == OS_SEM_TIMEOUT, "unexpected error code");]]></value>
<description>
<value>This sequence tests the NASA OSAL over ChibiOS/RT functionalities related to counter semaphores.</value>
</description>
+ <condition>
+ <value />
+ </condition>
<shared_code>
<value><![CDATA[#include "osapi.h"
@@ -2258,6 +2273,9 @@ test_assert(err == OS_SEM_TIMEOUT, "unexpected error code");]]></value>
<description>
<value>This sequence tests the NASA OSAL over ChibiOS/RT functionalities related to mutex semaphores.</value>
</description>
+ <condition>
+ <value />
+ </condition>
<shared_code>
<value><![CDATA[#include "osapi.h"
diff --git a/test/nasa_osal/source/test/test_root.c b/test/nasa_osal/source/test/test_root.c
index 7ef9d7087..2081b7714 100644
--- a/test/nasa_osal/source/test/test_root.c
+++ b/test/nasa_osal/source/test/test_root.c
@@ -1,18 +1,4 @@
-/*
- ChibiOS - Copyright (C) 2006..2016 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.
-*/
+/* Copyright statement.*/
/**
* @mainpage Test Suite Specification
@@ -33,15 +19,14 @@
/**
* @file test_root.c
* @brief Test Suite root structures code.
- *
- * @addtogroup SPC5_TEST_ROOT
- * @{
*/
#include "hal.h"
#include "ch_test.h"
#include "test_root.h"
+#if !defined(__DOXYGEN__)
+
/*===========================================================================*/
/* Module exported variables. */
/*===========================================================================*/
@@ -63,9 +48,9 @@ const testcase_t * const *test_suite[] = {
/* Shared code. */
/*===========================================================================*/
-THD_WORKING_AREA(wa_test1, TASKS_STACK_SIZE);
-THD_WORKING_AREA(wa_test2, TASKS_STACK_SIZE);
-THD_WORKING_AREA(wa_test3, TASKS_STACK_SIZE);
+THD_WORKING_AREA(wa_test1, TASKS_STACK_SIZE);
+THD_WORKING_AREA(wa_test2, TASKS_STACK_SIZE);
+THD_WORKING_AREA(wa_test3, TASKS_STACK_SIZE);
THD_WORKING_AREA(wa_test4, TASKS_STACK_SIZE);
-/** @} */
+#endif /* !defined(__DOXYGEN__) */
diff --git a/test/nasa_osal/source/test/test_root.h b/test/nasa_osal/source/test/test_root.h
index c8a421ce8..b065fc63d 100644
--- a/test/nasa_osal/source/test/test_root.h
+++ b/test/nasa_osal/source/test/test_root.h
@@ -1,25 +1,8 @@
-/*
- ChibiOS - Copyright (C) 2006..2016 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.
-*/
+/* Copyright statement.*/
/**
* @file test_root.h
* @brief Test Suite root structures header.
- *
- * @addtogroup SPC5_TEST_ROOT
- * @{
*/
#ifndef _SPC5_TEST_ROOT_H_
@@ -32,6 +15,8 @@
#include "test_sequence_005.h"
#include "test_sequence_006.h"
+#if !defined(__DOXYGEN__)
+
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
@@ -49,16 +34,16 @@ extern "C" {
/* Shared definitions. */
/*===========================================================================*/
-#define TEST_SUITE_NAME "NASA OSAL over ChibiOS/RT Test Suite"
-
-#define TASKS_BASE_PRIORITY 200
-#define TASKS_STACK_SIZE 256
-
-extern THD_WORKING_AREA(wa_test1, TASKS_STACK_SIZE);
-extern THD_WORKING_AREA(wa_test2, TASKS_STACK_SIZE);
-extern THD_WORKING_AREA(wa_test3, TASKS_STACK_SIZE);
+#define TEST_SUITE_NAME "NASA OSAL over ChibiOS/RT Test Suite"
+
+#define TASKS_BASE_PRIORITY 200
+#define TASKS_STACK_SIZE 256
+
+extern THD_WORKING_AREA(wa_test1, TASKS_STACK_SIZE);
+extern THD_WORKING_AREA(wa_test2, TASKS_STACK_SIZE);
+extern THD_WORKING_AREA(wa_test3, TASKS_STACK_SIZE);
extern THD_WORKING_AREA(wa_test4, TASKS_STACK_SIZE);
-#endif /* _SPC5_TEST_ROOT_H_ */
+#endif /* !defined(__DOXYGEN__) */
-/** @} */
+#endif /* _SPC5_TEST_ROOT_H_ */
diff --git a/test/nasa_osal/source/test/test_sequence_001.c b/test/nasa_osal/source/test/test_sequence_001.c
index 2e176b984..253dc63c0 100644
--- a/test/nasa_osal/source/test/test_sequence_001.c
+++ b/test/nasa_osal/source/test/test_sequence_001.c
@@ -1,25 +1,11 @@
-/*
- ChibiOS - Copyright (C) 2006..2016 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.
-*/
+/* Copyright statement.*/
#include "hal.h"
#include "ch_test.h"
#include "test_root.h"
/**
- * @page test_sequence_001 Tasks Functionality
+ * @page test_sequence_001 [1] Tasks Functionality
*
* File: @ref test_sequence_001.c
*
@@ -39,41 +25,41 @@
* Shared code.
****************************************************************************/
-#include "osapi.h"
-
-static void test_task1(void) {
-
- test_emit_token('A');
-}
-
-static void test_task2(void) {
-
- test_emit_token('B');
-}
-
-static void test_task3(void) {
-
- test_emit_token('C');
-}
-
-static void test_task4(void) {
-
- test_emit_token('D');
-}
-
-static void delete_handler(void) {
-
- test_emit_token('C');
-}
-
-static void test_task_delete(void) {
-
- test_emit_token('A');
- (void) OS_TaskInstallDeleteHandler(delete_handler);
- while (!OS_TaskDeleteCheck()) {
- (void) OS_TaskDelay(1);
- }
- test_emit_token('B');
+#include "osapi.h"
+
+static void test_task1(void) {
+
+ test_emit_token('A');
+}
+
+static void test_task2(void) {
+
+ test_emit_token('B');
+}
+
+static void test_task3(void) {
+
+ test_emit_token('C');
+}
+
+static void test_task4(void) {
+
+ test_emit_token('D');
+}
+
+static void delete_handler(void) {
+
+ test_emit_token('C');
+}
+
+static void test_task_delete(void) {
+
+ test_emit_token('A');
+ (void) OS_TaskInstallDeleteHandler(delete_handler);
+ while (!OS_TaskDeleteCheck()) {
+ (void) OS_TaskDelay(1);
+ }
+ test_emit_token('B');
}
/****************************************************************************
@@ -81,33 +67,33 @@ static void test_task_delete(void) {
****************************************************************************/
/**
- * @page test_001_001 OS_TaskCreate() errors
+ * @page test_001_001 [1.1] OS_TaskCreate() errors
*
* <h2>Description</h2>
* Parameters checking in OS_TaskCreate() is tested.
*
* <h2>Test Steps</h2>
- * - OS_TaskCreate() is invoked with task_id set to NULL, an error is
- * expected.
- * - OS_TaskCreate() is invoked with task_name set to NULL, an error is
- * expected.
- * - OS_TaskCreate() is invoked with stack_pointer set to NULL, an
+ * - [1.1.1] OS_TaskCreate() is invoked with task_id set to NULL, an
+ * error is expected.
+ * - [1.1.2] OS_TaskCreate() is invoked with task_name set to NULL, an
* error is expected.
- * - OS_TaskCreate() is invoked with a very long task name, an error is
- * expected.
- * - OS_TaskCreate() is invoked with priority below and above allowed
- * range, an error is expected.
- * - OS_TaskCreate() is invoked with a stack size below minimum, an
+ * - [1.1.3] OS_TaskCreate() is invoked with stack_pointer set to NULL,
+ * an error is expected.
+ * - [1.1.4] OS_TaskCreate() is invoked with a very long task name, an
* error is expected.
- * - OS_TaskCreate() is invoked twice with duplicated name and then
- * duplicated stack, an error is expected in both cases.
+ * - [1.1.5] OS_TaskCreate() is invoked with priority below and above
+ * allowed range, an error is expected.
+ * - [1.1.6] OS_TaskCreate() is invoked with a stack size below
+ * minimum, an error is expected.
+ * - [1.1.7] OS_TaskCreate() is invoked twice with duplicated name and
+ * then duplicated stack, an error is expected in both cases.
* .
*/
static void test_001_001_execute(void) {
- /* OS_TaskCreate() is invoked with task_id set to NULL, an error is
- expected.*/
+ /* [1.1.1] OS_TaskCreate() is invoked with task_id set to NULL, an
+ error is expected.*/
test_set_step(1);
{
int32 err;
@@ -123,8 +109,8 @@ static void test_001_001_execute(void) {
test_assert_sequence("", "task executed");
}
- /* OS_TaskCreate() is invoked with task_name set to NULL, an error is
- expected.*/
+ /* [1.1.2] OS_TaskCreate() is invoked with task_name set to NULL, an
+ error is expected.*/
test_set_step(2);
{
int32 err;
@@ -141,8 +127,8 @@ static void test_001_001_execute(void) {
test_assert_sequence("", "task executed");
}
- /* OS_TaskCreate() is invoked with stack_pointer set to NULL, an
- error is expected.*/
+ /* [1.1.3] OS_TaskCreate() is invoked with stack_pointer set to NULL,
+ an error is expected.*/
test_set_step(3);
{
int32 err;
@@ -159,8 +145,8 @@ static void test_001_001_execute(void) {
test_assert_sequence("", "task executed");
}
- /* OS_TaskCreate() is invoked with a very long task name, an error is
- expected.*/
+ /* [1.1.4] OS_TaskCreate() is invoked with a very long task name, an
+ error is expected.*/
test_set_step(4);
{
int32 err;
@@ -177,8 +163,8 @@ static void test_001_001_execute(void) {
test_assert_sequence("", "task executed");
}
- /* OS_TaskCreate() is invoked with priority below and above allowed
- range, an error is expected.*/
+ /* [1.1.5] OS_TaskCreate() is invoked with priority below and above
+ allowed range, an error is expected.*/
test_set_step(5);
{
int32 err;
@@ -205,8 +191,8 @@ static void test_001_001_execute(void) {
test_assert_sequence("", "task executed");
}
- /* OS_TaskCreate() is invoked with a stack size below minimum, an
- error is expected.*/
+ /* [1.1.6] OS_TaskCreate() is invoked with a stack size below
+ minimum, an error is expected.*/
test_set_step(6);
{
int32 err;
@@ -223,8 +209,8 @@ static void test_001_001_execute(void) {
test_assert_sequence("", "task executed");
}
- /* OS_TaskCreate() is invoked twice with duplicated name and then
- duplicated stack, an error is expected in both cases.*/
+ /* [1.1.7] OS_TaskCreate() is invoked twice with duplicated name and
+ then duplicated stack, an error is expected in both cases.*/
test_set_step(7);
{
int32 err;
@@ -284,7 +270,7 @@ static const testcase_t test_001_001 = {
};
/**
- * @page test_001_002 OS_TaskCreate() priority ordering
+ * @page test_001_002 [1.2] OS_TaskCreate() priority ordering
*
* <h2>Description</h2>
* Four tasks are created at different priorities and in different
@@ -292,21 +278,22 @@ static const testcase_t test_001_001 = {
* regardless the creation order.
*
* <h2>Test Steps</h2>
- * - Four tasks are created in priority order from low to high.
- * - Tasks are made runnable atomically and their execution order
- * tested.
- * - Four tasks are created in priority order from high to low.
- * - Tasks are made runnable atomically and their execution order
- * tested.
- * - Four tasks are created in an not ordered way.
- * - Tasks are made runnable atomically and their execution order
- * tested.
+ * - [1.2.1] Four tasks are created in priority order from low to high.
+ * - [1.2.2] Tasks are made runnable atomically and their execution
+ * order tested.
+ * - [1.2.3] Four tasks are created in priority order from high to low.
+ * - [1.2.4] Tasks are made runnable atomically and their execution
+ * order tested.
+ * - [1.2.5] Four tasks are created in an not ordered way.
+ * - [1.2.6] Tasks are made runnable atomically and their execution
+ * order tested.
* .
*/
static void test_001_002_execute(void) {
- /* Four tasks are created in priority order from low to high.*/
+ /* [1.2.1] Four tasks are created in priority order from low to
+ high.*/
test_set_step(1);
{
int32 err;
@@ -349,15 +336,16 @@ static void test_001_002_execute(void) {
test_assert(err == OS_SUCCESS, "task 1 creation failed");
}
- /* Tasks are made runnable atomically and their execution order
- tested.*/
+ /* [1.2.2] Tasks are made runnable atomically and their execution
+ order tested.*/
test_set_step(2);
{
OS_TaskDelay(5);
test_assert_sequence("ABCD", "task order violation");
}
- /* Four tasks are created in priority order from high to low.*/
+ /* [1.2.3] Four tasks are created in priority order from high to
+ low.*/
test_set_step(3);
{
int32 err;
@@ -400,15 +388,15 @@ static void test_001_002_execute(void) {
test_assert(err == OS_SUCCESS, "task 4 creation failed");
}
- /* Tasks are made runnable atomically and their execution order
- tested.*/
+ /* [1.2.4] Tasks are made runnable atomically and their execution
+ order tested.*/
test_set_step(4);
{
OS_TaskDelay(5);
test_assert_sequence("ABCD", "task order violation");
}
- /* Four tasks are created in an not ordered way.*/
+ /* [1.2.5] Four tasks are created in an not ordered way.*/
test_set_step(5);
{
int32 err;
@@ -451,8 +439,8 @@ static void test_001_002_execute(void) {
test_assert(err == OS_SUCCESS, "task 3 creation failed");
}
- /* Tasks are made runnable atomically and their execution order
- tested.*/
+ /* [1.2.6] Tasks are made runnable atomically and their execution
+ order tested.*/
test_set_step(6);
{
OS_TaskDelay(5);
@@ -468,21 +456,21 @@ static const testcase_t test_001_002 = {
};
/**
- * @page test_001_003 OS_TaskDelete() errors
+ * @page test_001_003 [1.3] OS_TaskDelete() errors
*
* <h2>Description</h2>
* Parameters checking in OS_TaskDelete() is tested.
*
* <h2>Test Steps</h2>
- * - OS_TaskDelete() is invoked with task_id set to -1, an error is
- * expected.
+ * - [1.3.1] OS_TaskDelete() is invoked with task_id set to -1, an
+ * error is expected.
* .
*/
static void test_001_003_execute(void) {
- /* OS_TaskDelete() is invoked with task_id set to -1, an error is
- expected.*/
+ /* [1.3.1] OS_TaskDelete() is invoked with task_id set to -1, an
+ error is expected.*/
test_set_step(1);
{
int32 err;
@@ -500,23 +488,23 @@ static const testcase_t test_001_003 = {
};
/**
- * @page test_001_004 OS_TaskDelete() and OS_TaskInstallDeleteHandler() functionality
+ * @page test_001_004 [1.4] OS_TaskDelete() and OS_TaskInstallDeleteHandler() functionality
*
* <h2>Description</h2>
* OS_TaskDelete() and OS_TaskInstallDeleteHandler() are tested for
* functionality.
*
* <h2>Test Steps</h2>
- * - Creating a task executing an infinite loop.
- * - Letting the task run for a while then deleting it. A check is
- * performed on the correct execution of the delete handler.
+ * - [1.4.1] Creating a task executing an infinite loop.
+ * - [1.4.2] Letting the task run for a while then deleting it. A check
+ * is performed on the correct execution of the delete handler.
* .
*/
static void test_001_004_execute(void) {
uint32 tid;
- /* Creating a task executing an infinite loop.*/
+ /* [1.4.1] Creating a task executing an infinite loop.*/
test_set_step(1);
{
int32 err;
@@ -531,8 +519,8 @@ static void test_001_004_execute(void) {
test_assert(err == OS_SUCCESS, "deletable task creation failed");
}
- /* Letting the task run for a while then deleting it. A check is
- performed on the correct execution of the delete handler.*/
+ /* [1.4.2] Letting the task run for a while then deleting it. A check
+ is performed on the correct execution of the delete handler.*/
test_set_step(2);
{
int32 err;
diff --git a/test/nasa_osal/source/test/test_sequence_001.h b/test/nasa_osal/source/test/test_sequence_001.h
index 9ba5dc4be..bd39c2d2c 100644
--- a/test/nasa_osal/source/test/test_sequence_001.h
+++ b/test/nasa_osal/source/test/test_sequence_001.h
@@ -1,17 +1,3 @@
-/*
- ChibiOS - Copyright (C) 2006..2016 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.
-*/
+/* Copyright statement.*/
extern const testcase_t * const test_sequence_001[];
diff --git a/test/nasa_osal/source/test/test_sequence_002.c b/test/nasa_osal/source/test/test_sequence_002.c
index 1332af727..35a856882 100644
--- a/test/nasa_osal/source/test/test_sequence_002.c
+++ b/test/nasa_osal/source/test/test_sequence_002.c
@@ -1,25 +1,11 @@
-/*
- ChibiOS - Copyright (C) 2006..2016 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.
-*/
+/* Copyright statement.*/
#include "hal.h"
#include "ch_test.h"
#include "test_root.h"
/**
- * @page test_sequence_002 Queues Functionality
+ * @page test_sequence_002 [2] Queues Functionality
*
* File: @ref test_sequence_002.c
*
@@ -39,25 +25,25 @@
* Shared code.
****************************************************************************/
-#include <string.h>
-
-#include "osapi.h"
-
-uint32 qid, tid;
-
-#define WRITER_NUM_MESSAGES 16
-#define MESSAGE_SIZE 20
-
-static void test_task_writer(void) {
- unsigned i;
- int32 err;
-
- for (i = 0; i < WRITER_NUM_MESSAGES; i++) {
- err = OS_QueuePut(qid, "Hello World", 12, 0);
- if (err != OS_SUCCESS) {
- test_emit_token('*');
- }
- }
+#include <string.h>
+
+#include "osapi.h"
+
+uint32 qid, tid;
+
+#define WRITER_NUM_MESSAGES 16
+#define MESSAGE_SIZE 20
+
+static void test_task_writer(void) {
+ unsigned i;
+ int32 err;
+
+ for (i = 0; i < WRITER_NUM_MESSAGES; i++) {
+ err = OS_QueuePut(qid, "Hello World", 12, 0);
+ if (err != OS_SUCCESS) {
+ test_emit_token('*');
+ }
+ }
}
/****************************************************************************
@@ -65,30 +51,31 @@ static void test_task_writer(void) {
****************************************************************************/
/**
- * @page test_002_001 OS_QueueCreate() and OS_QueueDelete() errors
+ * @page test_002_001 [2.1] OS_QueueCreate() and OS_QueueDelete() errors
*
* <h2>Description</h2>
* Parameters checking in OS_QueueCreate() and OS_QueueDelete() is
* tested.
*
* <h2>Test Steps</h2>
- * - OS_QueueCreate() is invoked with queue_id set to NULL, an error is
- * expected.
- * - OS_QueueCreate() is invoked with task_name set to NULL, an error
- * is expected.
- * - OS_QueueCreate() is invoked with a very long task name, an error
- * is expected.
- * - OS_QueueDelete() is invoked with queue_id set to -1, an error is
- * expected.
- * - OS_QueueCreate() is invoked twice with duplicated name, an error
- * is expected, then the queue is deleted using OS_QueueDelete().
+ * - [2.1.1] OS_QueueCreate() is invoked with queue_id set to NULL, an
+ * error is expected.
+ * - [2.1.2] OS_QueueCreate() is invoked with task_name set to NULL, an
+ * error is expected.
+ * - [2.1.3] OS_QueueCreate() is invoked with a very long task name, an
+ * error is expected.
+ * - [2.1.4] OS_QueueDelete() is invoked with queue_id set to -1, an
+ * error is expected.
+ * - [2.1.5] OS_QueueCreate() is invoked twice with duplicated name, an
+ * error is expected, then the queue is deleted using
+ * OS_QueueDelete().
* .
*/
static void test_002_001_execute(void) {
- /* OS_QueueCreate() is invoked with queue_id set to NULL, an error is
- expected.*/
+ /* [2.1.1] OS_QueueCreate() is invoked with queue_id set to NULL, an
+ error is expected.*/
test_set_step(1);
{
int32 err;
@@ -101,8 +88,8 @@ static void test_002_001_execute(void) {
test_assert(err == OS_INVALID_POINTER, "NULL not detected");
}
- /* OS_QueueCreate() is invoked with task_name set to NULL, an error
- is expected.*/
+ /* [2.1.2] OS_QueueCreate() is invoked with task_name set to NULL, an
+ error is expected.*/
test_set_step(2);
{
int32 err;
@@ -116,8 +103,8 @@ static void test_002_001_execute(void) {
test_assert(err == OS_INVALID_POINTER, "NULL not detected");
}
- /* OS_QueueCreate() is invoked with a very long task name, an error
- is expected.*/
+ /* [2.1.3] OS_QueueCreate() is invoked with a very long task name, an
+ error is expected.*/
test_set_step(3);
{
int32 err;
@@ -131,8 +118,8 @@ static void test_002_001_execute(void) {
test_assert(err == OS_ERR_NAME_TOO_LONG, "name limit not detected");
}
- /* OS_QueueDelete() is invoked with queue_id set to -1, an error is
- expected.*/
+ /* [2.1.4] OS_QueueDelete() is invoked with queue_id set to -1, an
+ error is expected.*/
test_set_step(4);
{
int32 err;
@@ -141,8 +128,9 @@ static void test_002_001_execute(void) {
test_assert(err == OS_ERR_INVALID_ID, "wrong queue id not detected");
}
- /* OS_QueueCreate() is invoked twice with duplicated name, an error
- is expected, then the queue is deleted using OS_QueueDelete().*/
+ /* [2.1.5] OS_QueueCreate() is invoked twice with duplicated name, an
+ error is expected, then the queue is deleted using
+ OS_QueueDelete().*/
test_set_step(5);
{
int32 err;
@@ -167,25 +155,25 @@ static const testcase_t test_002_001 = {
};
/**
- * @page test_002_002 OS_QueueGetIdByName() errors
+ * @page test_002_002 [2.2] OS_QueueGetIdByName() errors
*
* <h2>Description</h2>
* Parameters checking in OS_QueueGetIdByName() is tested.
*
* <h2>Test Steps</h2>
- * - OS_QueueGetIdByName() is invoked with queue_id set to NULL, an
- * error is expected.
- * - OS_QueueGetIdByName() is invoked with queue_name set to NULL, an
- * error is expected.
- * - OS_QueueGetIdByName() is invoked with a very long task name, an
- * error is expected.
+ * - [2.2.1] OS_QueueGetIdByName() is invoked with queue_id set to
+ * NULL, an error is expected.
+ * - [2.2.2] OS_QueueGetIdByName() is invoked with queue_name set to
+ * NULL, an error is expected.
+ * - [2.2.3] OS_QueueGetIdByName() is invoked with a very long task
+ * name, an error is expected.
* .
*/
static void test_002_002_execute(void) {
- /* OS_QueueGetIdByName() is invoked with queue_id set to NULL, an
- error is expected.*/
+ /* [2.2.1] OS_QueueGetIdByName() is invoked with queue_id set to
+ NULL, an error is expected.*/
test_set_step(1);
{
int32 err;
@@ -194,8 +182,8 @@ static void test_002_002_execute(void) {
test_assert(err == OS_INVALID_POINTER, "NULL not detected");
}
- /* OS_QueueGetIdByName() is invoked with queue_name set to NULL, an
- error is expected.*/
+ /* [2.2.2] OS_QueueGetIdByName() is invoked with queue_name set to
+ NULL, an error is expected.*/
test_set_step(2);
{
int32 err;
@@ -204,8 +192,8 @@ static void test_002_002_execute(void) {
test_assert(err == OS_INVALID_POINTER, "NULL not detected");
}
- /* OS_QueueGetIdByName() is invoked with a very long task name, an
- error is expected.*/
+ /* [2.2.3] OS_QueueGetIdByName() is invoked with a very long task
+ name, an error is expected.*/
test_set_step(3);
{
int32 err;
@@ -223,17 +211,17 @@ static const testcase_t test_002_002 = {
};
/**
- * @page test_002_003 OS_QueuePut() and OS_QueueGet() functionality
+ * @page test_002_003 [2.3] OS_QueuePut() and OS_QueueGet() functionality
*
* <h2>Description</h2>
* A task writes on a queue, the messages are retrieved on the other
* side in blocking mode.
*
* <h2>Test Steps</h2>
- * - Creataing a queue with depth 4 and message size 20.
- * - Creating the writer task.
- * - Reading messages from the writer task.
- * - Waiting for task termination then checking for errors.
+ * - [2.3.1] Creataing a queue with depth 4 and message size 20.
+ * - [2.3.2] Creating the writer task.
+ * - [2.3.3] Reading messages from the writer task.
+ * - [2.3.4] Waiting for task termination then checking for errors.
* .
*/
@@ -256,7 +244,7 @@ static void test_002_003_execute(void) {
uint32 tid;
unsigned i;
- /* Creataing a queue with depth 4 and message size 20.*/
+ /* [2.3.1] Creataing a queue with depth 4 and message size 20.*/
test_set_step(1);
{
int32 err;
@@ -265,7 +253,7 @@ static void test_002_003_execute(void) {
test_assert(err == OS_SUCCESS, "queue creation failed");
}
- /* Creating the writer task.*/
+ /* [2.3.2] Creating the writer task.*/
test_set_step(2);
{
int32 err;
@@ -280,7 +268,7 @@ static void test_002_003_execute(void) {
test_assert(err == OS_SUCCESS, "writer task creation failed");
}
- /* Reading messages from the writer task.*/
+ /* [2.3.3] Reading messages from the writer task.*/
test_set_step(3);
{
for (i = 0; i < WRITER_NUM_MESSAGES; i++) {
@@ -295,7 +283,7 @@ static void test_002_003_execute(void) {
}
}
- /* Waiting for task termination then checking for errors.*/
+ /* [2.3.4] Waiting for task termination then checking for errors.*/
test_set_step(4);
{
(void) OS_TaskWait(tid);
@@ -312,15 +300,16 @@ static const testcase_t test_002_003 = {
};
/**
- * @page test_002_004 OS_QueueGet() with timeout functionality
+ * @page test_002_004 [2.4] OS_QueueGet() with timeout functionality
*
* <h2>Description</h2>
* OS_QueueGet() timeout functionality is tested.
*
* <h2>Test Steps</h2>
- * - Retrieving the queue by name.
- * - Get operation with a one second timeout, an error is expected.
- * - Get operation in non-blocking mode, an error is expected.
+ * - [2.4.1] Retrieving the queue by name.
+ * - [2.4.2] Get operation with a one second timeout, an error is
+ * expected.
+ * - [2.4.3] Get operation in non-blocking mode, an error is expected.
* .
*/
@@ -340,7 +329,7 @@ static void test_002_004_execute(void) {
uint32 copied;
char data[MESSAGE_SIZE];
- /* Retrieving the queue by name.*/
+ /* [2.4.1] Retrieving the queue by name.*/
test_set_step(1);
{
int32 err;
@@ -349,7 +338,8 @@ static void test_002_004_execute(void) {
test_assert(err == OS_SUCCESS, "queue not found");
}
- /* Get operation with a one second timeout, an error is expected.*/
+ /* [2.4.2] Get operation with a one second timeout, an error is
+ expected.*/
test_set_step(2);
{
int32 err;
@@ -358,7 +348,8 @@ static void test_002_004_execute(void) {
test_assert(err == OS_QUEUE_TIMEOUT, "unexpected error code");
}
- /* Get operation in non-blocking mode, an error is expected.*/
+ /* [2.4.3] Get operation in non-blocking mode, an error is
+ expected.*/
test_set_step(3);
{
int32 err;
diff --git a/test/nasa_osal/source/test/test_sequence_002.h b/test/nasa_osal/source/test/test_sequence_002.h
index b408f96f4..422e93896 100644
--- a/test/nasa_osal/source/test/test_sequence_002.h
+++ b/test/nasa_osal/source/test/test_sequence_002.h
@@ -1,17 +1,3 @@
-/*
- ChibiOS - Copyright (C) 2006..2016 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.
-*/
+/* Copyright statement.*/
extern const testcase_t * const test_sequence_002[];
diff --git a/test/nasa_osal/source/test/test_sequence_003.c b/test/nasa_osal/source/test/test_sequence_003.c
index b42f4de9d..e699248f1 100644
--- a/test/nasa_osal/source/test/test_sequence_003.c
+++ b/test/nasa_osal/source/test/test_sequence_003.c
@@ -1,25 +1,11 @@
-/*
- ChibiOS - Copyright (C) 2006..2016 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.
-*/
+/* Copyright statement.*/
#include "hal.h"
#include "ch_test.h"
#include "test_root.h"
/**
- * @page test_sequence_003 Timers Functionality
+ * @page test_sequence_003 [3] Timers Functionality
*
* File: @ref test_sequence_003.c
*
@@ -40,18 +26,18 @@
* Shared code.
****************************************************************************/
-#include <string.h>
-
-#include "osapi.h"
-
-uint32 tmid;
-uint32 cnt;
-
-static void tmr_callback(uint32 timer_id) {
-
- (void)timer_id;
-
- cnt++;
+#include <string.h>
+
+#include "osapi.h"
+
+uint32 tmid;
+uint32 cnt;
+
+static void tmr_callback(uint32 timer_id) {
+
+ (void)timer_id;
+
+ cnt++;
}
/****************************************************************************
@@ -59,34 +45,35 @@ static void tmr_callback(uint32 timer_id) {
****************************************************************************/
/**
- * @page test_003_001 OS_TimerCreate() and OS_TimerDelete() errors
+ * @page test_003_001 [3.1] OS_TimerCreate() and OS_TimerDelete() errors
*
* <h2>Description</h2>
* Parameters checking in OS_TimerCreate() and OS_TimerDelete() is
* tested.
*
* <h2>Test Steps</h2>
- * - OS_TimerCreate() is invoked with timer_id set to NULL, an error is
- * expected.
- * - OS_TimerCreate() is invoked with timer_name set to NULL, an error
- * is expected.
- * - OS_TimerCreate() is invoked with accuracy set to NULL, an error is
- * expected.
- * - OS_TimerCreate() is invoked with callback_ptr set to NULL, an
+ * - [3.1.1] OS_TimerCreate() is invoked with timer_id set to NULL, an
* error is expected.
- * - OS_TimerCreate() is invoked with a very long timer name, an error
- * is expected.
- * - OS_TimerDelete() is invoked with timer_id set to -1, an error is
- * expected.
- * - OS_TimerCreate() is invoked twice with duplicated name, an error
- * is expected, then the queue is deleted using OS_TimerDelete().
+ * - [3.1.2] OS_TimerCreate() is invoked with timer_name set to NULL,
+ * an error is expected.
+ * - [3.1.3] OS_TimerCreate() is invoked with accuracy set to NULL, an
+ * error is expected.
+ * - [3.1.4] OS_TimerCreate() is invoked with callback_ptr set to NULL,
+ * an error is expected.
+ * - [3.1.5] OS_TimerCreate() is invoked with a very long timer name,
+ * an error is expected.
+ * - [3.1.6] OS_TimerDelete() is invoked with timer_id set to -1, an
+ * error is expected.
+ * - [3.1.7] OS_TimerCreate() is invoked twice with duplicated name, an
+ * error is expected, then the queue is deleted using
+ * OS_TimerDelete().
* .
*/
static void test_003_001_execute(void) {
- /* OS_TimerCreate() is invoked with timer_id set to NULL, an error is
- expected.*/
+ /* [3.1.1] OS_TimerCreate() is invoked with timer_id set to NULL, an
+ error is expected.*/
test_set_step(1);
{
int32 err;
@@ -99,8 +86,8 @@ static void test_003_001_execute(void) {
test_assert(err == OS_INVALID_POINTER, "NULL not detected");
}
- /* OS_TimerCreate() is invoked with timer_name set to NULL, an error
- is expected.*/
+ /* [3.1.2] OS_TimerCreate() is invoked with timer_name set to NULL,
+ an error is expected.*/
test_set_step(2);
{
int32 err;
@@ -114,8 +101,8 @@ static void test_003_001_execute(void) {
test_assert(err == OS_INVALID_POINTER, "NULL not detected");
}
- /* OS_TimerCreate() is invoked with accuracy set to NULL, an error is
- expected.*/
+ /* [3.1.3] OS_TimerCreate() is invoked with accuracy set to NULL, an
+ error is expected.*/
test_set_step(3);
{
int32 err;
@@ -128,8 +115,8 @@ static void test_003_001_execute(void) {
test_assert(err == OS_INVALID_POINTER, "NULL not detected");
}
- /* OS_TimerCreate() is invoked with callback_ptr set to NULL, an
- error is expected.*/
+ /* [3.1.4] OS_TimerCreate() is invoked with callback_ptr set to NULL,
+ an error is expected.*/
test_set_step(4);
{
int32 err;
@@ -143,8 +130,8 @@ static void test_003_001_execute(void) {
test_assert(err == OS_TIMER_ERR_INVALID_ARGS, "NULL not detected");
}
- /* OS_TimerCreate() is invoked with a very long timer name, an error
- is expected.*/
+ /* [3.1.5] OS_TimerCreate() is invoked with a very long timer name,
+ an error is expected.*/
test_set_step(5);
{
int32 err;
@@ -158,8 +145,8 @@ static void test_003_001_execute(void) {
test_assert(err == OS_ERR_NAME_TOO_LONG, "name limit not detected");
}
- /* OS_TimerDelete() is invoked with timer_id set to -1, an error is
- expected.*/
+ /* [3.1.6] OS_TimerDelete() is invoked with timer_id set to -1, an
+ error is expected.*/
test_set_step(6);
{
int32 err;
@@ -168,8 +155,9 @@ static void test_003_001_execute(void) {
test_assert(err == OS_ERR_INVALID_ID, "wrong timer id not detected");
}
- /* OS_TimerCreate() is invoked twice with duplicated name, an error
- is expected, then the queue is deleted using OS_TimerDelete().*/
+ /* [3.1.7] OS_TimerCreate() is invoked twice with duplicated name, an
+ error is expected, then the queue is deleted using
+ OS_TimerDelete().*/
test_set_step(7);
{
int32 err;
@@ -195,21 +183,21 @@ static const testcase_t test_003_001 = {
};
/**
- * @page test_003_002 OS_TimerSet() errors
+ * @page test_003_002 [3.2] OS_TimerSet() errors
*
* <h2>Description</h2>
* Parameters checking in OS_TimerSet() is tested.
*
* <h2>Test Steps</h2>
- * - OS_TimerSet() is invoked with timer_id set to -1, an error is
- * expected.
+ * - [3.2.1] OS_TimerSet() is invoked with timer_id set to -1, an error
+ * is expected.
* .
*/
static void test_003_002_execute(void) {
- /* OS_TimerSet() is invoked with timer_id set to -1, an error is
- expected.*/
+ /* [3.2.1] OS_TimerSet() is invoked with timer_id set to -1, an error
+ is expected.*/
test_set_step(1);
{
int32 err;
@@ -227,25 +215,25 @@ static const testcase_t test_003_002 = {
};
/**
- * @page test_003_003 OS_TimerGetIdByName() errors
+ * @page test_003_003 [3.3] OS_TimerGetIdByName() errors
*
* <h2>Description</h2>
* Parameters checking in OS_TimerGetIdByName() is tested.
*
* <h2>Test Steps</h2>
- * - OS_TimerGetIdByName() is invoked with timer_id set to NULL, an
- * error is expected.
- * - OS_TimerGetIdByName() is invoked with timer name set to NULL, an
- * error is expected.
- * - OS_TimerGetIdByName() is invoked with a very long task name, an
- * error is expected.
+ * - [3.3.1] OS_TimerGetIdByName() is invoked with timer_id set to
+ * NULL, an error is expected.
+ * - [3.3.2] OS_TimerGetIdByName() is invoked with timer name set to
+ * NULL, an error is expected.
+ * - [3.3.3] OS_TimerGetIdByName() is invoked with a very long task
+ * name, an error is expected.
* .
*/
static void test_003_003_execute(void) {
- /* OS_TimerGetIdByName() is invoked with timer_id set to NULL, an
- error is expected.*/
+ /* [3.3.1] OS_TimerGetIdByName() is invoked with timer_id set to
+ NULL, an error is expected.*/
test_set_step(1);
{
int32 err;
@@ -254,8 +242,8 @@ static void test_003_003_execute(void) {
test_assert(err == OS_INVALID_POINTER, "NULL not detected");
}
- /* OS_TimerGetIdByName() is invoked with timer name set to NULL, an
- error is expected.*/
+ /* [3.3.2] OS_TimerGetIdByName() is invoked with timer name set to
+ NULL, an error is expected.*/
test_set_step(2);
{
int32 err;
@@ -264,8 +252,8 @@ static void test_003_003_execute(void) {
test_assert(err == OS_INVALID_POINTER, "NULL not detected");
}
- /* OS_TimerGetIdByName() is invoked with a very long task name, an
- error is expected.*/
+ /* [3.3.3] OS_TimerGetIdByName() is invoked with a very long task
+ name, an error is expected.*/
test_set_step(3);
{
int32 err;
@@ -283,15 +271,15 @@ static const testcase_t test_003_003 = {
};
/**
- * @page test_003_004 OS_TimerSet() one-shot functionality
+ * @page test_003_004 [3.4] OS_TimerSet() one-shot functionality
*
* <h2>Description</h2>
* A timer is tested in one-shot mode.
*
* <h2>Test Steps</h2>
- * - Retrieving the timer by name.
- * - Setting up the timer for a 70mS one-shot tick.
- * - Waiting one second then counting the occurred ticks.
+ * - [3.4.1] Retrieving the timer by name.
+ * - [3.4.2] Setting up the timer for a 70mS one-shot tick.
+ * - [3.4.3] Waiting one second then counting the occurred ticks.
* .
*/
@@ -312,7 +300,7 @@ static void test_003_004_teardown(void) {
static void test_003_004_execute(void) {
uint32 local_tmid;
- /* Retrieving the timer by name.*/
+ /* [3.4.1] Retrieving the timer by name.*/
test_set_step(1);
{
int32 err;
@@ -321,7 +309,7 @@ static void test_003_004_execute(void) {
test_assert(err == OS_SUCCESS, "timer not found");
}
- /* Setting up the timer for a 70mS one-shot tick.*/
+ /* [3.4.2] Setting up the timer for a 70mS one-shot tick.*/
test_set_step(2);
{
uint32 err;
@@ -330,7 +318,7 @@ static void test_003_004_execute(void) {
test_assert(err == OS_SUCCESS, "timer setup failed");
}
- /* Waiting one second then counting the occurred ticks.*/
+ /* [3.4.3] Waiting one second then counting the occurred ticks.*/
test_set_step(3);
{
(void) OS_TaskDelay(1000);
@@ -346,16 +334,16 @@ static const testcase_t test_003_004 = {
};
/**
- * @page test_003_005 OS_TimerSet() periodic functionality
+ * @page test_003_005 [3.5] OS_TimerSet() periodic functionality
*
* <h2>Description</h2>
* A timer is tested in periodic mode.
*
* <h2>Test Steps</h2>
- * - Retrieving the timer by name.
- * - Setting up the timer for a 70mS periodic tick.
- * - Waiting one second then counting the occurred ticks.
- * - Stopping the timer.
+ * - [3.5.1] Retrieving the timer by name.
+ * - [3.5.2] Setting up the timer for a 70mS periodic tick.
+ * - [3.5.3] Waiting one second then counting the occurred ticks.
+ * - [3.5.4] Stopping the timer.
* .
*/
@@ -377,7 +365,7 @@ static void test_003_005_teardown(void) {
static void test_003_005_execute(void) {
uint32 local_tmid;
- /* Retrieving the timer by name.*/
+ /* [3.5.1] Retrieving the timer by name.*/
test_set_step(1);
{
int32 err;
@@ -386,7 +374,7 @@ static void test_003_005_execute(void) {
test_assert(err == OS_SUCCESS, "timer not found");
}
- /* Setting up the timer for a 70mS periodic tick.*/
+ /* [3.5.2] Setting up the timer for a 70mS periodic tick.*/
test_set_step(2);
{
uint32 err;
@@ -395,14 +383,14 @@ static void test_003_005_execute(void) {
test_assert(err == OS_SUCCESS, "timer setup failed");
}
- /* Waiting one second then counting the occurred ticks.*/
+ /* [3.5.3] Waiting one second then counting the occurred ticks.*/
test_set_step(3);
{
(void) OS_TaskDelay(1000);
test_assert(cnt == 14, "wrong ticks");
}
- /* Stopping the timer.*/
+ /* [3.5.4] Stopping the timer.*/
test_set_step(4);
{
uint32 err;
diff --git a/test/nasa_osal/source/test/test_sequence_003.h b/test/nasa_osal/source/test/test_sequence_003.h
index ca7045528..0cec58279 100644
--- a/test/nasa_osal/source/test/test_sequence_003.h
+++ b/test/nasa_osal/source/test/test_sequence_003.h
@@ -1,17 +1,3 @@
-/*
- ChibiOS - Copyright (C) 2006..2016 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.
-*/
+/* Copyright statement.*/
extern const testcase_t * const test_sequence_003[];
diff --git a/test/nasa_osal/source/test/test_sequence_004.c b/test/nasa_osal/source/test/test_sequence_004.c
index 4e4bb977b..6f2fa76c9 100644
--- a/test/nasa_osal/source/test/test_sequence_004.c
+++ b/test/nasa_osal/source/test/test_sequence_004.c
@@ -1,25 +1,11 @@
-/*
- ChibiOS - Copyright (C) 2006..2016 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.
-*/
+/* Copyright statement.*/
#include "hal.h"
#include "ch_test.h"
#include "test_root.h"
/**
- * @page test_sequence_004 Binary Semaphores Functionality
+ * @page test_sequence_004 [4] Binary Semaphores Functionality
*
* File: @ref test_sequence_004.c
*
@@ -42,8 +28,8 @@
* Shared code.
****************************************************************************/
-#include "osapi.h"
-
+#include "osapi.h"
+
uint32 bsid;
/****************************************************************************
@@ -51,32 +37,33 @@ uint32 bsid;
****************************************************************************/
/**
- * @page test_004_001 OS_BinSemCreate() and OS_BinSemDelete() errors
+ * @page test_004_001 [4.1] OS_BinSemCreate() and OS_BinSemDelete() errors
*
* <h2>Description</h2>
* Parameters checking in OS_BinSemCreate() and OS_BinSemDelete() is
* tested.
*
* <h2>Test Steps</h2>
- * - OS_BinSemCreate() is invoked with sem_id set to NULL, an error is
- * expected.
- * - OS_BinSemCreate() is invoked with sem_name set to NULL, an error
- * is expected.
- * - OS_BinSemCreate() is invoked with an invalid sem_initial_value, an
+ * - [4.1.1] OS_BinSemCreate() is invoked with sem_id set to NULL, an
* error is expected.
- * - OS_BinSemCreate() is invoked with a very long timer name, an error
- * is expected.
- * - OS_BinSemDelete() is invoked with timer_id set to -1, an error is
- * expected.
- * - OS_BinSemCreate() is invoked twice with duplicated name, an error
- * is expected, then the queue is deleted using OS_BinSemDelete().
+ * - [4.1.2] OS_BinSemCreate() is invoked with sem_name set to NULL, an
+ * error is expected.
+ * - [4.1.3] OS_BinSemCreate() is invoked with an invalid
+ * sem_initial_value, an error is expected.
+ * - [4.1.4] OS_BinSemCreate() is invoked with a very long timer name,
+ * an error is expected.
+ * - [4.1.5] OS_BinSemDelete() is invoked with timer_id set to -1, an
+ * error is expected.
+ * - [4.1.6] OS_BinSemCreate() is invoked twice with duplicated name,
+ * an error is expected, then the queue is deleted using
+ * OS_BinSemDelete().
* .
*/
static void test_004_001_execute(void) {
- /* OS_BinSemCreate() is invoked with sem_id set to NULL, an error is
- expected.*/
+ /* [4.1.1] OS_BinSemCreate() is invoked with sem_id set to NULL, an
+ error is expected.*/
test_set_step(1);
{
int32 err;
@@ -88,8 +75,8 @@ static void test_004_001_execute(void) {
test_assert(err == OS_INVALID_POINTER, "NULL not detected");
}
- /* OS_BinSemCreate() is invoked with sem_name set to NULL, an error
- is expected.*/
+ /* [4.1.2] OS_BinSemCreate() is invoked with sem_name set to NULL, an
+ error is expected.*/
test_set_step(2);
{
int32 err;
@@ -101,8 +88,8 @@ static void test_004_001_execute(void) {
test_assert(err == OS_INVALID_POINTER, "NULL not detected");
}
- /* OS_BinSemCreate() is invoked with an invalid sem_initial_value, an
- error is expected.*/
+ /* [4.1.3] OS_BinSemCreate() is invoked with an invalid
+ sem_initial_value, an error is expected.*/
test_set_step(3);
{
int32 err;
@@ -114,8 +101,8 @@ static void test_004_001_execute(void) {
test_assert(err == OS_INVALID_INT_NUM, "counter error not detected");
}
- /* OS_BinSemCreate() is invoked with a very long timer name, an error
- is expected.*/
+ /* [4.1.4] OS_BinSemCreate() is invoked with a very long timer name,
+ an error is expected.*/
test_set_step(4);
{
#if 0 /* Semaphore name currently not implemented.*/
@@ -129,8 +116,8 @@ static void test_004_001_execute(void) {
#endif
}
- /* OS_BinSemDelete() is invoked with timer_id set to -1, an error is
- expected.*/
+ /* [4.1.5] OS_BinSemDelete() is invoked with timer_id set to -1, an
+ error is expected.*/
test_set_step(5);
{
int32 err;
@@ -139,8 +126,9 @@ static void test_004_001_execute(void) {
test_assert(err == OS_ERR_INVALID_ID, "wrong semaphore id not detected");
}
- /* OS_BinSemCreate() is invoked twice with duplicated name, an error
- is expected, then the queue is deleted using OS_BinSemDelete().*/
+ /* [4.1.6] OS_BinSemCreate() is invoked twice with duplicated name,
+ an error is expected, then the queue is deleted using
+ OS_BinSemDelete().*/
test_set_step(6);
{
int32 err;
@@ -167,21 +155,21 @@ static const testcase_t test_004_001 = {
};
/**
- * @page test_004_002 OS_BinSemFlush() errors
+ * @page test_004_002 [4.2] OS_BinSemFlush() errors
*
* <h2>Description</h2>
* Parameters checking in OS_BinSemFlush() is tested.
*
* <h2>Test Steps</h2>
- * - OS_BinSemFlush() is invoked with sem_id set to -1, an error is
- * expected.
+ * - [4.2.1] OS_BinSemFlush() is invoked with sem_id set to -1, an
+ * error is expected.
* .
*/
static void test_004_002_execute(void) {
- /* OS_BinSemFlush() is invoked with sem_id set to -1, an error is
- expected.*/
+ /* [4.2.1] OS_BinSemFlush() is invoked with sem_id set to -1, an
+ error is expected.*/
test_set_step(1);
{
int32 err;
@@ -199,21 +187,21 @@ static const testcase_t test_004_002 = {
};
/**
- * @page test_004_003 OS_BinSemGive() errors
+ * @page test_004_003 [4.3] OS_BinSemGive() errors
*
* <h2>Description</h2>
* Parameters checking in OS_BinSemGive() is tested.
*
* <h2>Test Steps</h2>
- * - OS_BinSemGive() is invoked with sem_id set to -1, an error is
- * expected.
+ * - [4.3.1] OS_BinSemGive() is invoked with sem_id set to -1, an error
+ * is expected.
* .
*/
static void test_004_003_execute(void) {
- /* OS_BinSemGive() is invoked with sem_id set to -1, an error is
- expected.*/
+ /* [4.3.1] OS_BinSemGive() is invoked with sem_id set to -1, an error
+ is expected.*/
test_set_step(1);
{
int32 err;
@@ -231,21 +219,21 @@ static const testcase_t test_004_003 = {
};
/**
- * @page test_004_004 OS_BinSemTake() errors
+ * @page test_004_004 [4.4] OS_BinSemTake() errors
*
* <h2>Description</h2>
* Parameters checking in OS_BinSemTake() is tested.
*
* <h2>Test Steps</h2>
- * - OS_BinSemTake() is invoked with sem_id set to -1, an error is
- * expected.
+ * - [4.4.1] OS_BinSemTake() is invoked with sem_id set to -1, an error
+ * is expected.
* .
*/
static void test_004_004_execute(void) {
- /* OS_BinSemTake() is invoked with sem_id set to -1, an error is
- expected.*/
+ /* [4.4.1] OS_BinSemTake() is invoked with sem_id set to -1, an error
+ is expected.*/
test_set_step(1);
{
int32 err;
@@ -263,16 +251,16 @@ static const testcase_t test_004_004 = {
};
/**
- * @page test_004_005 OS_BinSemTimedWait() errors
+ * @page test_004_005 [4.5] OS_BinSemTimedWait() errors
*
* <h2>Description</h2>
* Parameters checking in OS_BinSemTimedWait() is tested.
*
* <h2>Test Steps</h2>
- * - OS_BinSemTimedWait() is invoked with sem_id set to -1, an error is
- * expected.
- * - OS_BinSemTimedWait() is invoked with msecs set to 0, an error is
- * expected.
+ * - [4.5.1] OS_BinSemTimedWait() is invoked with sem_id set to -1, an
+ * error is expected.
+ * - [4.5.2] OS_BinSemTimedWait() is invoked with msecs set to 0, an
+ * error is expected.
* .
*/
@@ -289,8 +277,8 @@ static void test_004_005_teardown(void) {
static void test_004_005_execute(void) {
- /* OS_BinSemTimedWait() is invoked with sem_id set to -1, an error is
- expected.*/
+ /* [4.5.1] OS_BinSemTimedWait() is invoked with sem_id set to -1, an
+ error is expected.*/
test_set_step(1);
{
int32 err;
@@ -299,8 +287,8 @@ static void test_004_005_execute(void) {
test_assert(err == OS_ERR_INVALID_ID, "invalid sem_id not detected");
}
- /* OS_BinSemTimedWait() is invoked with msecs set to 0, an error is
- expected.*/
+ /* [4.5.2] OS_BinSemTimedWait() is invoked with msecs set to 0, an
+ error is expected.*/
test_set_step(2);
{
int32 err;
@@ -318,25 +306,25 @@ static const testcase_t test_004_005 = {
};
/**
- * @page test_004_006 OS_BinSemGetIdByName() errors
+ * @page test_004_006 [4.6] OS_BinSemGetIdByName() errors
*
* <h2>Description</h2>
* Parameters checking in OS_BinSemGetIdByName() is tested.
*
* <h2>Test Steps</h2>
- * - OS_BinSemGetIdByName() is invoked with sem_id set to NULL, an
- * error is expected.
- * - OS_BinSemGetIdByName() is invoked with semaphore name set to NULL,
+ * - [4.6.1] OS_BinSemGetIdByName() is invoked with sem_id set to NULL,
* an error is expected.
- * - OS_BinSemGetIdByName() is invoked with a very long task name, an
- * error is expected.
+ * - [4.6.2] OS_BinSemGetIdByName() is invoked with semaphore name set
+ * to NULL, an error is expected.
+ * - [4.6.3] OS_BinSemGetIdByName() is invoked with a very long task
+ * name, an error is expected.
* .
*/
static void test_004_006_execute(void) {
- /* OS_BinSemGetIdByName() is invoked with sem_id set to NULL, an
- error is expected.*/
+ /* [4.6.1] OS_BinSemGetIdByName() is invoked with sem_id set to NULL,
+ an error is expected.*/
test_set_step(1);
{
int32 err;
@@ -345,8 +333,8 @@ static void test_004_006_execute(void) {
test_assert(err == OS_INVALID_POINTER, "NULL not detected");
}
- /* OS_BinSemGetIdByName() is invoked with semaphore name set to NULL,
- an error is expected.*/
+ /* [4.6.2] OS_BinSemGetIdByName() is invoked with semaphore name set
+ to NULL, an error is expected.*/
test_set_step(2);
{
int32 err;
@@ -355,8 +343,8 @@ static void test_004_006_execute(void) {
test_assert(err == OS_INVALID_POINTER, "NULL not detected");
}
- /* OS_BinSemGetIdByName() is invoked with a very long task name, an
- error is expected.*/
+ /* [4.6.3] OS_BinSemGetIdByName() is invoked with a very long task
+ name, an error is expected.*/
test_set_step(3);
{
int32 err;
@@ -374,14 +362,14 @@ static const testcase_t test_004_006 = {
};
/**
- * @page test_004_007 OS_BinSemTimedWait() timeout functionality
+ * @page test_004_007 [4.7] OS_BinSemTimedWait() timeout functionality
*
* <h2>Description</h2>
* OS_BinSemCreate() timeout functionality is tested.
*
* <h2>Test Steps</h2>
- * - OS_BinSemTimedWait() is invoked with timeout set to one second, an
- * error is expected.
+ * - [4.7.1] OS_BinSemTimedWait() is invoked with timeout set to one
+ * second, an error is expected.
* .
*/
@@ -398,8 +386,8 @@ static void test_004_007_teardown(void) {
static void test_004_007_execute(void) {
- /* OS_BinSemTimedWait() is invoked with timeout set to one second, an
- error is expected.*/
+ /* [4.7.1] OS_BinSemTimedWait() is invoked with timeout set to one
+ second, an error is expected.*/
test_set_step(1);
{
int32 err;
diff --git a/test/nasa_osal/source/test/test_sequence_004.h b/test/nasa_osal/source/test/test_sequence_004.h
index 4e0e48f6a..965f4b132 100644
--- a/test/nasa_osal/source/test/test_sequence_004.h
+++ b/test/nasa_osal/source/test/test_sequence_004.h
@@ -1,17 +1,3 @@
-/*
- ChibiOS - Copyright (C) 2006..2016 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.
-*/
+/* Copyright statement.*/
extern const testcase_t * const test_sequence_004[];
diff --git a/test/nasa_osal/source/test/test_sequence_005.c b/test/nasa_osal/source/test/test_sequence_005.c
index cbbb8e0fa..76c37bfa8 100644
--- a/test/nasa_osal/source/test/test_sequence_005.c
+++ b/test/nasa_osal/source/test/test_sequence_005.c
@@ -1,25 +1,11 @@
-/*
- ChibiOS - Copyright (C) 2006..2016 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.
-*/
+/* Copyright statement.*/
#include "hal.h"
#include "ch_test.h"
#include "test_root.h"
/**
- * @page test_sequence_005 Counter Semaphores Functionality
+ * @page test_sequence_005 [5] Counter Semaphores Functionality
*
* File: @ref test_sequence_005.c
*
@@ -41,8 +27,8 @@
* Shared code.
****************************************************************************/
-#include "osapi.h"
-
+#include "osapi.h"
+
uint32 csid;
/****************************************************************************
@@ -50,33 +36,33 @@ uint32 csid;
****************************************************************************/
/**
- * @page test_005_001 OS_CountSemCreate() and OS_CountSemDelete() errors
+ * @page test_005_001 [5.1] OS_CountSemCreate() and OS_CountSemDelete() errors
*
* <h2>Description</h2>
* Parameters checking in OS_CountSemCreate() and OS_CountSemDelete()
* is tested.
*
* <h2>Test Steps</h2>
- * - OS_CountSemCreate() is invoked with sem_id set to NULL, an error
- * is expected.
- * - OS_CountSemCreate() is invoked with sem_name set to NULL, an error
- * is expected.
- * - OS_CountSemCreate() is invoked with an invalid sem_initial_value,
+ * - [5.1.1] OS_CountSemCreate() is invoked with sem_id set to NULL, an
+ * error is expected.
+ * - [5.1.2] OS_CountSemCreate() is invoked with sem_name set to NULL,
* an error is expected.
- * - OS_CountSemCreate() is invoked with a very long timer name, an
+ * - [5.1.3] OS_CountSemCreate() is invoked with an invalid
+ * sem_initial_value, an error is expected.
+ * - [5.1.4] OS_CountSemCreate() is invoked with a very long timer
+ * name, an error is expected.
+ * - [5.1.5] OS_CountSemDelete() is invoked with timer_id set to -1, an
* error is expected.
- * - OS_CountSemDelete() is invoked with timer_id set to -1, an error
- * is expected.
- * - OS_CountSemCreate() is invoked twice with duplicated name, an
- * error is expected, then the queue is deleted using
+ * - [5.1.6] OS_CountSemCreate() is invoked twice with duplicated name,
+ * an error is expected, then the queue is deleted using
* OS_CountSemDelete().
* .
*/
static void test_005_001_execute(void) {
- /* OS_CountSemCreate() is invoked with sem_id set to NULL, an error
- is expected.*/
+ /* [5.1.1] OS_CountSemCreate() is invoked with sem_id set to NULL, an
+ error is expected.*/
test_set_step(1);
{
int32 err;
@@ -88,8 +74,8 @@ static void test_005_001_execute(void) {
test_assert(err == OS_INVALID_POINTER, "NULL not detected");
}
- /* OS_CountSemCreate() is invoked with sem_name set to NULL, an error
- is expected.*/
+ /* [5.1.2] OS_CountSemCreate() is invoked with sem_name set to NULL,
+ an error is expected.*/
test_set_step(2);
{
int32 err;
@@ -101,8 +87,8 @@ static void test_005_001_execute(void) {
test_assert(err == OS_INVALID_POINTER, "NULL not detected");
}
- /* OS_CountSemCreate() is invoked with an invalid sem_initial_value,
- an error is expected.*/
+ /* [5.1.3] OS_CountSemCreate() is invoked with an invalid
+ sem_initial_value, an error is expected.*/
test_set_step(3);
{
int32 err;
@@ -114,8 +100,8 @@ static void test_005_001_execute(void) {
test_assert(err == OS_INVALID_INT_NUM, "counter error not detected");
}
- /* OS_CountSemCreate() is invoked with a very long timer name, an
- error is expected.*/
+ /* [5.1.4] OS_CountSemCreate() is invoked with a very long timer
+ name, an error is expected.*/
test_set_step(4);
{
#if 0 /* Semaphore name currently not implemented.*/
@@ -129,8 +115,8 @@ static void test_005_001_execute(void) {
#endif
}
- /* OS_CountSemDelete() is invoked with timer_id set to -1, an error
- is expected.*/
+ /* [5.1.5] OS_CountSemDelete() is invoked with timer_id set to -1, an
+ error is expected.*/
test_set_step(5);
{
int32 err;
@@ -139,8 +125,8 @@ static void test_005_001_execute(void) {
test_assert(err == OS_ERR_INVALID_ID, "wrong semaphore id not detected");
}
- /* OS_CountSemCreate() is invoked twice with duplicated name, an
- error is expected, then the queue is deleted using
+ /* [5.1.6] OS_CountSemCreate() is invoked twice with duplicated name,
+ an error is expected, then the queue is deleted using
OS_CountSemDelete().*/
test_set_step(6);
{
@@ -168,21 +154,21 @@ static const testcase_t test_005_001 = {
};
/**
- * @page test_005_002 OS_CountSemGive() errors
+ * @page test_005_002 [5.2] OS_CountSemGive() errors
*
* <h2>Description</h2>
* Parameters checking in OS_CountSemGive() is tested.
*
* <h2>Test Steps</h2>
- * - OS_CountSemGive() is invoked with sem_id set to -1, an error is
- * expected.
+ * - [5.2.1] OS_CountSemGive() is invoked with sem_id set to -1, an
+ * error is expected.
* .
*/
static void test_005_002_execute(void) {
- /* OS_CountSemGive() is invoked with sem_id set to -1, an error is
- expected.*/
+ /* [5.2.1] OS_CountSemGive() is invoked with sem_id set to -1, an
+ error is expected.*/
test_set_step(1);
{
int32 err;
@@ -200,21 +186,21 @@ static const testcase_t test_005_002 = {
};
/**
- * @page test_005_003 OS_CountSemTake() errors
+ * @page test_005_003 [5.3] OS_CountSemTake() errors
*
* <h2>Description</h2>
* Parameters checking in OS_CountSemTake() is tested.
*
* <h2>Test Steps</h2>
- * - OS_CountSemTake() is invoked with sem_id set to -1, an error is
- * expected.
+ * - [5.3.1] OS_CountSemTake() is invoked with sem_id set to -1, an
+ * error is expected.
* .
*/
static void test_005_003_execute(void) {
- /* OS_CountSemTake() is invoked with sem_id set to -1, an error is
- expected.*/
+ /* [5.3.1] OS_CountSemTake() is invoked with sem_id set to -1, an
+ error is expected.*/
test_set_step(1);
{
int32 err;
@@ -232,16 +218,16 @@ static const testcase_t test_005_003 = {
};
/**
- * @page test_005_004 OS_CountSemTimedWait() errors
+ * @page test_005_004 [5.4] OS_CountSemTimedWait() errors
*
* <h2>Description</h2>
* Parameters checking in OS_CountSemTimedWait() is tested.
*
* <h2>Test Steps</h2>
- * - OS_CountSemTimedWait() is invoked with sem_id set to -1, an error
- * is expected.
- * - OS_CountSemTimedWait() is invoked with msecs set to 0, an error is
- * expected.
+ * - [5.4.1] OS_CountSemTimedWait() is invoked with sem_id set to -1,
+ * an error is expected.
+ * - [5.4.2] OS_CountSemTimedWait() is invoked with msecs set to 0, an
+ * error is expected.
* .
*/
@@ -258,8 +244,8 @@ static void test_005_004_teardown(void) {
static void test_005_004_execute(void) {
- /* OS_CountSemTimedWait() is invoked with sem_id set to -1, an error
- is expected.*/
+ /* [5.4.1] OS_CountSemTimedWait() is invoked with sem_id set to -1,
+ an error is expected.*/
test_set_step(1);
{
int32 err;
@@ -268,8 +254,8 @@ static void test_005_004_execute(void) {
test_assert(err == OS_ERR_INVALID_ID, "invalid sem_id not detected");
}
- /* OS_CountSemTimedWait() is invoked with msecs set to 0, an error is
- expected.*/
+ /* [5.4.2] OS_CountSemTimedWait() is invoked with msecs set to 0, an
+ error is expected.*/
test_set_step(2);
{
int32 err;
@@ -287,25 +273,25 @@ static const testcase_t test_005_004 = {
};
/**
- * @page test_005_005 OS_CountSemGetIdByName() errors
+ * @page test_005_005 [5.5] OS_CountSemGetIdByName() errors
*
* <h2>Description</h2>
* Parameters checking in OS_CountSemGetIdByName() is tested.
*
* <h2>Test Steps</h2>
- * - OS_CountSemGetIdByName() is invoked with sem_id set to NULL, an
- * error is expected.
- * - OS_CountSemGetIdByName() is invoked with semaphore name set to
+ * - [5.5.1] OS_CountSemGetIdByName() is invoked with sem_id set to
* NULL, an error is expected.
- * - OS_CountSemGetIdByName() is invoked with a very long task name, an
- * error is expected.
+ * - [5.5.2] OS_CountSemGetIdByName() is invoked with semaphore name
+ * set to NULL, an error is expected.
+ * - [5.5.3] OS_CountSemGetIdByName() is invoked with a very long task
+ * name, an error is expected.
* .
*/
static void test_005_005_execute(void) {
- /* OS_CountSemGetIdByName() is invoked with sem_id set to NULL, an
- error is expected.*/
+ /* [5.5.1] OS_CountSemGetIdByName() is invoked with sem_id set to
+ NULL, an error is expected.*/
test_set_step(1);
{
int32 err;
@@ -314,8 +300,8 @@ static void test_005_005_execute(void) {
test_assert(err == OS_INVALID_POINTER, "NULL not detected");
}
- /* OS_CountSemGetIdByName() is invoked with semaphore name set to
- NULL, an error is expected.*/
+ /* [5.5.2] OS_CountSemGetIdByName() is invoked with semaphore name
+ set to NULL, an error is expected.*/
test_set_step(2);
{
int32 err;
@@ -324,8 +310,8 @@ static void test_005_005_execute(void) {
test_assert(err == OS_INVALID_POINTER, "NULL not detected");
}
- /* OS_CountSemGetIdByName() is invoked with a very long task name, an
- error is expected.*/
+ /* [5.5.3] OS_CountSemGetIdByName() is invoked with a very long task
+ name, an error is expected.*/
test_set_step(3);
{
int32 err;
@@ -343,14 +329,14 @@ static const testcase_t test_005_005 = {
};
/**
- * @page test_005_006 OS_CountSemTimedWait() timeout functionality
+ * @page test_005_006 [5.6] OS_CountSemTimedWait() timeout functionality
*
* <h2>Description</h2>
* OS_CountSemCreate() timeout functionality is tested.
*
* <h2>Test Steps</h2>
- * - OS_CountSemTimedWait() is invoked with timeout set to one second,
- * an error is expected.
+ * - [5.6.1] OS_CountSemTimedWait() is invoked with timeout set to one
+ * second, an error is expected.
* .
*/
@@ -367,8 +353,8 @@ static void test_005_006_teardown(void) {
static void test_005_006_execute(void) {
- /* OS_CountSemTimedWait() is invoked with timeout set to one second,
- an error is expected.*/
+ /* [5.6.1] OS_CountSemTimedWait() is invoked with timeout set to one
+ second, an error is expected.*/
test_set_step(1);
{
int32 err;
diff --git a/test/nasa_osal/source/test/test_sequence_005.h b/test/nasa_osal/source/test/test_sequence_005.h
index a6d54f033..094222891 100644
--- a/test/nasa_osal/source/test/test_sequence_005.h
+++ b/test/nasa_osal/source/test/test_sequence_005.h
@@ -1,17 +1,3 @@
-/*
- ChibiOS - Copyright (C) 2006..2016 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.
-*/
+/* Copyright statement.*/
extern const testcase_t * const test_sequence_005[];
diff --git a/test/nasa_osal/source/test/test_sequence_006.c b/test/nasa_osal/source/test/test_sequence_006.c
index 2ea972091..fd99656e1 100644
--- a/test/nasa_osal/source/test/test_sequence_006.c
+++ b/test/nasa_osal/source/test/test_sequence_006.c
@@ -1,25 +1,11 @@
-/*
- ChibiOS - Copyright (C) 2006..2016 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.
-*/
+/* Copyright statement.*/
#include "hal.h"
#include "ch_test.h"
#include "test_root.h"
/**
- * @page test_sequence_006 Mutex Semaphores Functionality
+ * @page test_sequence_006 [6] Mutex Semaphores Functionality
*
* File: @ref test_sequence_006.c
*
@@ -39,8 +25,8 @@
* Shared code.
****************************************************************************/
-#include "osapi.h"
-
+#include "osapi.h"
+
uint32 msid;
/****************************************************************************
@@ -48,30 +34,31 @@ uint32 msid;
****************************************************************************/
/**
- * @page test_006_001 OS_MutSemCreate() and OS_MutSemDelete() errors
+ * @page test_006_001 [6.1] OS_MutSemCreate() and OS_MutSemDelete() errors
*
* <h2>Description</h2>
* Parameters checking in OS_MutSemCreate() and OS_MutSemDelete() is
* tested.
*
* <h2>Test Steps</h2>
- * - OS_MutSemCreate() is invoked with sem_id set to NULL, an error is
- * expected.
- * - OS_MutSemCreate() is invoked with sem_name set to NULL, an error
- * is expected.
- * - OS_MutSemCreate() is invoked with a very long timer name, an error
- * is expected.
- * - OS_MutSemDelete() is invoked with timer_id set to -1, an error is
- * expected.
- * - OS_MutSemCreate() is invoked twice with duplicated name, an error
- * is expected, then the queue is deleted using OS_MutSemDelete().
+ * - [6.1.1] OS_MutSemCreate() is invoked with sem_id set to NULL, an
+ * error is expected.
+ * - [6.1.2] OS_MutSemCreate() is invoked with sem_name set to NULL, an
+ * error is expected.
+ * - [6.1.3] OS_MutSemCreate() is invoked with a very long timer name,
+ * an error is expected.
+ * - [6.1.4] OS_MutSemDelete() is invoked with timer_id set to -1, an
+ * error is expected.
+ * - [6.1.5] OS_MutSemCreate() is invoked twice with duplicated name,
+ * an error is expected, then the queue is deleted using
+ * OS_MutSemDelete().
* .
*/
static void test_006_001_execute(void) {
- /* OS_MutSemCreate() is invoked with sem_id set to NULL, an error is
- expected.*/
+ /* [6.1.1] OS_MutSemCreate() is invoked with sem_id set to NULL, an
+ error is expected.*/
test_set_step(1);
{
int32 err;
@@ -82,8 +69,8 @@ static void test_006_001_execute(void) {
test_assert(err == OS_INVALID_POINTER, "NULL not detected");
}
- /* OS_MutSemCreate() is invoked with sem_name set to NULL, an error
- is expected.*/
+ /* [6.1.2] OS_MutSemCreate() is invoked with sem_name set to NULL, an
+ error is expected.*/
test_set_step(2);
{
int32 err;
@@ -94,8 +81,8 @@ static void test_006_001_execute(void) {
test_assert(err == OS_INVALID_POINTER, "NULL not detected");
}
- /* OS_MutSemCreate() is invoked with a very long timer name, an error
- is expected.*/
+ /* [6.1.3] OS_MutSemCreate() is invoked with a very long timer name,
+ an error is expected.*/
test_set_step(3);
{
#if 0 /* Semaphore name currently not implemented.*/
@@ -108,8 +95,8 @@ static void test_006_001_execute(void) {
#endif
}
- /* OS_MutSemDelete() is invoked with timer_id set to -1, an error is
- expected.*/
+ /* [6.1.4] OS_MutSemDelete() is invoked with timer_id set to -1, an
+ error is expected.*/
test_set_step(4);
{
int32 err;
@@ -118,8 +105,9 @@ static void test_006_001_execute(void) {
test_assert(err == OS_ERR_INVALID_ID, "wrong semaphore id not detected");
}
- /* OS_MutSemCreate() is invoked twice with duplicated name, an error
- is expected, then the queue is deleted using OS_MutSemDelete().*/
+ /* [6.1.5] OS_MutSemCreate() is invoked twice with duplicated name,
+ an error is expected, then the queue is deleted using
+ OS_MutSemDelete().*/
test_set_step(5);
{
int32 err;
@@ -146,21 +134,21 @@ static const testcase_t test_006_001 = {
};
/**
- * @page test_006_002 OS_MutSemGive() errors
+ * @page test_006_002 [6.2] OS_MutSemGive() errors
*
* <h2>Description</h2>
* Parameters checking in OS_MutSemGive() is tested.
*
* <h2>Test Steps</h2>
- * - OS_MutSemGive() is invoked with sem_id set to -1, an error is
- * expected.
+ * - [6.2.1] OS_MutSemGive() is invoked with sem_id set to -1, an error
+ * is expected.
* .
*/
static void test_006_002_execute(void) {
- /* OS_MutSemGive() is invoked with sem_id set to -1, an error is
- expected.*/
+ /* [6.2.1] OS_MutSemGive() is invoked with sem_id set to -1, an error
+ is expected.*/
test_set_step(1);
{
int32 err;
@@ -178,21 +166,21 @@ static const testcase_t test_006_002 = {
};
/**
- * @page test_006_003 OS_MutSemTake() errors
+ * @page test_006_003 [6.3] OS_MutSemTake() errors
*
* <h2>Description</h2>
* Parameters checking in OS_MutSemTake() is tested.
*
* <h2>Test Steps</h2>
- * - OS_MutSemTake() is invoked with sem_id set to -1, an error is
- * expected.
+ * - [6.3.1] OS_MutSemTake() is invoked with sem_id set to -1, an error
+ * is expected.
* .
*/
static void test_006_003_execute(void) {
- /* OS_MutSemTake() is invoked with sem_id set to -1, an error is
- expected.*/
+ /* [6.3.1] OS_MutSemTake() is invoked with sem_id set to -1, an error
+ is expected.*/
test_set_step(1);
{
int32 err;
@@ -210,25 +198,25 @@ static const testcase_t test_006_003 = {
};
/**
- * @page test_006_004 OS_MutSemGetIdByName() errors
+ * @page test_006_004 [6.4] OS_MutSemGetIdByName() errors
*
* <h2>Description</h2>
* Parameters checking in OS_MutSemGetIdByName() is tested.
*
* <h2>Test Steps</h2>
- * - OS_MutSemGetIdByName() is invoked with sem_id set to NULL, an
- * error is expected.
- * - OS_MutSemGetIdByName() is invoked with semaphore name set to NULL,
+ * - [6.4.1] OS_MutSemGetIdByName() is invoked with sem_id set to NULL,
* an error is expected.
- * - OS_MutSemGetIdByName() is invoked with a very long task name, an
- * error is expected.
+ * - [6.4.2] OS_MutSemGetIdByName() is invoked with semaphore name set
+ * to NULL, an error is expected.
+ * - [6.4.3] OS_MutSemGetIdByName() is invoked with a very long task
+ * name, an error is expected.
* .
*/
static void test_006_004_execute(void) {
- /* OS_MutSemGetIdByName() is invoked with sem_id set to NULL, an
- error is expected.*/
+ /* [6.4.1] OS_MutSemGetIdByName() is invoked with sem_id set to NULL,
+ an error is expected.*/
test_set_step(1);
{
int32 err;
@@ -237,8 +225,8 @@ static void test_006_004_execute(void) {
test_assert(err == OS_INVALID_POINTER, "NULL not detected");
}
- /* OS_MutSemGetIdByName() is invoked with semaphore name set to NULL,
- an error is expected.*/
+ /* [6.4.2] OS_MutSemGetIdByName() is invoked with semaphore name set
+ to NULL, an error is expected.*/
test_set_step(2);
{
int32 err;
@@ -247,8 +235,8 @@ static void test_006_004_execute(void) {
test_assert(err == OS_INVALID_POINTER, "NULL not detected");
}
- /* OS_MutSemGetIdByName() is invoked with a very long task name, an
- error is expected.*/
+ /* [6.4.3] OS_MutSemGetIdByName() is invoked with a very long task
+ name, an error is expected.*/
test_set_step(3);
{
int32 err;
diff --git a/test/nasa_osal/source/test/test_sequence_006.h b/test/nasa_osal/source/test/test_sequence_006.h
index efa716bdd..0cbf01a81 100644
--- a/test/nasa_osal/source/test/test_sequence_006.h
+++ b/test/nasa_osal/source/test/test_sequence_006.h
@@ -1,17 +1,3 @@
-/*
- ChibiOS - Copyright (C) 2006..2016 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.
-*/
+/* Copyright statement.*/
extern const testcase_t * const test_sequence_006[];