source: rtems/c/src/tests/sptests/spfatal/puterr.c @ 0836603

4.104.114.84.95
Last change on this file since 0836603 was ac7d5ef0, checked in by Joel Sherrill <joel.sherrill@…>, on May 11, 1995 at 5:39:37 PM

Initial revision

  • Property mode set to 100644
File size: 2.6 KB
Line 
1/*  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, 1990, 1991, 1992, 1993, 1994.
12 *  On-Line Applications Research Corporation (OAR).
13 *  All rights assigned to U.S. Government, 1994.
14 *
15 *  This material may be reproduced by or for the U.S. Government pursuant
16 *  to the copyright license under the clause at DFARS 252.227-7013.  This
17 *  notice must appear in all copies of this file and its derivatives.
18 *
19 *  $Id$
20 */
21
22#include "system.h"
23
24char *Errors[] = {
25  "RTEMS_SUCCESSFUL",               /* successful completion */
26  "RTEMS_TASK_EXITTED",             /* returned from a task */
27  "RTEMS_MP_NOT_CONFIGURED",        /* multiprocessing not configured */
28  "RTEMS_INVALID_NAME",             /* invalid object name */
29  "RTEMS_INVALID_ID",               /* invalid object id */
30  "RTEMS_TOO_MANY",                 /* too many */
31  "RTEMS_TIMEOUT",                  /* timed out waiting */
32  "RTEMS_OBJECT_WAS_DELETED",       /* object was deleted while waiting */
33  "RTEMS_INVALID_SIZE",             /* specified size was invalid */
34  "RTEMS_INVALID_ADDRESS",          /* address specified is invalid */
35  "RTEMS_INVALID_NUMBER",           /* number was invalid */
36  "RTEMS_NOT_DEFINED",              /* item has not been initialized */
37  "RTEMS_RESOURCE_IN_USE",          /* resources still outstanding */
38  "RTEMS_UNSATISFIED",              /* request not satisfied */
39  "RTEMS_INCORRECT_STATE",          /* task is in wrong state */
40  "RTEMS_ALREADY_SUSPENDED",        /* task already in state */
41  "RTEMS_ILLEGAL_ON_SELF",          /* illegal operation on calling task */
42  "RTEMS_ILLEGAL_ON_REMOTE_OBJECT", /* illegal operation for remote object */
43  "RTEMS_CALLED_FROM_ISR",          /* called from ISR */
44  "RTEMS_INVALID_PRIORITY",         /* invalid task priority */
45  "RTEMS_INVALID_CLOCK",            /* invalid date/time */
46  "RTEMS_INVALID_NODE",             /* invalid node id */
47  "RTEMS_NOT_OWNER_OF_RESOURCE",    /* not owner of resource */
48  "RTEMS_NOT_CONFIGURED",           /* directive not configured */
49  "RTEMS_NOT_IMPLEMENTED"           /* directive not implemented */
50};
51
52/* Task states */
53
54void put_error(
55  rtems_unsigned32  error,
56  rtems_status_code expected
57)
58{
59
60  if ( error <= RTEMS_NOT_IMPLEMENTED )
61    printf( "EXPECTED FATAL - error code is correctly %s\n", Errors[ error ] );
62  else
63    printf( "ERROR - out of range error code is %d\n", error );
64
65  if ( error != expected ) {
66    printf( "ERROR - did not get expected code of %d\n", expected );
67  }
68}
Note: See TracBrowser for help on using the repository browser.