From 8c26e79867739e13a8699883ec1fa86127d94aaf Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 25 Mar 2014 16:45:08 +0100 Subject: tests: Produce proper begin/end messages --- testsuites/sptests/sperror01/init.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'testsuites/sptests/sperror01') diff --git a/testsuites/sptests/sperror01/init.c b/testsuites/sptests/sperror01/init.c index 1f3e3f97dc..4c40be5299 100644 --- a/testsuites/sptests/sperror01/init.c +++ b/testsuites/sptests/sperror01/init.c @@ -21,6 +21,21 @@ const char rtems_test_name[] = "SPERROR 1"; /* forward declarations to avoid warnings */ rtems_task Init(rtems_task_argument argument); +static void fatal_extension( + rtems_fatal_source source, + bool is_internal, + rtems_fatal_code error +) +{ + if ( + source == RTEMS_FATAL_SOURCE_EXIT + && !is_internal + && error == ENOMEM + ) { + rtems_test_endk(); + } +} + rtems_task Init( rtems_task_argument argument ) @@ -41,10 +56,9 @@ rtems_task Init( rtems_error( RTEMS_NO_MEMORY | RTEMS_ERROR_PANIC, "Dummy: Resources unavailable\n" - "*** END OF TEST Tests for error reporting routines - 01 ***\n" ); - - rtems_test_exit(0); + + rtems_test_assert(0); } /* configuration information */ @@ -53,7 +67,8 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_MAXIMUM_TASKS 1 -#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION +#define CONFIGURE_INITIAL_EXTENSIONS \ + { .fatal = fatal_extension }, RTEMS_TEST_INITIAL_EXTENSION #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -- cgit v1.2.3