[rtems commit] testsuites: Use rtems_fatal_source_description()
Sebastian Huber
sebh at rtems.org
Sun Jan 27 12:57:33 UTC 2013
Module: rtems
Branch: master
Commit: 565d8daad54c42ef28da849ff6dcec0a6b009e09
Changeset: http://git.rtems.org/rtems/commit/?id=565d8daad54c42ef28da849ff6dcec0a6b009e09
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Sun Jan 27 13:05:13 2013 +0100
testsuites: Use rtems_fatal_source_description()
---
testsuites/psxtests/psxfatal_support/init.c | 13 ++-----------
testsuites/psxtests/psxfatal_support/system.h | 2 +-
testsuites/sptests/spfatal_support/init.c | 14 ++------------
testsuites/sptests/spfatal_support/system.h | 4 +---
4 files changed, 6 insertions(+), 27 deletions(-)
diff --git a/testsuites/psxtests/psxfatal_support/init.c b/testsuites/psxtests/psxfatal_support/init.c
index ee1e33e..06c90a7 100644
--- a/testsuites/psxtests/psxfatal_support/init.c
+++ b/testsuites/psxtests/psxfatal_support/init.c
@@ -34,12 +34,6 @@ void *POSIX_Init(
rtems_test_exit(0);
}
-char *Sources[] = {
- "INTERNAL_ERROR_CORE",
- "INTERNAL_ERROR_RTEMS_API",
- "INTERNAL_ERROR_POSIX_API",
-};
-
char *Errors_Rtems[] = {
"RTEMS_SUCCESSFUL", /* successful completion */
"RTEMS_TASK_EXITTED", /* returned from a task */
@@ -84,12 +78,9 @@ void Put_Error( uint32_t source, uint32_t error )
}
}
-void Put_Source( uint32_t source )
+void Put_Source( rtems_fatal_source source )
{
- if ( source > INTERNAL_ERROR_POSIX_API )
- printk("Unknown Source (%d)", source);
- else
- printk( Sources[ source ] );
+ printk( "%s", rtems_fatal_source_description( source ) );
}
diff --git a/testsuites/psxtests/psxfatal_support/system.h b/testsuites/psxtests/psxfatal_support/system.h
index d791b19..4293474 100644
--- a/testsuites/psxtests/psxfatal_support/system.h
+++ b/testsuites/psxtests/psxfatal_support/system.h
@@ -24,7 +24,7 @@
/* functions */
void force_error(void);
-void Put_Source(uint32_t source);
+void Put_Source( rtems_fatal_source source );
void Put_Error(
uint32_t source,
diff --git a/testsuites/sptests/spfatal_support/init.c b/testsuites/sptests/spfatal_support/init.c
index 5554e88..4ed7435 100644
--- a/testsuites/sptests/spfatal_support/init.c
+++ b/testsuites/sptests/spfatal_support/init.c
@@ -34,13 +34,6 @@ rtems_task Init(
rtems_test_exit(0);
}
-char *Sources[] = {
- "INTERNAL_ERROR_CORE",
- "INTERNAL_ERROR_RTEMS_API",
- "INTERNAL_ERROR_POSIX_API",
-};
-
-
char *Errors_Rtems[] = {
"RTEMS_SUCCESSFUL", /* successful completion */
"RTEMS_TASK_EXITTED", /* returned from a task */
@@ -82,12 +75,9 @@ void Put_Error( uint32_t source, uint32_t error )
}
}
-void Put_Source( uint32_t source )
+void Put_Source( rtems_fatal_source source )
{
- if ( source > INTERNAL_ERROR_POSIX_API )
- printk("Unknown Source (%d)", source);
- else
- printk( Sources[ source ] );
+ printk( "%s", rtems_fatal_source_description( source ) );
}
diff --git a/testsuites/sptests/spfatal_support/system.h b/testsuites/sptests/spfatal_support/system.h
index 2be1459..4126c65 100644
--- a/testsuites/sptests/spfatal_support/system.h
+++ b/testsuites/sptests/spfatal_support/system.h
@@ -35,9 +35,7 @@ void Put_Error(
uint32_t error
);
-void Put_Source(
- uint32_t source
-);
+void Put_Source( rtems_fatal_source source );
void force_error(void);
More information about the vc
mailing list