Changeset b34685f4 in rtems


Ignore:
Timestamp:
Jun 20, 2010, 10:16:25 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
c5d8d2dc
Parents:
7d1a2437
Message:

2010-06-20 Joel Sherrill <joel.sherrill@…>

  • spfifo08/init.c: Catch more cases but discussion on errors and proper behaviour remain.
Location:
testsuites/sptests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • testsuites/sptests/ChangeLog

    r7d1a2437 rb34685f4  
     12010-06-20      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * spfifo08/init.c: Catch more cases but discussion on errors and proper
     4        behaviour remain.
     5
    162010-06-20      Joel Sherrill <joel.sherrill@oarcorp.com>
    27
  • testsuites/sptests/spfifo08/init.c

    r7d1a2437 rb34685f4  
    1616#include <sys/stat.h>
    1717#include <fcntl.h>
     18#include <unistd.h>
    1819#include <errno.h>
    1920
     
    3233  BarrierCount = 0;
    3334
     35  memset( Barriers, 0, sizeof(Barriers) );
    3436  for ( i=0 ; i<MAXIMUM ; i++ ) {
    3537    status = rtems_barrier_create(
     
    4042    );
    4143    if ( status == RTEMS_TOO_MANY ) {
    42       printf( "%d Barriers created\n", BarrierCount );
     44      printf( "%d Barriers created\n", BarrierCount+1 );
    4345      return;
    4446    }
     
    6567    );
    6668    if ( status == RTEMS_TOO_MANY ) {
    67       printf( "%d Semaphores created\n", SemaphoreCount );
     69      printf( "%d Semaphores created\n", SemaphoreCount+1 );
    6870      return;
    6971    }
     
    7880  rtems_status_code status;
    7981 
    80   puts( "Deleting a barrier" );
     82  BarrierCount--;
     83  printf( "Deleting barrier id=0x%08x\n",
     84    (unsigned int)Barriers[BarrierCount] );
    8185  status = rtems_barrier_delete( Barriers[BarrierCount] );
    8286  directive_failed( status, "barrier delete" );
     
    8791  rtems_status_code status;
    8892 
    89   puts( "Deleting a semaphore" );
     93  SemaphoreCount--;
     94  printf( "Deleting semaphore id=0x%08x\n",
     95    (unsigned int) Semaphores[SemaphoreCount] );
    9096  status = rtems_semaphore_delete( Semaphores[SemaphoreCount] );
    9197  directive_failed( status, "semaphore delete" );
     
    108114  if ( expected ) {
    109115    rtems_test_assert(fd == -1);
    110     rtems_test_assert(errno == expected);
     116    rtems_test_assert(errno == expected); 
    111117  } else {
    112118    rtems_test_assert(fd != -1);
     
    130136  create_fifo();
    131137 
    132   puts( "Opening FIFO.. expect ENOMEM (barrier - case 1)" );
    133   open_fifo(ENOMEM);
     138  puts( "Opening FIFO.. expect ENFILE (barrier - case 1)" );
     139  open_fifo(ENFILE); /* XXX ENOMEM */
    134140
    135141  delete_barrier();
    136   puts( "Opening FIFO.. expect ENOMEM (barrier - case 2)" );
    137   open_fifo(ENOMEM);
     142  puts( "Opening FIFO.. expect ENFILE (barrier - case 2)" );
     143  open_fifo(ENFILE); /* XXX ENOMEM */
    138144
    139145  delete_barrier();
    140   puts( "Opening FIFO.. expect ENOMEM (semaphore - case 1)" );
     146  puts( "Opening FIFO.. expect ENFILE (semaphore - case 1)" );
     147  open_fifo(ENFILE); /* XXX ENOMEM */
    141148
     149  delete_semaphore();
     150  puts( "Opening FIFO.. expect ERROR ???" );
     151  open_fifo(EINTR); /* XXX ENOMEM */
     152
     153  delete_semaphore();
     154  puts( "Opening FIFO.. expect ENOSPC???" );
     155  open_fifo(ENOMEM);
     156 
     157  delete_semaphore();
     158  puts( "Opening FIFO.. expect OK???" );
    142159  open_fifo(0);
    143  
     160
    144161  puts( "*** END OF TEST FIFO 08 ***" );
    145162
Note: See TracChangeset for help on using the changeset viewer.