Changeset 0c5a8be8 in rtems for testsuites/sptests/sp43


Ignore:
Timestamp:
Jul 9, 2009, 4:58:04 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
af690b85
Parents:
66abaa1
Message:

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

  • sp43/init.c, sp43/sp43.scn: Add test of having the object class pointer being null. This does not happen naturally at this time so force the point.
Location:
testsuites/sptests/sp43
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • testsuites/sptests/sp43/init.c

    r66abaa1 r0c5a8be8  
    1212 */
    1313
     14#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
    1415#define CONFIGURE_INIT
    1516#include "system.h"
     
    400401  print_class_info( OBJECTS_CLASSIC_API, OBJECTS_RTEMS_TIMERS, &info );
    401402
    402 
     403  /*
     404   *  Ugly hack to force a weird error
     405   */
     406  {
     407    rtems_status_code                sc;
     408    rtems_task_priority              old_priority;
     409    void                            *tmp;
     410    int                              class;
     411    int                              api;
     412
     413    class = OBJECTS_INTERNAL_API;
     414    api   = OBJECTS_INTERNAL_THREADS;
     415
     416    puts( "rtems_task_set_priority - use valid Idle thread id" );
     417    sc = rtems_task_set_priority(
     418      rtems_build_id( class, api, 1, 1 ),
     419      RTEMS_CURRENT_PRIORITY,
     420      &old_priority
     421    );
     422    directive_failed( sc, "rtems_task_set_priority" );
     423
     424    /* destroy class pointer */
     425    puts( "rtems_task_set_priority - clobber internal thread class info" );
     426    tmp = _Objects_Information_table[ class ][ api ];
     427    _Objects_Information_table[ class ][ api ] = NULL;
     428
     429    puts( "rtems_task_set_priority - use valid Idle thread id again" );
     430    sc = rtems_task_set_priority(
     431      rtems_build_id( class, api, 1, 1 ),
     432      RTEMS_CURRENT_PRIORITY,
     433      &old_priority
     434    );
     435    fatal_directive_status( sc, RTEMS_INVALID_ID, "rtems_task_set_priority" );
     436
     437    /* restore pointer */
     438    puts( "rtems_task_set_priority - restore internal thread class info" );
     439    _Objects_Information_table[ class ][ api ] = tmp;
     440  }
     441 
    403442  puts( "*** END OF TEST 43 ***" );
    404443  rtems_test_exit( 0 );
  • testsuites/sptests/sp43/sp43.scn

    r66abaa1 r0c5a8be8  
    8484    maximum     :          1 available : 1
    8585    auto_extend : no
     86rtems_task_set_priority - use valid Idle thread id
     87rtems_task_set_priority - clobber internal thread class info
     88rtems_task_set_priority - use valid Idle thread id again
     89rtems_task_set_priority - restore internal thread class info
    8690*** END OF TEST 43 ***
Note: See TracChangeset for help on using the changeset viewer.