/* Task_1 * * This task generates all possible errors for the RTEMS executive. * * Input parameters: * argument - task argument * * Output parameters: NONE * * COPYRIGHT (c) 1989-1999. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.org/license/LICENSE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "system.h" #include rtems_task Task_1( rtems_task_argument argument ) { uint32_t notepad_value; rtems_id self_id; rtems_task_priority previous_priority; rtems_status_code status; /* bad Id */ status = rtems_task_is_suspended( 100 ); fatal_directive_status( status, RTEMS_INVALID_ID, "rtems_task_set_priority with illegal id" ); puts( "TA1 - rtems_task_is_suspended - RTEMS_INVALID_ID" ); /* bad Id */ status = rtems_task_delete( 100 ); fatal_directive_status( status, RTEMS_INVALID_ID, "rtems_task_delete with illegal id" ); puts( "TA1 - rtems_task_delete - RTEMS_INVALID_ID" ); /** START OF NOTEPAD TESTS **/ /* * We know this is deprecated and don't want a warning on every BSP built. */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" /* NULL return */ status = rtems_task_get_note( RTEMS_SELF, RTEMS_NOTEPAD_FIRST, NULL ); fatal_directive_status( status, RTEMS_INVALID_ADDRESS, "rtems_task_get_note with NULL param" ); puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_ADDRESS" ); /* note too high */ status = rtems_task_get_note( RTEMS_SELF, 100, ¬epad_value ); fatal_directive_status( status, RTEMS_INVALID_NUMBER, "rtems_task_get_note with illegal notepad" ); puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_NUMBER" ); /* bad Id */ status = rtems_task_get_note( 100, RTEMS_NOTEPAD_LAST, ¬epad_value ); fatal_directive_status( status, RTEMS_INVALID_ID, "rtems_task_get_note with illegal id" ); puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_ID" ); /* unused Id so invalid now */ status = rtems_task_get_note( Task_id[ 0 ], RTEMS_NOTEPAD_LAST, ¬epad_value ); fatal_directive_status( status, RTEMS_INVALID_ID, "rtems_task_get_note with illegal id" ); puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_ID" ); status = rtems_task_get_note( _RTEMS_tasks_Information.minimum_id + (3L<