From 0d4df3cf1b03cf19b24cbacf7bd5908d9968beab Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Wed, 9 Mar 2016 15:45:58 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9058 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- test/nasa_osal/configuration.xml | 148 +++++++++++++++++++++++++++---- 1 file changed, 130 insertions(+), 18 deletions(-) diff --git a/test/nasa_osal/configuration.xml b/test/nasa_osal/configuration.xml index e13b79ffa..0d628e57f 100644 --- a/test/nasa_osal/configuration.xml +++ b/test/nasa_osal/configuration.xml @@ -610,13 +610,32 @@ test_assert_sequence("ABC", "events order violation");]]> Internal Tests - Queues Functionality. + Queues Functionality This sequence tests the NASA OSAL over ChibiOS/RT functionalities related to queues - + + +#include "osapi.h" + +uint32 qid; + +#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('*'); + } + } +}]]> @@ -667,14 +686,14 @@ test_assert(err == OS_INVALID_POINTER, "NULL not detected");]]> - @@ -686,14 +705,14 @@ test_assert(err == OS_INVALID_POINTER, "NULL not detected");]]> - @@ -734,6 +753,99 @@ test_assert(err == OS_SUCCESS, "queue deletion failed");]]> + + + OS_QueuePut() and OS_QueueGet() functionality + + + A task writes on a queue, the messages are retrieved on the other side in blocking mode. + + + + + + + + + + + + + + + + + + + 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. + + + + + + + + + +