diff options
Diffstat (limited to 'testsuites/sptests/sp13')
-rw-r--r-- | testsuites/sptests/sp13/fillbuff.c | 31 | ||||
-rw-r--r-- | testsuites/sptests/sp13/init.c | 112 | ||||
-rw-r--r-- | testsuites/sptests/sp13/putbuff.c | 29 | ||||
-rw-r--r-- | testsuites/sptests/sp13/sp13.doc | 25 | ||||
-rw-r--r-- | testsuites/sptests/sp13/sp13.scn | 72 | ||||
-rw-r--r-- | testsuites/sptests/sp13/system.h | 68 | ||||
-rw-r--r-- | testsuites/sptests/sp13/task1.c | 344 | ||||
-rw-r--r-- | testsuites/sptests/sp13/task2.c | 139 | ||||
-rw-r--r-- | testsuites/sptests/sp13/task3.c | 78 |
9 files changed, 0 insertions, 898 deletions
diff --git a/testsuites/sptests/sp13/fillbuff.c b/testsuites/sptests/sp13/fillbuff.c deleted file mode 100644 index 43ccd86803..0000000000 --- a/testsuites/sptests/sp13/fillbuff.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Fill_buffer - * - * This test routine copies a given source string to a given destination - * buffer. - * - * Input parameters: - * source - pointer to string to be copied - * buffer - pointer to message buffer to be filled - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * This material may be reproduced by or for the U.S. Government pursuant - * to the copyright license under the clause at DFARS 252.227-7013. This - * notice must appear in all copies of this file and its derivatives. - * - * $Id$ - */ - -#include "system.h" - -void Fill_buffer( - char *source, - long *buffer -) -{ - memcpy( buffer, source, 16 ); -} diff --git a/testsuites/sptests/sp13/init.c b/testsuites/sptests/sp13/init.c deleted file mode 100644 index 9a778f2fff..0000000000 --- a/testsuites/sptests/sp13/init.c +++ /dev/null @@ -1,112 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * This material may be reproduced by or for the U.S. Government pursuant - * to the copyright license under the clause at DFARS 252.227-7013. This - * notice must appear in all copies of this file and its derivatives. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - puts( "\n\n*** TEST 13 ***" ); - - Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); - Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' ); - Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' ); - - status = rtems_task_create( - Task_name[ 1 ], - 4, - RTEMS_MINIMUM_STACK_SIZE * 2, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create of TA1" ); - - status = rtems_task_create( - Task_name[ 2 ], - 4, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 2 ] - ); - directive_failed( status, "rtems_task_create of TA2" ); - - status = rtems_task_create( - Task_name[ 3 ], - 4, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 3 ] - ); - directive_failed( status, "rtems_task_create of TA3" ); - - status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); - directive_failed( status, "rtems_task_start of TA1" ); - - status = rtems_task_start( Task_id[ 2 ], Task_2, 0 ); - directive_failed( status, "rtems_task_start of TA2" ); - - status = rtems_task_start( Task_id[ 3 ], Task_3, 0 ); - directive_failed( status, "rtems_task_start of TA3" ); - - Queue_name[ 1 ] = rtems_build_name( 'Q', '1', ' ', ' ' ); - Queue_name[ 2 ] = rtems_build_name( 'Q', '2', ' ', ' ' ); - Queue_name[ 3 ] = rtems_build_name( 'Q', '3', ' ', ' ' ); - - status = rtems_message_queue_create( - Queue_name[ 1 ], - 100, - 16, - RTEMS_DEFAULT_ATTRIBUTES, - &Queue_id[ 1 ] - ); - directive_failed( status, "rtems_message_queue_create of Q1" ); - - status = rtems_message_queue_create( - Queue_name[ 2 ], - 10, - 16, - RTEMS_PRIORITY, - &Queue_id[ 2 ] - ); - directive_failed( status, "rtems_message_queue_create of Q2" ); - - status = rtems_message_queue_create( - Queue_name[ 3 ], - 100, - 16, - RTEMS_DEFAULT_ATTRIBUTES, - &Queue_id[ 3 ] - ); - directive_failed( status, "rtems_message_queue_create of Q3" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} diff --git a/testsuites/sptests/sp13/putbuff.c b/testsuites/sptests/sp13/putbuff.c deleted file mode 100644 index ed75a54fa4..0000000000 --- a/testsuites/sptests/sp13/putbuff.c +++ /dev/null @@ -1,29 +0,0 @@ -/* Put_buffer - * - * This test routine prints the given buffer. - * buffer. - * - * Input parameters: - * buffer - pointer to message buffer to be printer - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * This material may be reproduced by or for the U.S. Government pursuant - * to the copyright license under the clause at DFARS 252.227-7013. This - * notice must appear in all copies of this file and its derivatives. - * - * $Id$ - */ - -#include "system.h" - -void Put_buffer( - long *buffer -) -{ - printf( "%16s", (char *)buffer ); -} diff --git a/testsuites/sptests/sp13/sp13.doc b/testsuites/sptests/sp13/sp13.doc deleted file mode 100644 index 4a0c9d24a0..0000000000 --- a/testsuites/sptests/sp13/sp13.doc +++ /dev/null @@ -1,25 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. -# On-Line Applications Research Corporation (OAR). -# All rights assigned to U.S. Government, 1994. -# -# This material may be reproduced by or for the U.S. Government pursuant -# to the copyright license under the clause at DFARS 252.227-7013. This -# notice must appear in all copies of this file and its derivatives. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: test13 - -directives: - ex_init, ex_start, t_create, t_start, t_delete, tm_tick, i_return, - q_create, q_ident, q_delete, q_send, q_urgent, q_broadcast, q_receive, - tm_wkafter, t_setpri - -concepts: - - a. This test checks out the message manager. diff --git a/testsuites/sptests/sp13/sp13.scn b/testsuites/sptests/sp13/sp13.scn deleted file mode 100644 index 11adfb8eb3..0000000000 --- a/testsuites/sptests/sp13/sp13.scn +++ /dev/null @@ -1,72 +0,0 @@ -*** TEST 13 *** -TA1 - rtems_message_queue_ident - qid => 18010001 -TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 -TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 -TA1 - rtems_task_wake_after - sleep 5 seconds -TA2 - rtems_message_queue_receive - receive from queue 1 - RTEMS_NO_WAIT -TA2 - buffer received: BUFFER 1 TO Q 1 -TA2 - rtems_message_queue_receive - receive from queue 1 - RTEMS_WAIT FOREVER -TA2 - buffer received: BUFFER 2 TO Q 1 -TA2 - rtems_message_queue_receive - receive from queue 1 - RTEMS_WAIT FOREVER -TA3 - rtems_message_queue_receive - receive from queue 2 - RTEMS_WAIT FOREVER -TA1 - rtems_message_queue_send - BUFFER 3 TO Q 1 -TA1 - rtems_task_wake_after - sleep 5 seconds -TA2 - buffer received: BUFFER 3 TO Q 1 -TA2 - rtems_task_set_priority - make self highest priority task -TA2 - rtems_message_queue_receive - receive from queue 2 - RTEMS_WAIT FOREVER -<pause> -TA1 - rtems_message_queue_send - BUFFER 1 TO Q 2 -TA2 - buffer received: BUFFER 1 TO Q 2 -TA2 - rtems_message_queue_send - BUFFER 2 TO Q 2 -TA2 - rtems_message_queue_receive - receive from queue 1 - 10 second timeout -TA1 - rtems_message_queue_receive - receive from queue 1 - 10 second timeout -TA3 - buffer received: BUFFER 2 TO Q 2 -TA3 - rtems_message_queue_broadcast - BUFFER 3 TO Q 1 -TA2 - buffer received: BUFFER 3 TO Q 1 -TA2 - rtems_message_queue_receive - receive from queue 3 - RTEMS_WAIT FOREVER -TA3 - number of tasks awakened = 02 -TA3 - rtems_message_queue_receive - receive from queue 3 - RTEMS_WAIT FOREVER -TA1 - buffer received: BUFFER 3 TO Q 1 -TA1 - rtems_task_delete - delete TA2 -TA1 - rtems_message_queue_send - BUFFER 1 TO Q 3 -TA1 - rtems_task_wake_after - sleep 5 seconds -TA3 - buffer received: BUFFER 1 TO Q 3 -TA3 - rtems_task_delete - delete self -<pause> -TA1 - rtems_message_queue_send - BUFFER 2 TO Q 3 -TA1 - rtems_message_queue_send - BUFFER 3 TO Q 3 -TA1 - rtems_message_queue_send - BUFFER 4 TO Q 3 -TA1 - rtems_message_queue_urgent - BUFFER 5 TO Q 3 -TA1 - rtems_message_queue_receive - receive from queue 3 - RTEMS_WAIT FOREVER -TA1 - buffer received: BUFFER 5 TO Q 3 -TA1 - rtems_message_queue_receive - receive from queue 3 - RTEMS_WAIT FOREVER -TA1 - buffer received: BUFFER 2 TO Q 3 -TA1 - rtems_message_queue_receive - receive from queue 3 - RTEMS_WAIT FOREVER -TA1 - buffer received: BUFFER 3 TO Q 3 -TA1 - rtems_message_queue_receive - receive from queue 3 - RTEMS_WAIT FOREVER -TA1 - buffer received: BUFFER 4 TO Q 3 -TA1 - rtems_message_queue_urgent - BUFFER 3 TO Q 2 -TA1 - rtems_message_queue_receive - receive from queue 2 - RTEMS_WAIT FOREVER -TA1 - buffer received: BUFFER 3 TO Q 2 -<pause> -TA1 - rtems_message_queue_delete - delete queue 1 -TA1 - rtems_message_queue_urgent - BUFFER 3 TO Q 2 -TA1 - rtems_message_queue_delete - delete queue 2 -TA1 - rtems_message_queue_flush - empty Q 3 -TA1 - 0 messages were flushed from Q 3 -TA1 - rtems_message_queue_send - BUFFER 1 TO Q 3 -TA1 - rtems_message_queue_send - BUFFER 2 TO Q 3 -TA1 - rtems_message_queue_send - BUFFER 3 TO Q 3 -TA1 - rtems_message_queue_flush - Q 3 -TA1 - 3 messages were flushed from Q 3 -TA1 - rtems_message_queue_send until all message buffers consumed -TA1 - all message buffers consumed -TA1 - rtems_message_queue_flush - Q 3 -TA1 - 100 messages were flushed from Q 3 -<pause> -TA1 - create message queue of 20 bytes on queue 1 -TA1 - rtems_message_queue_delete - delete queue 1 -<pause> -TA1 - rtems_message_queue_create - variable sizes -TA1 - rtems_message_queue_create and send - variable sizes -*** END OF TEST 13 *** diff --git a/testsuites/sptests/sp13/system.h b/testsuites/sptests/sp13/system.h deleted file mode 100644 index 368397efce..0000000000 --- a/testsuites/sptests/sp13/system.h +++ /dev/null @@ -1,68 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * This material may be reproduced by or for the U.S. Government pursuant - * to the copyright license under the clause at DFARS 252.227-7013. This - * notice must appear in all copies of this file and its derivatives. - * - * $Id$ - */ - -#include <tmacros.h> - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -void Fill_buffer( - char source[], - long *buffer -); - -void Put_buffer( - long *buffer -); - -rtems_task Task_1( - rtems_task_argument argument -); - -rtems_task Task_2( - rtems_task_argument argument -); - -rtems_task Task_3( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_SPTEST - -#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 10 -#define CONFIGURE_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include <confdefs.h> - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_id Queue_id[ 4 ]; /* array of queue ids */ -TEST_EXTERN rtems_name Queue_name[ 4 ]; /* array of queue names */ - -/* end of include file */ diff --git a/testsuites/sptests/sp13/task1.c b/testsuites/sptests/sp13/task1.c deleted file mode 100644 index e84bfc5b2e..0000000000 --- a/testsuites/sptests/sp13/task1.c +++ /dev/null @@ -1,344 +0,0 @@ -/* Task_1 - * - * This routine serves as a test task. It verifies the message manager. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * This material may be reproduced by or for the U.S. Government pursuant - * to the copyright license under the clause at DFARS 252.227-7013. This - * notice must appear in all copies of this file and its derivatives. - * - * $Id$ - */ - -#include "system.h" -#include <string.h> /* for memcmp */ - -extern rtems_configuration_table BSP_Configuration; - -char big_send_buffer[2048]; -char big_receive_buffer[2048]; - -long buffer[ 4 ]; - -void dope_buffer(unsigned char *buff, - int buff_size, - unsigned32 v) -{ - int i; - unsigned char ch; - - ch = (' ' + (v % (0x7f - ' '))); - - for (i=0; i<buff_size; i++) - { - *buff++ = ch++; - if (ch >= 0x7f) - ch = ' '; - } -} - -rtems_task Task_1( - rtems_task_argument argument -) -{ - rtems_id qid; - rtems_unsigned32 index; - rtems_unsigned32 count; - rtems_status_code status; - rtems_unsigned32 size; - rtems_unsigned32 queue_size; - char *cp; - - status = rtems_message_queue_ident( - Queue_name[ 1 ], - RTEMS_SEARCH_ALL_NODES, - &qid - ); - printf( "TA1 - rtems_message_queue_ident - qid => %08x\n", qid ); - directive_failed( status, "rtems_message_queue_ident" ); - - Fill_buffer( "BUFFER 1 TO Q 1", buffer ); - puts( "TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1" ); - status = rtems_message_queue_send( Queue_id[ 1 ], buffer, 16 ); - directive_failed( status, "rtems_message_queue_send" ); - - Fill_buffer( "BUFFER 2 TO Q 1", buffer ); - puts( "TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1" ); - status = rtems_message_queue_send( Queue_id[ 1 ], buffer, 16 ); - directive_failed( status, "rtems_message_queue_send" ); - - puts( "TA1 - rtems_task_wake_after - sleep 5 seconds" ); - status = rtems_task_wake_after( 5*TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after" ); - - Fill_buffer( "BUFFER 3 TO Q 1", buffer ); - puts( "TA1 - rtems_message_queue_send - BUFFER 3 TO Q 1" ); - status = rtems_message_queue_send( Queue_id[ 1 ], buffer, 16 ); - directive_failed( status, "rtems_message_queue_send" ); - - puts( "TA1 - rtems_task_wake_after - sleep 5 seconds" ); - status = rtems_task_wake_after( 5*TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after" ); - -rtems_test_pause(); - - Fill_buffer( "BUFFER 1 TO Q 2", buffer ); - puts( "TA1 - rtems_message_queue_send - BUFFER 1 TO Q 2" ); - status = rtems_message_queue_send( Queue_id[ 2 ], buffer, 16 ); - directive_failed( status, "rtems_message_queue_send" ); - - puts_nocr( "TA1 - rtems_message_queue_receive - receive from queue 1 - " ); - puts ( "10 second timeout" ); - status = rtems_message_queue_receive( - Queue_id[ 1 ], - buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - 10 * TICKS_PER_SECOND - ); - directive_failed( status, "rtems_message_queue_receive" ); - puts_nocr( "TA1 - buffer received: " ); - Put_buffer( buffer ); - new_line; - - puts( "TA1 - rtems_task_delete - delete TA2" ); - status = rtems_task_delete( Task_id[ 2 ] ); - directive_failed( status, "rtems_task_delete" ); - - Fill_buffer( "BUFFER 1 TO Q 3", buffer ); - puts( "TA1 - rtems_message_queue_send - BUFFER 1 TO Q 3" ); - status = rtems_message_queue_send( Queue_id[ 3 ], buffer, 16 ); - directive_failed( status, "rtems_message_queue_send" ); - - puts( "TA1 - rtems_task_wake_after - sleep 5 seconds" ); - status = rtems_task_wake_after( 5*TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after" ); - -rtems_test_pause(); - - Fill_buffer( "BUFFER 2 TO Q 3", buffer ); - puts( "TA1 - rtems_message_queue_send - BUFFER 2 TO Q 3" ); - status = rtems_message_queue_send( Queue_id[ 3 ], buffer, 16 ); - directive_failed( status, "rtems_message_queue_send" ); - - Fill_buffer( "BUFFER 3 TO Q 3", buffer ); - puts( "TA1 - rtems_message_queue_send - BUFFER 3 TO Q 3" ); - status = rtems_message_queue_send( Queue_id[ 3 ], buffer, 16 ); - directive_failed( status, "rtems_message_queue_send" ); - - Fill_buffer( "BUFFER 4 TO Q 3", buffer ); - puts( "TA1 - rtems_message_queue_send - BUFFER 4 TO Q 3" ); - status = rtems_message_queue_send( Queue_id[ 3 ], buffer, 16 ); - directive_failed( status, "rtems_message_queue_send" ); - - Fill_buffer( "BUFFER 5 TO Q 3", buffer ); - puts( "TA1 - rtems_message_queue_urgent - BUFFER 5 TO Q 3" ); - status = rtems_message_queue_urgent( Queue_id[ 3 ], buffer, 16 ); - directive_failed( status, "rtems_message_queue_urgent" ); - - for ( index = 1 ; index <= 4 ; index++ ) { - puts( - "TA1 - rtems_message_queue_receive - receive from queue 3 - " - "RTEMS_WAIT FOREVER" - ); - status = rtems_message_queue_receive( - Queue_id[ 3 ], - buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_message_queue_receive" ); - puts_nocr( "TA1 - buffer received: " ); - Put_buffer( buffer ); - new_line; - } - - Fill_buffer( "BUFFER 3 TO Q 2", buffer ); - puts( "TA1 - rtems_message_queue_urgent - BUFFER 3 TO Q 2" ); - status = rtems_message_queue_urgent( Queue_id[ 2 ], buffer, 16 ); - directive_failed( status, "rtems_message_queue_urgent" ); - - puts( - "TA1 - rtems_message_queue_receive - receive from queue 2 - " - "RTEMS_WAIT FOREVER" - ); - status = rtems_message_queue_receive( - Queue_id[ 2 ], - buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_message_queue_receive" ); - puts_nocr( "TA1 - buffer received: " ); - Put_buffer( buffer ); - new_line; - -rtems_test_pause(); - - puts( "TA1 - rtems_message_queue_delete - delete queue 1" ); - status = rtems_message_queue_delete( Queue_id[ 1 ] ); - directive_failed( status, "rtems_message_queue_delete" ); - - Fill_buffer( "BUFFER 3 TO Q 2", buffer ); - puts( "TA1 - rtems_message_queue_urgent - BUFFER 3 TO Q 2" ); - status = rtems_message_queue_urgent( Queue_id[ 2 ], buffer, 16 ); - directive_failed( status, "rtems_message_queue_urgent" ); - - puts( "TA1 - rtems_message_queue_delete - delete queue 2" ); - status = rtems_message_queue_delete( Queue_id[ 2 ] ); - directive_failed( status, "rtems_message_queue_delete" ); - - puts( "TA1 - rtems_message_queue_flush - empty Q 3" ); - status = rtems_message_queue_flush( Queue_id[ 3 ], &count ); - printf( "TA1 - %d messages were flushed from Q 3\n", count ); - - Fill_buffer( "BUFFER 1 TO Q 3", buffer ); - puts( "TA1 - rtems_message_queue_send - BUFFER 1 TO Q 3" ); - status = rtems_message_queue_send( Queue_id[ 3 ], buffer, 16 ); - directive_failed( status, "rtems_message_queue_send" ); - - Fill_buffer( "BUFFER 2 TO Q 3", buffer ); - puts( "TA1 - rtems_message_queue_send - BUFFER 2 TO Q 3" ); - status = rtems_message_queue_send( Queue_id[ 3 ], buffer, 16 ); - directive_failed( status, "rtems_message_queue_send" ); - - Fill_buffer( "BUFFER 3 TO Q 3", buffer ); - puts( "TA1 - rtems_message_queue_send - BUFFER 3 TO Q 3" ); - status = rtems_message_queue_send( Queue_id[ 3 ], buffer, 16 ); - directive_failed( status, "rtems_message_queue_send" ); - - puts( "TA1 - rtems_message_queue_flush - Q 3" ); - status = rtems_message_queue_flush( Queue_id[ 3 ], &count ); - printf( "TA1 - %d messages were flushed from Q 3\n", count ); - - puts( "TA1 - rtems_message_queue_send until all message buffers consumed" ); - while ( FOREVER ) { - status = rtems_message_queue_send( Queue_id[ 3 ], buffer, 16 ); - if ( status == RTEMS_TOO_MANY ) break; - directive_failed( status, "rtems_message_queue_send loop" ); - } - - puts( "TA1 - all message buffers consumed" ); - puts( "TA1 - rtems_message_queue_flush - Q 3" ); - status = rtems_message_queue_flush( Queue_id[ 3 ], &count ); - printf( "TA1 - %d messages were flushed from Q 3\n", count ); - -rtems_test_pause(); - - puts( "TA1 - create message queue of 20 bytes on queue 1" ); - status = rtems_message_queue_create( - Queue_name[ 1 ], - 100, - 20, - RTEMS_DEFAULT_ATTRIBUTES, - &Queue_id[ 1 ] - ); - directive_failed( status, "rtems_message_queue_create of Q1; 20 bytes each" ); - status = rtems_message_queue_send( Queue_id[ 3 ], big_send_buffer, 40 ); - fatal_directive_status(status, RTEMS_INVALID_SIZE, "expected RTEMS_INVALID_SIZE"); - - puts( "TA1 - rtems_message_queue_delete - delete queue 1" ); - status = rtems_message_queue_delete( Queue_id[ 1 ] ); - directive_failed( status, "rtems_message_queue_delete" ); - -rtems_test_pause(); - - puts( "TA1 - rtems_message_queue_create - variable sizes " ); - for (queue_size = 1; queue_size < 1030; queue_size++) - { - status = rtems_message_queue_create( - Queue_name[ 1 ], - 2, /* just 2 msgs each */ - queue_size, - RTEMS_DEFAULT_ATTRIBUTES, - &Queue_id[ 1 ] - ); - if (status != RTEMS_SUCCESSFUL) - { - printf("TA1 - msq que size: %d\n", queue_size); - directive_failed( status, "rtems_message_queue_create of Q1" ); - } - - status = rtems_message_queue_delete( Queue_id[ 1 ] ); - directive_failed( status, "rtems_message_queue_delete" ); - } - - puts( "TA1 - rtems_message_queue_create and send - variable sizes " ); - for (queue_size = 1; queue_size < 1030; queue_size++) - { - /* printf("TA1 - message queue size: %d\n", queue_size); */ - - status = rtems_message_queue_create( - Queue_name[ 1 ], - 2, /* just 2 msgs each */ - queue_size, - RTEMS_DEFAULT_ATTRIBUTES, - &Queue_id[ 1 ] - ); - - directive_failed( status, "rtems_message_queue_create of Q1" ); - - dope_buffer(big_send_buffer, sizeof(big_send_buffer), queue_size); - memset(big_receive_buffer, 'Z', sizeof(big_receive_buffer)); - - /* send a msg too big */ - status = rtems_message_queue_send( Queue_id[ 1 ], - big_send_buffer, - queue_size + 1 ); - - fatal_directive_status(status, - RTEMS_INVALID_SIZE, - "rtems_message_queue_send too large"); - - /* send a msg that is just right */ - status = rtems_message_queue_send(Queue_id[ 1 ], - big_send_buffer, - queue_size); - directive_failed(status, "rtems_message_queue_send exact size"); - - /* now read and verify the message just sent */ - status = rtems_message_queue_receive(Queue_id[ 1 ], - big_receive_buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - 1 * TICKS_PER_SECOND); - directive_failed(status, "rtems_message_queue_receive exact size"); - if (size != queue_size) - { - puts("TA1 - exact size size match failed"); - exit(1); - } - - if (memcmp(big_send_buffer, big_receive_buffer, size) != 0) - { - puts("TA1 - exact size data match failed"); - exit(1); - } - - for (cp = (big_receive_buffer + size); - cp < (big_receive_buffer + sizeof(big_receive_buffer)); - cp++) - if (*cp != 'Z') - { - puts("TA1 - exact size overrun match failed"); - exit(1); - } - - /* all done with this one; delete it */ - status = rtems_message_queue_delete( Queue_id[ 1 ] ); - directive_failed( status, "rtems_message_queue_delete" ); - } - - puts( "*** END OF TEST 13 ***" ); - exit( 0 ); -} diff --git a/testsuites/sptests/sp13/task2.c b/testsuites/sptests/sp13/task2.c deleted file mode 100644 index 1541d6c8bd..0000000000 --- a/testsuites/sptests/sp13/task2.c +++ /dev/null @@ -1,139 +0,0 @@ -/* Task_2 - * - * This routine serves as a test task. Multiple tasks are required to - * verify all message manager capabilities. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * This material may be reproduced by or for the U.S. Government pursuant - * to the copyright license under the clause at DFARS 252.227-7013. This - * notice must appear in all copies of this file and its derivatives. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task_2( - rtems_task_argument argument -) -{ - long buffer[ 4 ]; - rtems_unsigned32 size; - rtems_task_priority previous_priority; - rtems_status_code status; - - puts( - "TA2 - rtems_message_queue_receive - receive from queue 1 - RTEMS_NO_WAIT" - ); - status = rtems_message_queue_receive( - Queue_id[ 1 ], - (long (*)[4])buffer, - &size, - RTEMS_NO_WAIT, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_message_queue_receive" ); - puts_nocr( "TA2 - buffer received: " ); - Put_buffer( buffer ); - new_line; - - puts( - "TA2 - rtems_message_queue_receive - receive from queue 1 - " - "RTEMS_WAIT FOREVER" - ); - status = rtems_message_queue_receive( - Queue_id[ 1 ], - (long (*)[4])buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_message_queue_receive" ); - puts_nocr( "TA2 - buffer received: " ); - Put_buffer( buffer ); - new_line; - - puts( - "TA2 - rtems_message_queue_receive - receive from queue 1 - " - "RTEMS_WAIT FOREVER" - ); - status = rtems_message_queue_receive( - Queue_id[ 1 ], - (long (*)[4])buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_message_queue_receive" ); - puts_nocr( "TA2 - buffer received: " ); - Put_buffer( buffer ); - new_line; - - puts( "TA2 - rtems_task_set_priority - make self highest priority task" ); - status = rtems_task_set_priority( RTEMS_SELF, 3, &previous_priority ); - directive_failed( status, "rtems_task_set_priority" ); - - puts( - "TA2 - rtems_message_queue_receive - receive from queue 2 - " - "RTEMS_WAIT FOREVER" - ); - status = rtems_message_queue_receive( - Queue_id[ 2 ], - (long (*)[4])buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_message_queue_receive" ); - puts_nocr( "TA2 - buffer received: " ); - Put_buffer( buffer ); - new_line; - - Fill_buffer( "BUFFER 2 TO Q 2", (long *)buffer ); - puts( "TA2 - rtems_message_queue_send - BUFFER 2 TO Q 2" ); - directive_failed( status, "rtems_message_queue_send" ); - - status = rtems_message_queue_send( Queue_id[ 2 ], (long (*)[4])buffer, 16 ); - directive_failed( status, "rtems_message_queue_send" ); - - puts( - "TA2 - rtems_message_queue_receive - receive from queue 1 - " - "10 second timeout" - ); - status = rtems_message_queue_receive( - Queue_id[ 1 ], - (long (*)[4])buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - 10 * TICKS_PER_SECOND - ); - directive_failed( status, "rtems_message_queue_receive" ); - puts_nocr( "TA2 - buffer received: " ); - Put_buffer( buffer ); - new_line; - - puts( - "TA2 - rtems_message_queue_receive - receive from queue 3 - " - "RTEMS_WAIT FOREVER" - ); - status = rtems_message_queue_receive( - Queue_id[ 3 ], - (long (*)[4])buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_message_queue_receive" ); - puts_nocr( "TA2 - buffer received: " ); - Put_buffer( buffer ); - new_line; - -} diff --git a/testsuites/sptests/sp13/task3.c b/testsuites/sptests/sp13/task3.c deleted file mode 100644 index f86f91a463..0000000000 --- a/testsuites/sptests/sp13/task3.c +++ /dev/null @@ -1,78 +0,0 @@ -/* Task_3 - * - * This routine serves as a test task. Its major function is to - * broadcast a messge to all the other tasks. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * This material may be reproduced by or for the U.S. Government pursuant - * to the copyright license under the clause at DFARS 252.227-7013. This - * notice must appear in all copies of this file and its derivatives. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task_3( - rtems_task_argument argument -) -{ - long buffer[ 4 ]; - rtems_unsigned32 size; - rtems_unsigned32 count; - rtems_status_code status; - - puts( - "TA3 - rtems_message_queue_receive - receive from queue 2 - " - "RTEMS_WAIT FOREVER" - ); - status = rtems_message_queue_receive( - Queue_id[ 2 ], - (long (*)[4])buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_message_queue_receive" ); - puts_nocr( "TA3 - buffer received: " ); - Put_buffer( buffer ); - new_line; - - Fill_buffer( "BUFFER 3 TO Q 1", (long *)buffer ); - puts( "TA3 - rtems_message_queue_broadcast - BUFFER 3 TO Q 1" ); - status = rtems_message_queue_broadcast( - Queue_id[ 1 ], - (long (*)[4])buffer, - 16, - &count - ); - printf( "TA3 - number of tasks awakened = %02d\n", count ); - puts( - "TA3 - rtems_message_queue_receive - receive from queue 3 - " - "RTEMS_WAIT FOREVER" - ); - - status = rtems_message_queue_receive( - Queue_id[ 3 ], - (long (*)[4])buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_message_queue_receive" ); - puts_nocr( "TA3 - buffer received: " ); - Put_buffer( buffer ); - new_line; - - puts( "TA3 - rtems_task_delete - delete self" ); - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} |