Changeset 6605d4d in rtems


Ignore:
Timestamp:
Aug 5, 2009, 3:21:43 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
76a670b
Parents:
0d15414e
Message:

2009-08-05 Santosh G Vattam <vattam.santosh@…>

  • Makefile.am, psxmsgq04/init.c, psxmsgq04/psxmsgq04.doc, psxmsgq04/psxmsgq04.scn: Exercise running out of memory while allocating the message buffers for a POSIX message queue.
Location:
testsuites/psxtests
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/ChangeLog

    r0d15414e r6605d4d  
     12009-08-05      Santosh G Vattam <vattam.santosh@gmail.com>
     2
     3        * Makefile.am, psxmsgq04/init.c, psxmsgq04/psxmsgq04.doc,
     4        psxmsgq04/psxmsgq04.scn: Exercise running out of memory while
     5        allocating the message buffers for a POSIX message queue.
     6
    172009-08-02      Joel Sherrill <joel.sherrill@oarcorp.com>
    28
  • testsuites/psxtests/Makefile.am

    r0d15414e r6605d4d  
    99    psxcancel psxcleanup psxcond01 psxenosys psxkey01 psxkey02 psxkey03 \
    1010    psxitimer psxmsgq01 psxmsgq02 psxmsgq03 psxmsgq04 psxmutexattr01 psxobj01 \
    11     psxrwlock01 psxsem01 psxsignal01 psxsignal02 psxsignal03 psxsignal03 \
     11    psxrwlock01 psxsem01 psxsignal01 psxsignal02 psxsignal03 psxsignal04 \
    1212    psxspin01 psxspin02 psxsysconf psxtime psxtimer01 psxtimer02 psxualarm \
    1313    psxfatal01 psxfatal02 \
  • testsuites/psxtests/psxmsgq04/init.c

    r0d15414e r6605d4d  
    2525)
    2626{
    27   struct mq_attr   attr;
    28   mqd_t            Queue;
    29   int              sc;
     27  struct mq_attr          attr;
     28  mqd_t                   Queue, second_Queue;
     29  int                     sc;
     30  Heap_Information_block  info;
     31  bool                    sb;
    3032
    3133  puts( "\n\n*** POSIX MESSAGE QUEUE TEST 4 ***" );
    3234
    33   attr.mq_maxmsg  = 1;
     35  attr.mq_maxmsg = 1;
    3436  attr.mq_msgsize = sizeof(int);
    3537
     
    5254  assert( sc == 0 );
    5355
     56  puts( "Init - Memory allocation error test" );
     57
     58  sb = rtems_workspace_get_information( &info );
     59
     60  attr.mq_msgsize = info.Free.largest;
     61
     62  while ( attr.mq_msgsize > 0 ) {
     63    second_Queue = mq_open("second_queue",O_CREAT | O_RDWR, 0x777, &attr );
     64    if ( second_Queue!=(-1) )
     65      break;
     66    attr.mq_msgsize -= 48;
     67  }
     68
     69  if ( second_Queue == (-1) ) {
     70    perror( "mq_open failed" );
     71    assert( second_Queue != (-1) );
     72  }
     73
     74  puts( "Init - Message Queue created" );
     75  puts( "Init - Unlink message queue" );
     76    sc = mq_unlink( "second_queue" );
     77    if ( sc != 0 )
     78      perror( "mq_unlink failed" );
     79    assert( sc==0 );
     80
     81  puts( "Init - Close message queue" );
     82    sc = mq_close( second_Queue );
     83    if ( sc !=0 )
     84      perror( "mq_close failed" );
     85    assert( sc == 0 );
    5486  puts( "*** END OF POSIX MESSAGE QUEUE TEST 4 ***" );
    5587  rtems_test_exit( 0 );
  • testsuites/psxtests/psxmsgq04/psxmsgq04.scn

    r0d15414e r6605d4d  
     1*** POSIX MESSAGE QUEUE TEST 4 ***
     2Init - Open message queue
     3Init - Unlink message queue
     4Init - Close message queue
     5Init - Memory allocation error test
     6Init - Message Queue created
     7Init - Unlink message queue
     8Init - Close message queue
     9*** END OF POSIX MESSAGE QUEUE TEST 4 ***
Note: See TracChangeset for help on using the changeset viewer.