/* put_error
|
/* put_error
|
*
|
*
|
* This routine verifies that the given error is the expected error.
|
* This routine verifies that the given error is the expected error.
|
*
|
*
|
* Input parameters:
|
* Input parameters:
|
* error - actual error code
|
* error - actual error code
|
* expected - expected error code
|
* expected - expected error code
|
*
|
*
|
* Output parameters: NONE
|
* Output parameters: NONE
|
*
|
*
|
* COPYRIGHT (c) 1989-1999.
|
* COPYRIGHT (c) 1989-1999.
|
* On-Line Applications Research Corporation (OAR).
|
* On-Line Applications Research Corporation (OAR).
|
*
|
*
|
* The license and distribution terms for this file may be
|
* The license and distribution terms for this file may be
|
* found in the file LICENSE in this distribution or at
|
* found in the file LICENSE in this distribution or at
|
* http://www.OARcorp.com/rtems/license.html.
|
* http://www.OARcorp.com/rtems/license.html.
|
*
|
*
|
* $Id: puterr.c,v 1.2 2001-09-27 12:02:38 chris Exp $
|
* $Id: puterr.c,v 1.2 2001-09-27 12:02:38 chris Exp $
|
*/
|
*/
|
|
|
#include "system.h"
|
#include "system.h"
|
|
|
char *Errors[] = {
|
char *Errors[] = {
|
"RTEMS_SUCCESSFUL", /* successful completion */
|
"RTEMS_SUCCESSFUL", /* successful completion */
|
"RTEMS_TASK_EXITTED", /* returned from a task */
|
"RTEMS_TASK_EXITTED", /* returned from a task */
|
"RTEMS_MP_NOT_CONFIGURED", /* multiprocessing not configured */
|
"RTEMS_MP_NOT_CONFIGURED", /* multiprocessing not configured */
|
"RTEMS_INVALID_NAME", /* invalid object name */
|
"RTEMS_INVALID_NAME", /* invalid object name */
|
"RTEMS_INVALID_ID", /* invalid object id */
|
"RTEMS_INVALID_ID", /* invalid object id */
|
"RTEMS_TOO_MANY", /* too many */
|
"RTEMS_TOO_MANY", /* too many */
|
"RTEMS_TIMEOUT", /* timed out waiting */
|
"RTEMS_TIMEOUT", /* timed out waiting */
|
"RTEMS_OBJECT_WAS_DELETED", /* object was deleted while waiting */
|
"RTEMS_OBJECT_WAS_DELETED", /* object was deleted while waiting */
|
"RTEMS_INVALID_SIZE", /* specified size was invalid */
|
"RTEMS_INVALID_SIZE", /* specified size was invalid */
|
"RTEMS_INVALID_ADDRESS", /* address specified is invalid */
|
"RTEMS_INVALID_ADDRESS", /* address specified is invalid */
|
"RTEMS_INVALID_NUMBER", /* number was invalid */
|
"RTEMS_INVALID_NUMBER", /* number was invalid */
|
"RTEMS_NOT_DEFINED", /* item has not been initialized */
|
"RTEMS_NOT_DEFINED", /* item has not been initialized */
|
"RTEMS_RESOURCE_IN_USE", /* resources still outstanding */
|
"RTEMS_RESOURCE_IN_USE", /* resources still outstanding */
|
"RTEMS_UNSATISFIED", /* request not satisfied */
|
"RTEMS_UNSATISFIED", /* request not satisfied */
|
"RTEMS_INCORRECT_STATE", /* task is in wrong state */
|
"RTEMS_INCORRECT_STATE", /* task is in wrong state */
|
"RTEMS_ALREADY_SUSPENDED", /* task already in state */
|
"RTEMS_ALREADY_SUSPENDED", /* task already in state */
|
"RTEMS_ILLEGAL_ON_SELF", /* illegal operation on calling task */
|
"RTEMS_ILLEGAL_ON_SELF", /* illegal operation on calling task */
|
"RTEMS_ILLEGAL_ON_REMOTE_OBJECT", /* illegal operation for remote object */
|
"RTEMS_ILLEGAL_ON_REMOTE_OBJECT", /* illegal operation for remote object */
|
"RTEMS_CALLED_FROM_ISR", /* called from ISR */
|
"RTEMS_CALLED_FROM_ISR", /* called from ISR */
|
"RTEMS_INVALID_PRIORITY", /* invalid task priority */
|
"RTEMS_INVALID_PRIORITY", /* invalid task priority */
|
"RTEMS_INVALID_CLOCK", /* invalid date/time */
|
"RTEMS_INVALID_CLOCK", /* invalid date/time */
|
"RTEMS_INVALID_NODE", /* invalid node id */
|
"RTEMS_INVALID_NODE", /* invalid node id */
|
"RTEMS_NOT_OWNER_OF_RESOURCE", /* not owner of resource */
|
"RTEMS_NOT_OWNER_OF_RESOURCE", /* not owner of resource */
|
"RTEMS_NOT_CONFIGURED", /* directive not configured */
|
"RTEMS_NOT_CONFIGURED", /* directive not configured */
|
"RTEMS_NOT_IMPLEMENTED" /* directive not implemented */
|
"RTEMS_NOT_IMPLEMENTED" /* directive not implemented */
|
};
|
};
|
|
|
/* Task states */
|
/* Task states */
|
|
|
void put_error(
|
void put_error(
|
rtems_unsigned32 error,
|
rtems_unsigned32 error,
|
rtems_status_code expected
|
rtems_status_code expected
|
)
|
)
|
{
|
{
|
|
|
if ( error <= RTEMS_NOT_IMPLEMENTED )
|
if ( error <= RTEMS_NOT_IMPLEMENTED )
|
printf( "EXPECTED FATAL - error code is correctly %s\n", Errors[ error ] );
|
printf( "EXPECTED FATAL - error code is correctly %s\n", Errors[ error ] );
|
else
|
else
|
printf( "ERROR - out of range error code is %d\n", error );
|
printf( "ERROR - out of range error code is %d\n", error );
|
|
|
if ( error != expected ) {
|
if ( error != expected ) {
|
printf( "ERROR - did not get expected code of %d\n", expected );
|
printf( "ERROR - did not get expected code of %d\n", expected );
|
}
|
}
|
}
|
}
|
|
|