| 1 |
30 |
unneback |
/* put_error
|
| 2 |
|
|
*
|
| 3 |
|
|
* This routine verifies that the given error is the expected error.
|
| 4 |
|
|
*
|
| 5 |
|
|
* Input parameters:
|
| 6 |
|
|
* error - actual error code
|
| 7 |
|
|
* expected - expected error code
|
| 8 |
|
|
*
|
| 9 |
|
|
* Output parameters: NONE
|
| 10 |
|
|
*
|
| 11 |
|
|
* COPYRIGHT (c) 1989-1999.
|
| 12 |
|
|
* On-Line Applications Research Corporation (OAR).
|
| 13 |
|
|
*
|
| 14 |
|
|
* The license and distribution terms for this file may be
|
| 15 |
|
|
* found in the file LICENSE in this distribution or at
|
| 16 |
|
|
* http://www.OARcorp.com/rtems/license.html.
|
| 17 |
|
|
*
|
| 18 |
|
|
* $Id: puterr.c,v 1.2 2001-09-27 12:02:38 chris Exp $
|
| 19 |
|
|
*/
|
| 20 |
|
|
|
| 21 |
|
|
#include "system.h"
|
| 22 |
|
|
|
| 23 |
|
|
char *Errors[] = {
|
| 24 |
|
|
"RTEMS_SUCCESSFUL", /* successful completion */
|
| 25 |
|
|
"RTEMS_TASK_EXITTED", /* returned from a task */
|
| 26 |
|
|
"RTEMS_MP_NOT_CONFIGURED", /* multiprocessing not configured */
|
| 27 |
|
|
"RTEMS_INVALID_NAME", /* invalid object name */
|
| 28 |
|
|
"RTEMS_INVALID_ID", /* invalid object id */
|
| 29 |
|
|
"RTEMS_TOO_MANY", /* too many */
|
| 30 |
|
|
"RTEMS_TIMEOUT", /* timed out waiting */
|
| 31 |
|
|
"RTEMS_OBJECT_WAS_DELETED", /* object was deleted while waiting */
|
| 32 |
|
|
"RTEMS_INVALID_SIZE", /* specified size was invalid */
|
| 33 |
|
|
"RTEMS_INVALID_ADDRESS", /* address specified is invalid */
|
| 34 |
|
|
"RTEMS_INVALID_NUMBER", /* number was invalid */
|
| 35 |
|
|
"RTEMS_NOT_DEFINED", /* item has not been initialized */
|
| 36 |
|
|
"RTEMS_RESOURCE_IN_USE", /* resources still outstanding */
|
| 37 |
|
|
"RTEMS_UNSATISFIED", /* request not satisfied */
|
| 38 |
|
|
"RTEMS_INCORRECT_STATE", /* task is in wrong state */
|
| 39 |
|
|
"RTEMS_ALREADY_SUSPENDED", /* task already in state */
|
| 40 |
|
|
"RTEMS_ILLEGAL_ON_SELF", /* illegal operation on calling task */
|
| 41 |
|
|
"RTEMS_ILLEGAL_ON_REMOTE_OBJECT", /* illegal operation for remote object */
|
| 42 |
|
|
"RTEMS_CALLED_FROM_ISR", /* called from ISR */
|
| 43 |
|
|
"RTEMS_INVALID_PRIORITY", /* invalid task priority */
|
| 44 |
|
|
"RTEMS_INVALID_CLOCK", /* invalid date/time */
|
| 45 |
|
|
"RTEMS_INVALID_NODE", /* invalid node id */
|
| 46 |
|
|
"RTEMS_NOT_OWNER_OF_RESOURCE", /* not owner of resource */
|
| 47 |
|
|
"RTEMS_NOT_CONFIGURED", /* directive not configured */
|
| 48 |
|
|
"RTEMS_NOT_IMPLEMENTED" /* directive not implemented */
|
| 49 |
|
|
};
|
| 50 |
|
|
|
| 51 |
|
|
/* Task states */
|
| 52 |
|
|
|
| 53 |
|
|
void put_error(
|
| 54 |
|
|
rtems_unsigned32 error,
|
| 55 |
|
|
rtems_status_code expected
|
| 56 |
|
|
)
|
| 57 |
|
|
{
|
| 58 |
|
|
|
| 59 |
|
|
if ( error <= RTEMS_NOT_IMPLEMENTED )
|
| 60 |
|
|
printf( "EXPECTED FATAL - error code is correctly %s\n", Errors[ error ] );
|
| 61 |
|
|
else
|
| 62 |
|
|
printf( "ERROR - out of range error code is %d\n", error );
|
| 63 |
|
|
|
| 64 |
|
|
if ( error != expected ) {
|
| 65 |
|
|
printf( "ERROR - did not get expected code of %d\n", expected );
|
| 66 |
|
|
}
|
| 67 |
|
|
}
|