[rtems commit] psxtests/psxualarm: Avoid output in signal handler

Sebastian Huber sebh at rtems.org
Wed May 18 09:11:42 UTC 2016


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed May 18 11:09:10 2016 +0200

psxtests/psxualarm: Avoid output in signal handler

Avoid output in signal handler to not disturb the timings which are
checked in this test.  Use asserts to ensure proper signal handler
invocations.

---

 testsuites/psxtests/psxualarm/init.c        | 11 +++--------
 testsuites/psxtests/psxualarm/psxualarm.scn | 10 ++++------
 2 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/testsuites/psxtests/psxualarm/init.c b/testsuites/psxtests/psxualarm/init.c
index 1ec6473..7a4fb21 100644
--- a/testsuites/psxtests/psxualarm/init.c
+++ b/testsuites/psxtests/psxualarm/init.c
@@ -20,19 +20,14 @@
 
 const char rtems_test_name[] = "PSXUALARM";
 
-volatile int Signal_count;
+static volatile int Signal_count;
 
 static void Signal_handler(
   int signo
 )
 {
-  Signal_count++;
-  printf(
-    "Signal: %d caught by 0x%" PRIxpthread_t " (%d)\n",
-    signo,
-    pthread_self(),
-    Signal_count
-  );
+  rtems_test_assert( signo == SIGALRM );
+  ++Signal_count;
 }
 
 void *POSIX_Init(
diff --git a/testsuites/psxtests/psxualarm/psxualarm.scn b/testsuites/psxtests/psxualarm/psxualarm.scn
index eca799a..83313b5 100644
--- a/testsuites/psxtests/psxualarm/psxualarm.scn
+++ b/testsuites/psxtests/psxualarm/psxualarm.scn
@@ -1,8 +1,6 @@
-*** POSIX TEST UALARM ***
+*** BEGIN OF TEST PSXUALARM ***
 Init's ID is 0x0b010001
-Init: ualarm in 1 us
+Init: ualarm in 500000 us
 Init: Unblock SIGALRM
-Signal: 14 caught by 0xb010001 (1)
-Signal: 14 caught by 0xb010001 (2)
-Init: clear ualarm with 0,0
-*** END OF POSIX TEST UALARM ***
+Init: clear ualarm with 0, 0
+*** END OF TEST PSXUALARM ***



More information about the vc mailing list