From ae0f048ff3216ac36d880ce3b9651bd9a1db676c Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 18 May 2016 11:09:10 +0200 Subject: 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(-) (limited to 'testsuites/psxtests/psxualarm') diff --git a/testsuites/psxtests/psxualarm/init.c b/testsuites/psxtests/psxualarm/init.c index 1ec6473efa..7a4fb21b99 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 eca799a438..83313b589b 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 *** -- cgit v1.2.3