[rtems-central commit] spec: Improve branch coverage

Sebastian Huber sebh at rtems.org
Tue Aug 10 08:12:03 UTC 2021


Module:    rtems-central
Branch:    master
Commit:    f57e1ee279f35c27f56a1eb0fe99e45e6f890770
Changeset: http://git.rtems.org/rtems-central/commit/?id=f57e1ee279f35c27f56a1eb0fe99e45e6f890770

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Aug 10 10:12:01 2021 +0200

spec: Improve branch coverage

---

 spec/bsp/sparc/leon3/val/fatal-shutdown-response.yml       |  4 ++--
 .../testsuites/fatal-bsp-sparc-leon3-shutdown-response.yml | 14 +++++++++++++-
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/spec/bsp/sparc/leon3/val/fatal-shutdown-response.yml b/spec/bsp/sparc/leon3/val/fatal-shutdown-response.yml
index e378cab..11d9e75 100644
--- a/spec/bsp/sparc/leon3/val/fatal-shutdown-response.yml
+++ b/spec/bsp/sparc/leon3/val/fatal-shutdown-response.yml
@@ -21,7 +21,7 @@ test-actions:
   - brief: |
       Check that the expected fatal source is present.
     code: |
-      T_step_eq_int( ${step}, ctx->source, RTEMS_FATAL_SOURCE_SMP );
+      T_step_eq_int( ${step}, ctx->source, RTEMS_FATAL_SOURCE_APPLICATION );
     links: []
   - brief: |
       Check that the expected fatal code is present.
@@ -78,7 +78,7 @@ test-stop: null
 test-support: |
   static void TriggerTestCase( void )
   {
-    rtems_fatal( RTEMS_FATAL_SOURCE_SMP, 123456 );
+    rtems_fatal( RTEMS_FATAL_SOURCE_APPLICATION, 123456 );
   }
 
   RTEMS_SYSINIT_ITEM(
diff --git a/spec/testsuites/fatal-bsp-sparc-leon3-shutdown-response.yml b/spec/testsuites/fatal-bsp-sparc-leon3-shutdown-response.yml
index c8794a0..fd05490 100644
--- a/spec/testsuites/fatal-bsp-sparc-leon3-shutdown-response.yml
+++ b/spec/testsuites/fatal-bsp-sparc-leon3-shutdown-response.yml
@@ -16,13 +16,25 @@ test-code: |
 
   #define FATAL_SYSINIT_RUN BspSparcLeon3ValFatalShutdownResponse_Run
 
+  static void FatalSysinitExit( rtems_fatal_code exit_code )
+  {
+    if ( exit_code == 0 ) {
+      rtems_fatal( RTEMS_FATAL_SOURCE_SMP, SMP_FATAL_SHUTDOWN );
+    } else {
+      rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, exit_code );
+    }
+  }
+
+  #define FATAL_SYSINIT_EXIT( exit_code ) FatalSysinitExit( exit_code )
+
   #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
 
   #define CONFIGURE_MAXIMUM_PROCESSORS 2
 
   #include "ts-fatal-sysinit.h"
 test-description: null
-test-includes: []
+test-includes:
+- rtems/score/smpimpl.h
 test-local-includes:
 - tr-fatal-bsp-sparc-leon3-shutdown-response.h
 test-suite-name: FatalBspSparcLeon3ShutdownResponse



More information about the vc mailing list