[rtems commit] sptests/sp19: Fix test output methods

Sebastian Huber sebh at rtems.org
Thu Mar 8 07:49:28 UTC 2018


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Mar  8 08:48:28 2018 +0100

sptests/sp19: Fix test output methods

Do not use fprintf() in non-fp tasks.

---

 testsuites/sptests/sp19/init.c   | 10 +++++++++-
 testsuites/sptests/sp19/system.h |  6 +++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/testsuites/sptests/sp19/init.c b/testsuites/sptests/sp19/init.c
index ee499fa..ef52f98 100644
--- a/testsuites/sptests/sp19/init.c
+++ b/testsuites/sptests/sp19/init.c
@@ -28,13 +28,21 @@
 
 const char rtems_test_name[] = "SP 19";
 
+void thread_switch_extension( Thread_Control *executing, Thread_Control *heir )
+{
+  if ( heir->is_fp ) {
+    rtems_print_printer_fprintf_putc( &rtems_test_printer );
+  } else {
+    rtems_print_printer_printk( &rtems_test_printer );
+  }
+}
+
 rtems_task Init(
   rtems_task_argument argument
 )
 {
   rtems_status_code status;
 
-  rtems_print_printer_fprintf_putc(&rtems_test_printer);
   TEST_BEGIN();
 
   Task_name[ 1 ] =  rtems_build_name( 'T', 'A', '1', ' ' );
diff --git a/testsuites/sptests/sp19/system.h b/testsuites/sptests/sp19/system.h
index f6e39c3..59ae010 100644
--- a/testsuites/sptests/sp19/system.h
+++ b/testsuites/sptests/sp19/system.h
@@ -40,7 +40,11 @@ rtems_task Task_1(
 
 #define CONFIGURE_MAXIMUM_TASKS             7
 
-#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
+void thread_switch_extension( Thread_Control *, Thread_Control * );
+
+#define CONFIGURE_INITIAL_EXTENSIONS \
+  { .thread_switch = thread_switch_extension }, \
+  RTEMS_TEST_INITIAL_EXTENSION
 
 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
 




More information about the vc mailing list