mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-10-06 10:59:48 +08:00
sptests/sp13: Exercise rtems_message_queue_construct() in task1
sp13 already constructs Q3 using rtems_message_queue_construct() in init.c but task1.c never sends to, receives from, or deletes the constructed queue. Extend task1.c to send a message to Q3, receive it back, and delete the queue after the variable-size loop completes. This exercises the full lifecycle of a queue created with static storage and storage_free set to NULL. Verified on arm/realview_pbx_a9_qemu with QEMU 9.0.2, RTEMS 7.0.0.a413333f2f04130e82e15addba402887222c345f, GCC 15.2.0.
This commit is contained in:
committed by
Kinsey Moore
parent
2308b1e588
commit
19c75efc9e
@@ -375,6 +375,28 @@ rtems_task Task_1( rtems_task_argument argument )
|
||||
directive_failed( status, "rtems_message_queue_delete" );
|
||||
}
|
||||
|
||||
Fill_buffer( "BUFFER 1 TO Q 3", buffer );
|
||||
puts( "TA1 - rtems_message_queue_send - BUFFER 1 TO Q 3 (construct)" );
|
||||
status = rtems_message_queue_send( Queue_id[ 3 ], buffer, MESSAGE_SIZE );
|
||||
directive_failed( status, "rtems_message_queue_send to constructed queue" );
|
||||
|
||||
puts( "TA1 - rtems_message_queue_receive - receive from Q 3 (construct)" );
|
||||
status = rtems_message_queue_receive(
|
||||
Queue_id[ 3 ],
|
||||
buffer,
|
||||
&size,
|
||||
RTEMS_DEFAULT_OPTIONS,
|
||||
RTEMS_NO_TIMEOUT
|
||||
);
|
||||
directive_failed( status, "rtems_message_queue_receive from constructed queue" );
|
||||
puts_nocr( "TA1 - buffer received: " );
|
||||
Put_buffer( buffer );
|
||||
new_line;
|
||||
|
||||
puts( "TA1 - rtems_message_queue_delete - delete queue 3 (construct)" );
|
||||
status = rtems_message_queue_delete( Queue_id[ 3 ] );
|
||||
directive_failed( status, "rtems_message_queue_delete of constructed queue" );
|
||||
|
||||
TEST_END();
|
||||
rtems_test_exit( 0 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user