[rtems commit] smpunsupported01: Add missing error check for rtems_task_mode

Joel Sherrill joel at rtems.org
Wed Dec 6 18:49:02 UTC 2017


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

Author:    Joel Sherrill <joel at rtems.org>
Date:      Tue Dec  5 09:56:47 2017 -0600

smpunsupported01: Add missing error check for rtems_task_mode

Update test documentation to include more cases.

Updates #3000.

---

 testsuites/smptests/smpunsupported01/init.c               | 10 +++++++++-
 testsuites/smptests/smpunsupported01/smpunsupported01.doc |  4 ++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/testsuites/smptests/smpunsupported01/init.c b/testsuites/smptests/smpunsupported01/init.c
index ef4ea9b..ae85b2f 100644
--- a/testsuites/smptests/smpunsupported01/init.c
+++ b/testsuites/smptests/smpunsupported01/init.c
@@ -42,9 +42,17 @@ static void test(void)
   );
   rtems_test_assert(sc == RTEMS_UNSATISFIED);
 
-  mode = RTEMS_INTERRUPT_LEVEL(1);
+  mode = RTEMS_INTERRUPT_LEVEL(0);
+  if (mode == 0) {
+    sc = rtems_task_mode(mode, RTEMS_INTERRUPT_MASK, &mode);
+    rtems_test_assert(sc == RTEMS_NOT_IMPLEMENTED);
+  }
 
+  mode = RTEMS_INTERRUPT_LEVEL(1);
   if (mode != 0) {
+    sc = rtems_task_mode(mode, RTEMS_INTERRUPT_MASK, &mode);
+    rtems_test_assert(sc == RTEMS_NOT_IMPLEMENTED);
+
     sc = rtems_task_create(
       rtems_build_name('T', 'A', 'S', 'K'),
       RTEMS_MINIMUM_PRIORITY,
diff --git a/testsuites/smptests/smpunsupported01/smpunsupported01.doc b/testsuites/smptests/smpunsupported01/smpunsupported01.doc
index 2fbd4fa..71a4fb6 100644
--- a/testsuites/smptests/smpunsupported01/smpunsupported01.doc
+++ b/testsuites/smptests/smpunsupported01/smpunsupported01.doc
@@ -16,3 +16,7 @@ concepts:
     on SMP configurations.
   - Ensure that rtems_task_create() with RTEMS_NO_PREEMPT returns an error
     status on SMP configurations.
+  - Ensure that rtems_task_mode() with RTEMS_INTERRUPT_MASK returns an
+    error status
+  - Ensure that rtems_task_create() with RTEMS_INTERRUPT_MASK returns an
+    error status



More information about the vc mailing list