Changeset 8d8c1f1 in rtems


Ignore:
Timestamp:
Sep 28, 2009, 7:39:06 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
1b0c122b
Parents:
a611d80
Message:

2009-09-28 Joel Sherrill <joel.sherrill@…>

  • sp09/screen02.c, sp09/screen04.c, sp09/screen07.c, sp09/screen09.c, sp09/screen10.c, sp09/screen11.c, sp09/screen12.c, sp09/sp09.scn: Add some error cases uncovered by uC5282 coverage runs.
Location:
testsuites/sptests
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • testsuites/sptests/ChangeLog

    ra611d80 r8d8c1f1  
     12009-09-28      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * sp09/screen02.c, sp09/screen04.c, sp09/screen07.c, sp09/screen09.c,
     4        sp09/screen10.c, sp09/screen11.c, sp09/screen12.c, sp09/sp09.scn: Add
     5        some error cases uncovered by uC5282 coverage runs.
     6
    172009-09-28      Joel Sherrill <joel.sherrill@OARcorp.com>
    28
  • testsuites/sptests/sp09/screen02.c

    ra611d80 r8d8c1f1  
    2626  rtems_status_code status;
    2727
     28  puts( "TA1 - rtems_clock_get_tod - RTEMS_INVALID_ADDRESS" );
     29  status = rtems_clock_get_tod( NULL );
     30  fatal_directive_status(
     31    status,
     32    RTEMS_INVALID_ADDRESS,
     33    "rtems_clock_get_tod NULL param"
     34  );
     35
    2836/* errors before clock is set */
    2937
     
    4351  }
    4452
     53  puts( "TA1 - rtems_clock_get_seconds_since_epoch - RTEMS_INVALID_ADDRESS" );
     54  status = rtems_clock_get_seconds_since_epoch( NULL );
     55  fatal_directive_status(
     56    status,
     57    RTEMS_INVALID_ADDRESS,
     58    "rtems_clock_get_seconds_since_epoch NULL param"
     59  );
     60
    4561  status = rtems_clock_get_seconds_since_epoch( &interval );
    4662  if ( status == RTEMS_SUCCESSFUL ) {
     
    5874  }
    5975
     76  puts( "TA1 - rtems_clock_get_uptime - RTEMS_INVALID_ADDRESS" );
     77  status = rtems_clock_get_uptime( NULL );
     78  fatal_directive_status(
     79    status,
     80    RTEMS_INVALID_ADDRESS,
     81    "rtems_clock_get_uptime NULL param"
     82  );
     83
     84  puts( "TA1 - rtems_clock_get_tod_timeval - RTEMS_INVALID_ADDRESS" );
     85  status = rtems_clock_get_tod_timeval( NULL );
     86  fatal_directive_status(
     87    status,
     88    RTEMS_INVALID_ADDRESS,
     89    "rtems_clock_get_tod_timeval NULL param"
     90  );
     91
    6092  status = rtems_clock_get_tod_timeval( &tv );
    6193  if ( status == RTEMS_SUCCESSFUL ) {
     
    72104    puts( "TA1 - rtems_clock_get_tod_timeval - RTEMS_NOT_DEFINED" );
    73105  }
     106
     107  puts( "TA1 - rtems_clock_set_nanoseconds_extension - RTEMS_INVALID_ADDRESS" );
     108  status = rtems_clock_set_nanoseconds_extension( NULL );
     109  fatal_directive_status(
     110    status,
     111    RTEMS_INVALID_ADDRESS,
     112    "rtems_clock_set_nanoseconds_extension NULL param"
     113  );
     114
     115  /* NULL parameter */
     116  status = rtems_clock_set( NULL );
     117  fatal_directive_status(
     118    status,
     119    RTEMS_INVALID_ADDRESS,
     120    "rtems_clock_get sull pointer"
     121  );
     122  puts( "TA1 - rtems_clock_set - RTEMS_INVALID_ADDRESS" );
     123
     124  /* NULL parameter */
     125  status = rtems_clock_get( RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, NULL );
     126  fatal_directive_status(
     127    status,
     128    RTEMS_INVALID_ADDRESS,
     129    "rtems_clock_get null pointer"
     130  );
     131  puts( "TA1 - rtems_clock_get - RTEMS_INVALID_ADDRESS" );
    74132
    75133  /* arbitrary bad value for switch */
  • testsuites/sptests/sp09/screen04.c

    ra611d80 r8d8c1f1  
    2626  time_t            seconds;
    2727  rtems_status_code status;
     28
     29  status = rtems_event_receive(
     30    RTEMS_EVENT_16,
     31    RTEMS_NO_WAIT,
     32    RTEMS_NO_TIMEOUT,
     33    NULL
     34  );
     35  fatal_directive_status(
     36    status,
     37    RTEMS_INVALID_ADDRESS,
     38    "rtems_event_receive NULL param"
     39  );
     40  puts( "TA1 - rtems_event_receive - NULL param - RTEMS_INVALID_ADDRESS" );
    2841
    2942  status = rtems_event_receive(
  • testsuites/sptests/sp09/screen07.c

    ra611d80 r8d8c1f1  
    3636  puts( "TA1 - rtems_message_queue_broadcast - RTEMS_INVALID_ID" );
    3737
     38  /* null ID parameter */
     39  status = rtems_message_queue_create(
     40    Queue_name[ 1 ],
     41    3,
     42    MESSAGE_SIZE,
     43    RTEMS_DEFAULT_ATTRIBUTES,
     44    NULL
     45  );
     46  fatal_directive_status(
     47    status,
     48    RTEMS_INVALID_ADDRESS,
     49    "rtems_message_queue_create with null param"
     50  );
     51  puts( "TA1 - rtems_message_queue_create - NULL Id - RTEMS_INVALID_ADDRESS" );
     52
     53  /* count == 0 */
     54  status = rtems_message_queue_create(
     55    Queue_name[ 1 ],
     56    0,
     57    MESSAGE_SIZE,
     58    RTEMS_DEFAULT_ATTRIBUTES,
     59    &Junk_id
     60  );
     61  fatal_directive_status(
     62    status,
     63    RTEMS_INVALID_NUMBER,
     64    "rtems_message_queue_create with 0 count"
     65  );
     66  puts( "TA1 - rtems_message_queue_create - count = 0 - RTEMS_INVALID_NUMBER" );
     67
     68  /* max size == 0 */
     69  status = rtems_message_queue_create(
     70    Queue_name[ 1 ],
     71    3,
     72    0,
     73    RTEMS_DEFAULT_ATTRIBUTES,
     74    &Junk_id
     75  );
     76  fatal_directive_status(
     77    status,
     78    RTEMS_INVALID_SIZE,
     79    "rtems_message_queue_create with 0 msg size"
     80  );
     81  puts( "TA1 - rtems_message_queue_create - size = 0 - RTEMS_INVALID_SIZE" );
     82
     83  /* bad name parameter */
    3884  status = rtems_message_queue_create(
    3985    0,
     
    134180  puts( "TA1 - rtems_message_queue_ident - RTEMS_INVALID_NAME" );
    135181
     182  /* number pending - bad Id */
     183  status = rtems_message_queue_get_number_pending( Queue_id[ 1 ], NULL );
     184  fatal_directive_status(
     185    status,
     186    RTEMS_INVALID_ADDRESS,
     187    "rtems_message_queue_get_number_pending with NULL param"
     188  );
     189  puts("TA1 - rtems_message_queue_get_number_pending - RTEMS_INVALID_ADDRESS");
     190
     191  /* number pending - bad Id */
    136192  status = rtems_message_queue_get_number_pending( 100, &count );
    137193  fatal_directive_status(
     
    142198  puts( "TA1 - rtems_message_queue_get_number_pending - RTEMS_INVALID_ID" );
    143199
     200  /* flush null param */
     201  status = rtems_message_queue_flush( Queue_id[ 1 ], NULL );
     202  fatal_directive_status(
     203    status,
     204    RTEMS_INVALID_ADDRESS,
     205    "rtems_message_queue_flush with NULL param"
     206  );
     207  puts( "TA1 - rtems_message_queue_flush - RTEMS_INVALID_ADDRESS" );
     208
     209  /* flush invalid id */
    144210  status = rtems_message_queue_flush( 100, &count );
    145211  fatal_directive_status(
     
    224290  );
    225291
     292  /* send NULL message*/
     293  status = rtems_message_queue_send( Queue_id[ 1 ], NULL, MESSAGE_SIZE );
     294  fatal_directive_status(
     295    status,
     296    RTEMS_INVALID_ADDRESS,
     297    "rtems_message_queue_send with NULL buffer"
     298  );
     299  puts(
     300    "TA1 - rtems_message_queue_send - NULL buffer - RTEMS_INVALID_ADDRESS"
     301  );
     302
     303  /* send bad id */
    226304  status = rtems_message_queue_send( 100, buffer, MESSAGE_SIZE );
    227305  fatal_directive_status(
     
    248326  puts( "TA1 - rtems_message_queue_send - BUFFER 3 TO Q 1 - RTEMS_TOO_MANY" );
    249327
     328  /* urgent NULL message*/
     329  status = rtems_message_queue_urgent( Queue_id[ 1 ], NULL, MESSAGE_SIZE );
     330  fatal_directive_status(
     331    status,
     332    RTEMS_INVALID_ADDRESS,
     333    "rtems_message_queue_urgent with NULL buffer"
     334  );
     335  puts(
     336    "TA1 - rtems_message_queue_urgent - NULL buffer - RTEMS_INVALID_ADDRESS"
     337  );
     338
     339  /* urgent bad Id */
    250340  status = rtems_message_queue_urgent( 100, buffer, MESSAGE_SIZE );
    251341  fatal_directive_status(
  • testsuites/sptests/sp09/screen09.c

    ra611d80 r8d8c1f1  
    166166    "rtems_port_external_to_internal with illegal id"
    167167  );
    168   puts( "TA1 - rtems_port_external_to_internal - RTEMS_INVALID_ID" );
     168
     169  status = rtems_port_external_to_internal(
     170    100,
     171    Internal_port_area,
     172    NULL
     173  );
     174  fatal_directive_status(
     175    status,
     176    RTEMS_INVALID_ADDRESS,
     177    "rtems_port_external_to_internal with NULL param"
     178  );
     179  puts( "TA1 - rtems_port_external_to_internal - RTEMS_INVALID_ADDRESS" );
     180
    169181  status = rtems_port_internal_to_external(
    170182    100,
     
    178190  );
    179191  puts( "TA1 - rtems_port_internal_to_external - RTEMS_INVALID_ID" );
     192
     193  status = rtems_port_internal_to_external(
     194    100,
     195    Internal_port_area,
     196    NULL
     197  );
     198  fatal_directive_status(
     199    status,
     200    RTEMS_INVALID_ADDRESS,
     201    "rtems_port_internal_to_external with NULL param"
     202  );
     203  puts( "TA1 - rtems_port_external_to_internal - RTEMS_INVALID_ADDRESS" );
    180204}
  • testsuites/sptests/sp09/screen10.c

    ra611d80 r8d8c1f1  
    2727   * Check create error cases.
    2828   */
     29  status = rtems_rate_monotonic_create( Period_name[ 1 ], NULL );
     30  fatal_directive_status(
     31    status,
     32    RTEMS_INVALID_ADDRESS,
     33    "rtems_rate_monotonic_create with NULL param"
     34  );
     35
     36  puts( "TA1 - rtems_rate_monotonic_create - RTEMS_INVALID_ADDRESS" );
     37
    2938  status = rtems_rate_monotonic_create( 0, &Junk_id );
    3039  fatal_directive_status(
     
    115124
    116125  /*
     126   * Check get_statistics error cases.
     127   */
     128  status = rtems_rate_monotonic_get_statistics( Period_id[ 1 ], NULL );
     129  fatal_directive_status(
     130    status,
     131    RTEMS_INVALID_ADDRESS,
     132    "rtems_rate_monotonic_get_statistics with NULL param"
     133  );
     134  puts( "TA1 - rtems_rate_monotonic_get_statistics - RTEMS_INVALID_ADDRESS" );
     135
     136  /*
    117137   * Check get_status error cases.
    118138   */
     139  status = rtems_rate_monotonic_get_status( Period_id[ 1 ], NULL );
     140  fatal_directive_status(
     141    status,
     142    RTEMS_INVALID_ADDRESS,
     143    "rtems_rate_monotonic_get_status with NULL param"
     144  );
     145  puts( "TA1 - rtems_rate_monotonic_get_status - RTEMS_INVALID_ADDRESS" );
     146
    119147  status = rtems_rate_monotonic_get_status( 100, &period_status );
    120148  fatal_directive_status(
  • testsuites/sptests/sp09/screen11.c

    ra611d80 r8d8c1f1  
    192192  puts( "TA1 - rtems_partition_delete - local RTEMS_INVALID_ID" );
    193193
     194  /* get bad address */
     195  status = rtems_partition_get_buffer( 100, NULL );
     196  fatal_directive_status(
     197    status,
     198    RTEMS_INVALID_ADDRESS,
     199    "rtems_partition_get_buffer with NULL param"
     200  );
     201  puts( "TA1 - rtems_partition_get_buffer - RTEMS_INVALID_ADDRESS" );
     202
     203  /* get bad Id */
    194204  status = rtems_partition_get_buffer( 100, &buffer_address_1 );
    195205  fatal_directive_status(
     
    216226  puts( "TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ID" );
    217227
     228  /* create bad area */
     229  status = rtems_partition_create(
     230    Partition_name[ 1 ],
     231    NULL,
     232    128,
     233    64,
     234    RTEMS_DEFAULT_ATTRIBUTES,
     235    &Junk_id
     236  );
     237  fatal_directive_status(
     238    status,
     239    RTEMS_INVALID_ADDRESS,
     240    "rtems_partition_return_buffer with NULL area"
     241  );
     242  puts( "TA1 - rtems_partition_create - RTEMS_INVALID_ADDRESS" );
     243
     244  /* create OK */
    218245  status = rtems_partition_create(
    219246    Partition_name[ 1 ],
  • testsuites/sptests/sp09/screen12.c

    ra611d80 r8d8c1f1  
    128128  puts( "TA1 - rtems_region_create - RTEMS_SUCCESSFUL" );
    129129
     130  /* extend NULL address */
     131  status = rtems_region_extend(
     132    Region_id[ 1 ],
     133    NULL,
     134    REGION_LENGTH - 1
     135  );
     136  fatal_directive_status(
     137    status,
     138    RTEMS_INVALID_ADDRESS,
     139    "rtems_region_extend with NULL"
     140  );
     141  puts( "TA1 - rtems_region_extend - NULL address - RTEMS_INVALID_ADDRESS" );
     142
     143  /* extend within heap */
    130144  status = rtems_region_extend(
    131145    Region_id[ 1 ],
     
    213227  puts( "TA1 - rtems_region_get_free_information - unknown RTEMS_INVALID_ID" );
    214228
     229  /* get segment illegal id */
    215230  status = rtems_region_get_segment(
    216231    100,
     
    227242  puts( "TA1 - rtems_region_get_segment - RTEMS_INVALID_ID" );
    228243
     244  /* get_segment with NULL param */
     245  status = rtems_region_get_segment(
     246     Region_id[ 1 ],
     247     2,
     248     RTEMS_DEFAULT_OPTIONS,
     249     RTEMS_NO_TIMEOUT,
     250     NULL
     251  );
     252  fatal_directive_status(
     253    status,
     254    RTEMS_INVALID_ADDRESS,
     255    "rtems_region_get_segment with NULL param"
     256  );
     257  puts( "TA1 - rtems_region_get_segment - RTEMS_INVALID_ADDRESS" );
     258
     259  /* get_segment with illegal 0 size */
     260  status = rtems_region_get_segment(
     261     Region_id[ 1 ],
     262     0,
     263     RTEMS_DEFAULT_OPTIONS,
     264     RTEMS_NO_TIMEOUT,
     265     &segment_address_1
     266  );
     267  fatal_directive_status(
     268    status,
     269    RTEMS_INVALID_SIZE,
     270    "rtems_region_get_segment with 0 size"
     271  );
     272  puts( "TA1 - rtems_region_get_segment - 0 size - RTEMS_INVALID_SIZE" );
     273
     274  /* get_segment with illegal big size */
    229275  status = rtems_region_get_segment(
    230276     Region_id[ 1 ],
     
    237283    status,
    238284    RTEMS_INVALID_SIZE,
    239     "rtems_region_get_segment with illegal size"
    240   );
    241   puts( "TA1 - rtems_region_get_segment - RTEMS_INVALID_SIZE" );
     285    "rtems_region_get_segment with big size"
     286  );
     287  puts( "TA1 - rtems_region_get_segment - too big - RTEMS_INVALID_SIZE" );
    242288
    243289  status = rtems_region_get_segment(
  • testsuites/sptests/sp09/sp09.scn

    ra611d80 r8d8c1f1  
    2323TA1 - rtems_task_suspend - RTEMS_INVALID_ID
    2424<pause - screen 2>
     25TA1 - rtems_clock_get_tod - RTEMS_INVALID_ADDRESS
    2526TA1 - rtems_clock_get_tod - RTEMS_NOT_DEFINED
     27TA1 - rtems_clock_get_seconds_since_epoch - RTEMS_INVALID_ADDRESS
    2628TA1 - rtems_clock_get_second_since_epoch - RTEMS_NOT_DEFINED
     29TA1 - rtems_clock_get_uptime - RTEMS_INVALID_ADDRESS
     30TA1 - rtems_clock_get_tod_timeval - RTEMS_INVALID_ADDRESS
    2731TA1 - rtems_clock_get_tod_timeval - RTEMS_NOT_DEFINED
     32TA1 - rtems_clock_set_nanoseconds_extension - RTEMS_INVALID_ADDRESS
     33TA1 - rtems_clock_set - RTEMS_INVALID_ADDRESS
     34TA1 - rtems_clock_get - RTEMS_INVALID_ADDRESS
    2835TA1 - rtems_clock_get - RTEMS_INVALID_NUMBER
    2936TA1 - rtems_task_wake_when - RTEMS_NOT_DEFINED
     
    6168TA1 - rtems_task_create - RTEMS_MP_NOT_CONFIGURED
    6269<pause - screen 4>
     70TA1 - rtems_event_receive - NULL param - RTEMS_INVALID_ADDRESS
    6371TA1 - rtems_event_receive - RTEMS_UNSATISFIED ( all conditions )
    6472TA1 - rtems_event_receive - RTEMS_UNSATISFIED ( any condition )
     
    106114<pause - screen 7>
    107115TA1 - rtems_message_queue_broadcast - RTEMS_INVALID_ID
     116TA1 - rtems_message_queue_create - NULL Id - RTEMS_INVALID_ADDRESS
     117TA1 - rtems_message_queue_create - count = 0 - RTEMS_INVALID_NUMBER
     118TA1 - rtems_message_queue_create - size = 0 - RTEMS_INVALID_SIZE
    108119TA1 - rtems_message_queue_create - Q 1 - RTEMS_INVALID_NAME
    109120TA1 - rtems_message_queue_create - Q 1 - RTEMS_MP_NOT_CONFIGURED
     
    114125TA1 - rtems_message_queue_delete - local RTEMS_INVALID_ID
    115126TA1 - rtems_message_queue_ident - RTEMS_INVALID_NAME
     127TA1 - rtems_message_queue_get_number_pending - RTEMS_INVALID_ADDRESS
    116128TA1 - rtems_message_queue_get_number_pending - RTEMS_INVALID_ID
    117129TA1 - rtems_message_queue_flush - RTEMS_INVALID_ID
     
    122134TA1 - rtems_message_queue_receive - Q 1 - timeout in 3 seconds
    123135TA1 - rtems_message_queue_receive - Q 1 - woke up with RTEMS_TIMEOUT
     136TA1 - rtems_message_queue_send - RTEMS_INVALID_ADDRESS
    124137TA1 - rtems_message_queue_send - RTEMS_INVALID_ID
    125138TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 - RTEMS_SUCCESSFUL
    126139TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 - RTEMS_SUCCESSFUL
    127140TA1 - rtems_message_queue_send - BUFFER 3 TO Q 1 - RTEMS_TOO_MANY
     141TA1 - rtems_message_queue_urgent - RTEMS_INVALID_ADDRESS
    128142TA1 - rtems_message_queue_urgent - RTEMS_INVALID_ID
    129143TA1 - rtems_message_queue_broadcast - NULL buffer - RTEMS_INVALID_ADDRESS
     
    163177TA1 - rtems_port_ident - RTEMS_INVALID_NAME
    164178TA1 - rtems_port_external_to_internal - RTEMS_INVALID_ID
     179TA1 - rtems_port_external_to_internal - RTEMS_INVALID_ADDRESS
    165180TA1 - rtems_port_internal_to_external - RTEMS_INVALID_ID
     181TA1 - rtems_port_internal_to_external - RTEMS_INVALID_ADDRESS
    166182<pause - screen 10>
     183TA1 - rtems_rate_monotonic_create - RTEMS_INVALID_ADDRESS
    167184TA1 - rtems_rate_monotonic_create - RTEMS_INVALID_NAME
    168185TA1 - rtems_rate_monotonic_create - RTEMS_SUCCESSFUL
     
    175192TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_SUCCESSFUL
    176193TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_TIMEOUT
     194TA1 - rtems_rate_monotonic_get_statistics - RTEMS_INVALID_ADDRESS
     195TA1 - rtems_rate_monotonic_get_status - RTEMS_INVALID_ADDRESS
    177196TA1 - rtems_rate_monotonic_get_status - RTEMS_INVALID_ID
    178197TA1 - rtems_rate_monotonic_cancel - RTEMS_INVALID_ID
     
    198217TA1 - rtems_partition_delete - unknown RTEMS_INVALID_ID
    199218TA1 - rtems_partition_delete - local RTEMS_INVALID_ID
     219TA1 - rtems_partition_get_buffer - RTEMS_INVALID_ADDRESS
    200220TA1 - rtems_partition_get_buffer - RTEMS_INVALID_ID
    201221TA1 - rtems_partition_ident - RTEMS_INVALID_NAME
    202222TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ID
     223TA1 - rtems_partition_create - RTEMS_INVALID_ADDRESS
    203224TA1 - rtems_partition_create - RTEMS_SUCCESSFUL
    204225TA1 - rtems_partition_create - RTEMS_TOO_MANY
     
    216237TA1 - rtems_region_create - RTEMS_INVALID_ADDRESS
    217238TA1 - rtems_region_create - RTEMS_SUCCESSFUL
     239TA1 - rtems_region_extend - NULL address - RTEMS_INVALID_ADDRESS
    218240TA1 - rtems_region_extend - address within - RTEMS_INVALID_ADDRESS
    219241TA1 - rtems_region_create - RTEMS_TOO_MANY
     
    226248TA1 - rtems_region_get_free_information - unknown RTEMS_INVALID_ID
    227249TA1 - rtems_region_get_segment - RTEMS_INVALID_ID
     250TA1 - rtems_region_get_segment - RTEMS_INVALID_ADDRESS
     251TA1 - rtems_region_get_segment - 0 size - RTEMS_INVALID_SIZE
     252TA1 - rtems_region_get_segment - too big - RTEMS_INVALID_SIZE
    228253TA1 - rtems_region_get_segment - RTEMS_INVALID_SIZE
    229254TA1 - rtems_region_get_segment - RTEMS_SUCCESSFUL
Note: See TracChangeset for help on using the changeset viewer.