Changeset a74aefe in rtems


Ignore:
Timestamp:
Nov 27, 2007, 8:42:42 PM (13 years ago)
Author:
Glenn Humphrey <glenn.humphrey@…>
Branches:
4.8
Children:
32daf5d
Parents:
7301b37
Message:

2007-11-27 Glenn Humphrey <glenn.humphrey@…>

  • sp33/init.c, sp33/sp33.scn: Added several test cases to improve test coverage.
Location:
testsuites/sptests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • testsuites/sptests/ChangeLog

    r7301b37 ra74aefe  
     12007-11-27      Glenn Humphrey <glenn.humphrey@OARcorp.com>
     2
     3        * sp33/init.c, sp33/sp33.scn: Added several test cases to improve test
     4        coverage.
     5
    162007-11-06      Joel Sherrill <joel.sherrill@OARcorp.com>
    27
  • testsuites/sptests/sp33/init.c

    r7301b37 ra74aefe  
    6767  puts("\n\n*** TEST 33 ***");
    6868
    69   /* create period */
    70   puts( "Create Barrier" );
     69  /* Check bad argument cases */
     70  puts( "Delete barrier with bad id" );
     71  status = rtems_barrier_delete( 100 );
     72  fatal_directive_status(
     73    status,
     74    RTEMS_INVALID_ID,
     75    "rtems_barrier_delete did not return RTEMS_INVALID_ID"
     76  );
     77
     78  puts( "Release barrier with bad id" );
     79  status = rtems_barrier_release( 100, &released );
     80  fatal_directive_status(
     81    status,
     82    RTEMS_INVALID_ID,
     83    "rtems_barrier_release did not return RTEMS_INVALID_ID"
     84  );
     85
     86  puts( "Wait on barrier with bad id" );
     87  status = rtems_barrier_wait( 100, 10 );
     88  fatal_directive_status(
     89    status,
     90    RTEMS_INVALID_ID,
     91    "rtems_barrier_wait did not return RTEMS_INVALID_ID"
     92  );
     93
     94  /* Create barrier with automatic release and 0 maximum waiters */
     95  puts( "Create barrier with automatic release and 0 max waiters" );
     96  status = rtems_barrier_create(
     97    name, RTEMS_BARRIER_AUTOMATIC_RELEASE, 0, &Barrier
     98  );
     99  fatal_directive_status(
     100    status,
     101    RTEMS_INVALID_NUMBER,
     102    "rtems_barrier_create did not return RTEMS_INVALID_NUMBER"
     103  );
     104
     105  /* Create barrier */
     106  puts( "Create barrier" );
    71107  status = rtems_barrier_create( name, RTEMS_DEFAULT_ATTRIBUTES, 0, &Barrier );
    72108  directive_failed(status, "rtems_barrier_create");
    73109
    74   puts( "Check Barrier ident" );
     110  /* Check for creating too many */
     111  puts( "Create too many barriers" );
     112  status = rtems_barrier_create( name, RTEMS_DEFAULT_ATTRIBUTES, 0, &Barrier );
     113  fatal_directive_status(
     114    status,
     115    RTEMS_TOO_MANY,
     116    "rtems_barrier_create did not return RTEMS_TOO_MANY"
     117  );
     118
     119  puts( "Check barrier ident" );
    75120  status = rtems_barrier_ident( name, &testId );
    76121  directive_failed(status, "rtems_barrier_ident");
     
    80125  }
    81126
    82   puts( "Wait on Barrier w/timeout and TIMEOUT" );
     127  puts( "Wait on barrier w/timeout and TIMEOUT" );
    83128  status = rtems_barrier_wait( Barrier, 25 );
    84129  fatal_directive_status(
     
    96141  }
    97142
    98   /*
    99    *  Create some tasks to wait for the barrier
    100    */
     143  /*  Create some tasks to wait for the barrier */
    101144  SuccessfulCase = TRUE;
    102145  DeletedCase    = FALSE;
    103   puts( "\n*** Testing Regular Release of Barrier ***" );
     146  puts( "\n*** Testing manual release of barrier ***" );
    104147  for (i=0 ; i<(CONFIGURE_MAXIMUM_TASKS-1) ; i++) {
    105148    status = rtems_task_create(
     
    117160  }
    118161
    119 
    120162  puts( "Delay to let Waiters block" );
    121163  status = rtems_task_wake_after( TICKS_PER_SECOND );
     
    136178  directive_failed(status, "rtems_task_wake_after");
    137179
    138   /*
    139    *  Create some tasks to wait for the barrier
    140    */
     180  /*  Create some tasks to wait for the barrier */
    141181  SuccessfulCase = FALSE;
    142182  DeletedCase    = TRUE;
    143   puts( "\n*** Testing Deletion of Barrier ***" );
     183  puts( "\n*** Testing Deletion of barrier ***" );
    144184  for (i=0 ; i<(CONFIGURE_MAXIMUM_TASKS-1) ; i++) {
    145185    status = rtems_task_create(
     
    169209  directive_failed(status, "rtems_task_wake_after");
    170210
     211  /* Create barrier with automatic release */
     212  puts( "Create barrier" );
     213  status = rtems_barrier_create(
     214    name, RTEMS_BARRIER_AUTOMATIC_RELEASE, CONFIGURE_MAXIMUM_TASKS-1, &Barrier
     215  );
     216  directive_failed(status, "rtems_barrier_create");
     217
     218  /*  Create some tasks to wait for the barrier */
     219  SuccessfulCase = TRUE;
     220  DeletedCase    = FALSE;
     221  puts( "\n*** Testing automatic release of barrier ***" );
     222  for (i=0 ; i<(CONFIGURE_MAXIMUM_TASKS-1) ; i++) {
     223    status = rtems_task_create(
     224      rtems_build_name('W','A','I','T'),
     225      1,
     226      RTEMS_MINIMUM_STACK_SIZE,
     227      RTEMS_DEFAULT_MODES,
     228      RTEMS_DEFAULT_ATTRIBUTES,
     229      &Tasks[ i ]
     230    );
     231    directive_failed( status, "rtems_task_create of Waiter" );
     232
     233    status = rtems_task_start( Tasks[ i ], Waiter, i );
     234    directive_failed( status, "rtems_task_start of Waiter" );
     235  }
     236
     237  puts( "Delay to let task wait on barrier" );
     238  status = rtems_task_wake_after( TICKS_PER_SECOND );
     239  directive_failed(status, "rtems_task_wake_after");
     240
    171241  /* the end */
    172242  printf("*** END OF TEST SP33 ***\n");
  • testsuites/sptests/sp33/sp33.scn

    r7301b37 ra74aefe  
     1*** TEST 33 ***
     2Delete barrier with bad id
     3Release barrier with bad id
     4Wait on barrier with bad id
     5Create barrier with automatic release and 0 max waiters
     6Create barrier
     7Create too many barriers
     8Check barrier ident
     9Wait on barrier w/timeout and TIMEOUT
     10
     11*** Testing manual release of barrier ***
     12Delay to let Waiters block
     13Waiter 0 waiting on barrier
     14Waiter 1 waiting on barrier
     15Waiter 2 waiting on barrier
     16Waiter 3 waiting on barrier
     17Releasing tasks
     18Delay to let Waiters print a message
     19Waiter 0 back from barrier
     20Waiter 1 back from barrier
     21Waiter 2 back from barrier
     22Waiter 3 back from barrier
     23
     24*** Testing Deletion of barrier ***
     25Delay to let Waiters block
     26Waiter 0 waiting on barrier
     27Waiter 1 waiting on barrier
     28Waiter 2 waiting on barrier
     29Waiter 3 waiting on barrier
     30Delete barrier
     31Delay to let Waiters print a message
     32Waiter 0 back from barrier
     33Waiter 1 back from barrier
     34Waiter 2 back from barrier
     35Waiter 3 back from barrier
     36Create barrier
     37
     38*** Testing automatic release of barrier ***
     39Delay to let task wait on barrier
     40Waiter 0 waiting on barrier
     41Waiter 1 waiting on barrier
     42Waiter 2 waiting on barrier
     43Waiter 3 waiting on barrier
     44Waiter 3 back from barrier
     45Waiter 0 back from barrier
     46Waiter 1 back from barrier
     47Waiter 2 back from barrier
     48*** END OF TEST SP33 ***
Note: See TracChangeset for help on using the changeset viewer.