[rtems commit] tests: Use rtems_status_text()

Sebastian Huber sebh at rtems.org
Tue Mar 25 08:25:24 UTC 2014


Module:    rtems
Branch:    master
Commit:    2272905333bf42690d3badbe052586f568e19436
Changeset: http://git.rtems.org/rtems/commit/?id=2272905333bf42690d3badbe052586f568e19436

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Mar 25 08:06:06 2014 +0100

tests: Use rtems_status_text()

---

 testsuites/psxtests/psxfatal_support/init.c |   30 +--------------------------
 testsuites/sptests/spfatal_support/init.c   |   30 +--------------------------
 2 files changed, 2 insertions(+), 58 deletions(-)

diff --git a/testsuites/psxtests/psxfatal_support/init.c b/testsuites/psxtests/psxfatal_support/init.c
index 56747bb..000f883 100644
--- a/testsuites/psxtests/psxfatal_support/init.c
+++ b/testsuites/psxtests/psxfatal_support/init.c
@@ -34,34 +34,6 @@ void *POSIX_Init(
   rtems_test_exit(0);
 }
 
-char *Errors_Rtems[] = {
-  "RTEMS_SUCCESSFUL",               /* successful completion */
-  "RTEMS_TASK_EXITTED",             /* returned from a task */
-  "RTEMS_MP_NOT_CONFIGURED",        /* multiprocessing not configured */
-  "RTEMS_INVALID_NAME",             /* invalid object name */
-  "RTEMS_INVALID_ID",               /* invalid object id */
-  "RTEMS_TOO_MANY",                 /* too many */
-  "RTEMS_TIMEOUT",                  /* timed out waiting */
-  "RTEMS_OBJECT_WAS_DELETED",       /* object was deleted while waiting */
-  "RTEMS_INVALID_SIZE",             /* specified size was invalid */
-  "RTEMS_INVALID_ADDRESS",          /* address specified is invalid */
-  "RTEMS_INVALID_NUMBER",           /* number was invalid */
-  "RTEMS_NOT_DEFINED",              /* item has not been initialized */
-  "RTEMS_RESOURCE_IN_USE",          /* resources still outstanding */
-  "RTEMS_UNSATISFIED",              /* request not satisfied */
-  "RTEMS_INCORRECT_STATE",          /* task is in wrong state */
-  "RTEMS_ALREADY_SUSPENDED",        /* task already in state */
-  "RTEMS_ILLEGAL_ON_SELF",          /* illegal operation on calling task */
-  "RTEMS_ILLEGAL_ON_REMOTE_OBJECT", /* illegal operation for remote object */
-  "RTEMS_CALLED_FROM_ISR",          /* called from ISR */
-  "RTEMS_INVALID_PRIORITY",         /* invalid task priority */
-  "RTEMS_INVALID_CLOCK",            /* invalid date/time */
-  "RTEMS_INVALID_NODE",             /* invalid node id */
-  "RTEMS_NOT_OWNER_OF_RESOURCE",    /* not owner of resource */
-  "RTEMS_NOT_CONFIGURED",           /* directive not configured */
-  "RTEMS_NOT_IMPLEMENTED"           /* directive not implemented */
-};
-
 void Put_Error( uint32_t source, uint32_t error )
 {
   if ( source == INTERNAL_ERROR_CORE ) {
@@ -71,7 +43,7 @@ void Put_Error( uint32_t source, uint32_t error )
     if (error >  RTEMS_NOT_IMPLEMENTED )
       printk("Unknown Internal Rtems Error (%d)", error);
     else
-      printk( Errors_Rtems[ error ] );
+      printk( "%s", rtems_status_text( error ) );
   }
   else if (source == INTERNAL_ERROR_POSIX_API ) {
       printk( "SOURCE=%d ERROR=%d %s", source, error, strerror( error ) );
diff --git a/testsuites/sptests/spfatal_support/init.c b/testsuites/sptests/spfatal_support/init.c
index cab5417..6a6f340 100644
--- a/testsuites/sptests/spfatal_support/init.c
+++ b/testsuites/sptests/spfatal_support/init.c
@@ -34,34 +34,6 @@ rtems_task Init(
   rtems_test_exit(0);
 }
 
-char *Errors_Rtems[] = {
-  "RTEMS_SUCCESSFUL",               /* successful completion */
-  "RTEMS_TASK_EXITTED",             /* returned from a task */
-  "RTEMS_MP_NOT_CONFIGURED",        /* multiprocessing not configured */
-  "RTEMS_INVALID_NAME",             /* invalid object name */
-  "RTEMS_INVALID_ID",               /* invalid object id */
-  "RTEMS_TOO_MANY",                 /* too many */
-  "RTEMS_TIMEOUT",                  /* timed out waiting */
-  "RTEMS_OBJECT_WAS_DELETED",       /* object was deleted while waiting */
-  "RTEMS_INVALID_SIZE",             /* specified size was invalid */
-  "RTEMS_INVALID_ADDRESS",          /* address specified is invalid */
-  "RTEMS_INVALID_NUMBER",           /* number was invalid */
-  "RTEMS_NOT_DEFINED",              /* item has not been initialized */
-  "RTEMS_RESOURCE_IN_USE",          /* resources still outstanding */
-  "RTEMS_UNSATISFIED",              /* request not satisfied */
-  "RTEMS_INCORRECT_STATE",          /* task is in wrong state */
-  "RTEMS_ALREADY_SUSPENDED",        /* task already in state */
-  "RTEMS_ILLEGAL_ON_SELF",          /* illegal operation on calling task */
-  "RTEMS_ILLEGAL_ON_REMOTE_OBJECT", /* illegal operation for remote object */
-  "RTEMS_CALLED_FROM_ISR",          /* called from ISR */
-  "RTEMS_INVALID_PRIORITY",         /* invalid task priority */
-  "RTEMS_INVALID_CLOCK",            /* invalid date/time */
-  "RTEMS_INVALID_NODE",             /* invalid node id */
-  "RTEMS_NOT_OWNER_OF_RESOURCE",    /* not owner of resource */
-  "RTEMS_NOT_CONFIGURED",           /* directive not configured */
-  "RTEMS_NOT_IMPLEMENTED"           /* directive not implemented */
-};
-
 void Put_Error( uint32_t source, uint32_t error )
 {
   if ( source == INTERNAL_ERROR_CORE ) {
@@ -71,7 +43,7 @@ void Put_Error( uint32_t source, uint32_t error )
     if (error >  RTEMS_NOT_IMPLEMENTED )
       printk("Unknown Internal Rtems Error (0x%08x)", error);
     else
-      printk( Errors_Rtems[ error ] );
+      printk( "%s", rtems_status_text( error ) );
   }
 }
 




More information about the vc mailing list