source: rtems/testsuites/sptests/sp55/init.c @ 630a2a6

4.104.115
Last change on this file since 630a2a6 was 630a2a6, checked in by Joel Sherrill <joel.sherrill@…>, on 07/06/09 at 17:10:39

2009-07-06 Joel Sherrill <joel.sherrill@…>

  • Makefile.am, configure.ac: Add new test to exercise case when broadcasting to a message queue with a pending message.
  • sp55/.cvsignore, sp55/Makefile.am, sp55/init.c, sp55/sp55.doc, sp55/sp55.scn: New files.
  • Property mode set to 100644
File size: 2.0 KB
Line 
1/*  Broadcast to a message queue with pending messages
2 *
3 *  COPYRIGHT (c) 1989-2009.
4 *  On-Line Applications Research Corporation (OAR).
5 *
6 *  The license and distribution terms for this file may be
7 *  found in the file LICENSE in this distribution or at
8 *  http://www.rtems.com/license/LICENSE.
9 *
10 *  $Id$
11 */
12
13#include <tmacros.h>
14
15rtems_task Init(
16  rtems_task_argument ignored
17)
18{
19  rtems_status_code    status;
20  rtems_id             id;
21  int                  msg = 1;
22  uint32_t             count = 20;
23
24  puts( "\n\n*** TEST 55 ***" );
25
26  puts( "Init - rtems_message_queue_create - OK" );
27  status = rtems_message_queue_create(
28    rtems_build_name( 'Q', '1', ' ', ' ' ),
29    2,
30    sizeof(int),
31    RTEMS_DEFAULT_ATTRIBUTES,
32    &id
33  );
34  directive_failed( status, "rtems_message_queue_create" );
35
36  puts( "Init - rtems_message_queue_send - make message pending - OK" );
37  status = rtems_message_queue_send( id, &msg, sizeof(msg) );
38  directive_failed( status, "rtems_message_queue_send" );
39
40  puts( "Init - rtems_message_queue_broadcast - with message pending - OK" );
41  status = rtems_message_queue_broadcast( id, &msg, sizeof(msg), &count );
42  directive_failed( status, "rtems_message_queue_broadcast" );
43  if ( count != 0 ) {
44    puts( "broadcast with message pending FAILED" );
45    rtems_test_exit(0);
46  }
47
48  puts( "Init - rtems_message_queue_delete - OK" );
49  status = rtems_message_queue_delete( id );
50  directive_failed( status, "rtems_message_queue_delete" );
51
52  puts( "*** END OF TEST 55 ***" );
53  rtems_test_exit(0);
54}
55
56/* configuration information */
57
58#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
59#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
60
61#define CONFIGURE_MAXIMUM_TASKS              1
62#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES     1
63#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
64
65#define CONFIGURE_MESSAGE_BUFFER_MEMORY \
66        CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( 2, sizeof(int) )
67
68#define CONFIGURE_INIT
69#include <rtems/confdefs.h>
70
71/* global variables */
Note: See TracBrowser for help on using the repository browser.