diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/Jamfile b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/Jamfile index 45fd0b08c7..b6709bb51d 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/Jamfile +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/Jamfile @@ -12,4 +12,5 @@ SubInclude HAIKU_TOP src tests system libroot posix posixtestsuite conformance i SubInclude HAIKU_TOP src tests system libroot posix posixtestsuite conformance interfaces sigprocmask ; SubInclude HAIKU_TOP src tests system libroot posix posixtestsuite conformance interfaces sigrelse ; SubInclude HAIKU_TOP src tests system libroot posix posixtestsuite conformance interfaces signal ; +SubInclude HAIKU_TOP src tests system libroot posix posixtestsuite conformance interfaces sigset ; SubInclude HAIKU_TOP src tests system libroot posix posixtestsuite conformance interfaces sigsuspend ; diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/difftime/1-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/difftime/1-1.c index ab02c3f035..e0df3d034c 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/difftime/1-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/difftime/1-1.c @@ -33,7 +33,7 @@ int main() return PTS_FAIL; } - printf("Test PASSED\n"); + printf("difftime_1-1: Test PASSED\n"); return PTS_PASS; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/12-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/12-1.c index 3d69095921..efc8535aa6 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/12-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/12-1.c @@ -277,7 +277,7 @@ int main( int argc, char * argv[] ) /* Test passed */ #if VERBOSE > 0 - output( "Test passed\n" ); + output( "fork_12-1: Test PASSED\n" ); #endif diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/3-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/3-1.c index 42432d5377..3d40def326 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/3-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/3-1.c @@ -125,7 +125,7 @@ int main(int argc, char * argv[]) /* Test passed */ #if VERBOSE > 0 - output("Test passed\n"); + output("fork_3-1: Test PASSED\n"); #endif PASSED; diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/4-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/4-1.c index 3ca11de544..88de608b39 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/4-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/4-1.c @@ -118,7 +118,7 @@ int main(int argc, char * argv[]) /* Test passed */ #if VERBOSE > 0 - output("Test passed\n"); + output("fork_4-1: Test PASSED\n"); #endif PASSED; diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/6-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/6-1.c index 84a2484095..38cfc3ef57 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/6-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/6-1.c @@ -189,7 +189,7 @@ int main( int argc, char * argv[] ) /* Test passed */ #if VERBOSE > 0 - output( "Test passed\n" ); + output( "fork_6-1: Test PASSED\n" ); #endif diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/8-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/8-1.c index c8821b8213..9042d04c5b 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/8-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/8-1.c @@ -226,7 +226,7 @@ int main( int argc, char * argv[] ) /* Test passed */ #if VERBOSE > 0 - output( "Test passed\n" ); + output( "fork_8-1: Test PASSED\n" ); #endif diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/9-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/9-1.c index 477708bef2..27948891c5 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/9-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/9-1.c @@ -143,7 +143,7 @@ int main( int argc, char * argv[] ) /* Test passed */ #if VERBOSE > 0 - output( "Test passed\n" ); + output( "fork_9-1: Test PASSED\n" ); #endif diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/kill/2-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/kill/2-1.c index ba248069b4..9431bdd2ae 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/kill/2-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/kill/2-1.c @@ -24,7 +24,7 @@ int main() return PTS_FAIL; } - printf("Test PASSED\n"); + printf("kill_2-1: Test PASSED\n"); return PTS_PASS; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sighold/1-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sighold/1-1.c index fffaac6a01..4eb0928c23 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sighold/1-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sighold/1-1.c @@ -58,7 +58,7 @@ int main() return PTS_FAIL; } - printf("sighold(): Test PASSED: signal was blocked\n"); + printf("sighold_1-1: Test PASSED: signal was blocked\n"); return PTS_PASS; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sighold/2-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sighold/2-1.c index e1dd6cd4a8..50ae4076c7 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sighold/2-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sighold/2-1.c @@ -22,6 +22,6 @@ int main() perror("sighold failed -- returned -- test aborted"); return PTS_UNRESOLVED; } - printf("sighold passed\n"); + printf("sighold_2-1: Test PASSED\n"); return PTS_PASS; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sighold/3-core-buildonly.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sighold/3-core-buildonly.c index 6235fa7ec0..9155f4427e 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sighold/3-core-buildonly.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sighold/3-core-buildonly.c @@ -74,8 +74,8 @@ int main(int argc, char *argv[]) if (TEST_RETURN == -1) { if (EINVAL == errno) { - printf ("errno set to EINVAL\n"); - printf("sighold(): Test passed\n"); + printf ("sighold_3-core-buildonly %s: successfully set errno to EINVAL\n", argv[1]); + printf("sighold_3-core-buildonly %s: Test PASSED\n", argv[1]); return PTS_PASS; } else { printf ("errno not set to EINVAL\n"); diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/1-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/1-1.c index 397e5b4a57..47caf01bab 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/1-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/1-1.c @@ -51,7 +51,7 @@ int main() printf("FAIL: Signal was not ignored\n"); return PTS_FAIL; } - printf("PASS\n"); + printf("sigignore_1-1: Test PASSED\n"); return PTS_PASS; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/4-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/4-1.c index ddc669ffa7..8dcffe551a 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/4-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/4-1.c @@ -22,6 +22,6 @@ int main() perror("sigignore failed -- returned -- test aborted"); return PTS_UNRESOLVED; } - printf("sigignore passed\n"); + printf("sigignore_4-1: Test PASSED\n"); return PTS_PASS; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/5-core-buildonly.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/5-core-buildonly.c index b765027759..4166e02404 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/5-core-buildonly.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/5-core-buildonly.c @@ -53,7 +53,8 @@ int main(int argc, char *argv[]) if (sigignore(signo) == -1) { if (EINVAL == errno) { - printf ("errno set to EINVAL\n"); + printf ("sigignore_5-core-buildonly %s: successfully set errno to EINVAL\n", argv[1]); + printf("sigignore_5-core-buildonly %s: Test PASSED\n", argv[1]); return PTS_PASS; } else { printf ("errno not set to EINVAL\n"); diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/6-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/6-1.c index fed6c56178..c7c901fade 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/6-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/6-1.c @@ -23,7 +23,8 @@ int main() { if (sigignore(SIGKILL) == -1) { if (EINVAL == errno) { - printf ("errno set to EINVAL\n"); + printf ("sigignore_6-1: successfully set errno to EINVAL\n"); + printf("sigignore_6-1: Test PASSED\n"); return PTS_PASS; } else { printf ("errno not set to EINVAL\n"); diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/6-2.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/6-2.c index 966ca04568..ee26b99700 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/6-2.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/6-2.c @@ -23,7 +23,8 @@ int main() { if (sigignore(SIGSTOP) == -1) { if (EINVAL == errno) { - printf ("errno set to EINVAL\n"); + printf ("sigignore_6-2: successfully set errno to EINVAL\n"); + printf("sigignore_6-2: Test PASSED\n"); return PTS_PASS; } else { printf ("errno not set to EINVAL\n"); diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/1-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/1-1.c index b240d65f5c..4feb706b2c 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/1-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/1-1.c @@ -26,7 +26,7 @@ int handler_called = 0; void myhandler(int signo) { - printf("SIGCHLD called. Inside handler\n"); + printf("signal_1-1: SIGCHLD called. Inside handler\n"); handler_called = 1; } @@ -48,6 +48,6 @@ int main() printf("Test FAILED: handler was called even though default was expected\n"); return PTS_FAIL; } - printf("signal(): Test passed\n"); + printf("signal_1-1: Test PASSED\n"); return PTS_PASS; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/2-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/2-1.c index 6b40e472f8..2eefc96e0e 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/2-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/2-1.c @@ -25,7 +25,7 @@ int handler_called = 0; void myhandler(int signo) { - printf("SIGCHLD called. Inside handler\n"); + printf("signal_2-1: SIGCHLD called. Inside handler\n"); handler_called = 1; } @@ -47,6 +47,6 @@ int main() printf("Test FAILED: handler was called even though default was expected\n"); return PTS_FAIL; } - printf("signal(): Test passed\n"); + printf("signal_2-1: Test PASSED\n"); return PTS_PASS; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/3-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/3-1.c index 4fd4f34d0c..f1e00b42d1 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/3-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/3-1.c @@ -23,7 +23,7 @@ int handler_called = 0; void myhandler(int signo) { - printf("SIGCHLD called. Inside handler\n"); + printf("signal_3-1: SIGCHLD called. Inside handler\n"); handler_called = 1; } @@ -40,6 +40,6 @@ int main() printf("Test FAILED: handler was called even though default was expected\n"); return PTS_FAIL; } - printf("signal(): Test passed\n"); + printf("signal_3-1: Test PASSED\n"); return PTS_PASS; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/5-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/5-1.c index 6ee173daf8..fa4d6ef31a 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/5-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/5-1.c @@ -24,12 +24,12 @@ void SIGUSR1_handler(int signo) { - printf("do nothing useful\n"); + printf("signal_5-1: inside SIGUSR1_handler\n"); } void SIGUSR2_handler(int signo) { - printf("do nothing useful\n"); + printf("signal_5-1: inside SIGUSR2_handler\n"); } int main() @@ -48,6 +48,6 @@ int main() printf("signal did not return the last handler that was associated with SIGUSR1\n"); return PTS_FAIL; } - printf("signal(): Test passed\n"); + printf("signal_5-1: Test PASSED\n"); return PTS_PASS; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/6-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/6-1.c index d032e2be3f..7ec3d363e4 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/6-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/6-1.c @@ -19,7 +19,7 @@ void myhandler(int signo) { - printf("handler does nothing useful.\n"); + printf("signal_6-1: inside handler\n"); } int main() @@ -35,6 +35,6 @@ int main() printf("Test FAILED: errno wasn't set to EINVAL even though invalid signal number was passed to the signal() function\n"); return PTS_FAIL; } - printf("signal(): Test passed\n"); + printf("signal_6-1: Test PASSED\n"); return PTS_PASS; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/7-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/7-1.c index e213dacb32..b2cdb0037e 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/7-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/7-1.c @@ -19,7 +19,7 @@ void myhandler(int signo) { - printf("handler does nothing useful.\n"); + printf("signal_7-1: inside handler\n"); } int main() @@ -35,6 +35,6 @@ int main() printf("Test FAILED: errno wasn't set to EINVAL even though a non-catchable signal was passed to the signal() function\n"); return PTS_FAIL; } - printf("signal(): Test passed\n"); + printf("signal_7-1: Test PASSED\n"); return PTS_PASS; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigprocmask/12-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigprocmask/12-1.c index da5a96a8b6..24aea3733e 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigprocmask/12-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigprocmask/12-1.c @@ -81,6 +81,6 @@ int main() { return PTS_FAIL; } - printf("PASS: signal mask was not changed.\n"); + printf("sigprocmask_12-1: Test PASSED: signal mask was not changed.\n"); return PTS_PASS; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigprocmask/8-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigprocmask/8-1.c index 950554ccca..3d17118982 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigprocmask/8-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigprocmask/8-1.c @@ -58,6 +58,6 @@ int main() { if (is_changed(oactl, SIGABRT)) { return PTS_FAIL; } - printf("PASS: signal mask was not changed.\n"); + printf("sigprocmask_8-1: Test PASSED: signal mask was not changed.\n"); return PTS_PASS; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigprocmask/8-2.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigprocmask/8-2.c index 33824efebc..b9d9ebaabd 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigprocmask/8-2.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigprocmask/8-2.c @@ -59,6 +59,6 @@ int main() { if (is_changed(oactl, SIGABRT)) { return PTS_FAIL; } - printf("PASS: signal mask was not changed.\n"); + printf("sigprocmask_8-2: Test PASSED: signal mask was not changed.\n"); return PTS_PASS; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigprocmask/8-3.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigprocmask/8-3.c index b7b1071b0b..9d6d056a5f 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigprocmask/8-3.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigprocmask/8-3.c @@ -58,6 +58,6 @@ int main() { if (is_changed(oactl, SIGABRT)) { return PTS_FAIL; } - printf("PASS: signal mask was not changed.\n"); + printf("sigprocmask_8-3: Test PASSED: signal mask was not changed.\n"); return PTS_PASS; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigrelse/1-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigrelse/1-1.c index 0804c669a2..3c8f659c9d 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigrelse/1-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigrelse/1-1.c @@ -64,7 +64,7 @@ int main() sleep(1); if (handler_called) { - printf("sigrelse(): Test PASSED: SIGABRT successfully removed from signal mask\n"); + printf("sigrelse_1-1: Test PASSED: SIGABRT successfully removed from signal mask\n"); return PTS_PASS; } printf("FAIL\n"); diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigrelse/2-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigrelse/2-1.c index 633699b280..b9320f4257 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigrelse/2-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigrelse/2-1.c @@ -22,6 +22,6 @@ int main() perror("sigrelse failed -- returned -- test aborted"); return PTS_UNRESOLVED; } - printf("sigrelse(): Test PASSED\n"); + printf("sigrelse_2-1: Test PASSED\n"); return PTS_PASS; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigrelse/3-core-buildonly.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigrelse/3-core-buildonly.c index faf7a7288b..ae6d8ecba5 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigrelse/3-core-buildonly.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigrelse/3-core-buildonly.c @@ -75,8 +75,8 @@ int main(int argc, char *argv[]) if (TEST_RETURN == -1) { if (EINVAL == errno) { - printf ("errno set to EINVAL\n"); - printf("sigrelse(): Test PASSED\n"); + printf ("sigrelse_3-core-buildonly %s: successfully set errno to EINVAL\n", argv[1]); + printf("sigrelse_3-core-buildonly %s: Test PASSED\n", argv[1]); return PTS_PASS; } else { printf ("errno not set to EINVAL\n"); diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/1-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/1-1.c new file mode 100644 index 0000000000..fda6fbc94f --- /dev/null +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/1-1.c @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2003, Intel Corporation. All rights reserved. + * Created by: salwan.searty REMOVE-THIS AT intel DOT com + * This file is licensed under the GPL license. For the full content + * of this license, see the COPYING file at the top level of this + * source tree. + + This program tests the assertion that the default handling of the + signal shall occur if the value of the disp parameter is SIG_DFL. + + How this program tests this assertion by setting up a handler + "myhandler" for SIGCHLD. Then another call to sigset() is made about + SIGCHLD, this time with SIG_DFL as the value of the func parameter. + The default action for SIGCHLD is to be ignored, so unless myhandler + gets called when SIGCHLD is raised, the test passess, otherwise + returns failure. + +*/ + +#define _XOPEN_SOURCE 600 + +#include +#include +#include +#include "posixtest.h" + +int handler_called = 0; + +void myhandler(int signo) +{ + printf("sigset_1-1: SIGCHLD called. Inside handler\n"); + handler_called = 1; +} + +int main() +{ + + struct sigaction act; + act.sa_handler = myhandler; + act.sa_flags = 0; + sigemptyset(&act.sa_mask); + + if (sigaction(SIGCHLD, &act, 0) != 0) { + perror("Unexpected error while using sigaction()"); + return PTS_UNRESOLVED; + } + + if (sigset(SIGCHLD,SIG_DFL) != myhandler) { + perror("Unexpected error while using signal()"); + return PTS_UNRESOLVED; + } + + raise(SIGCHLD); + + if (handler_called == 1) { + printf("Test FAILED: handler was called even though default was expected\n"); + return PTS_FAIL; + } + printf("sigset_1-1: Test PASSED\n"); + return PTS_PASS; +} diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/10-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/10-1.c new file mode 100644 index 0000000000..2a78b4ca47 --- /dev/null +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/10-1.c @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2003, Intel Corporation. All rights reserved. + * Created by: salwan.searty REMOVE-THIS AT intel DOT com + * This file is licensed under the GPL license. For the full content + * of this license, see the COPYING file at the top level of this + * source tree. + + This program tests the assertion that when unsuccessful, SIG_ERROR + shall be returned, and errno set to EINVAL. + +*/ + +#define _XOPEN_SOURCE 600 + +#include +#include +#include +#include +#include "posixtest.h" + +int main() +{ + if (sigset(SIGKILL,SIG_IGN) == SIG_ERR) { + if (errno != EINVAL) { + printf("Test FAILED: sigset() returned SIG_ERR but didn't set errno to EINVAL\n"); + return PTS_FAIL; + } + } else { + printf("Test FAILED: sigset() didn't return SIG_ERROR even though SIGKILL was passed to it\n"); + return PTS_FAIL; + } + printf("sigset_10-1: Test PASSED\n"); + return PTS_PASS; +} diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/2-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/2-1.c new file mode 100644 index 0000000000..5b803f000d --- /dev/null +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/2-1.c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2003, Intel Corporation. All rights reserved. + * Created by: salwan.searty REMOVE-THIS AT intel DOT com + * This file is licensed under the GPL license. For the full content + * of this license, see the COPYING file at the top level of this + * source tree. + + This program tests the assertion that the signal shall be ignored + if the value of the dist parameter is SIG_IGN. + + How this program tests this assertion is by setting up a handler + "myhandler" for SIGUSR1. Then another call to signal() is made about + SIGUSR1, this time with SIG_IGN as the value of the func parameter. + SIGUSR1 should be ignored now, so unless myhandler gets called when + SIGUSR1 is raised, the test passes, otherwise returns failure. + +*/ + +#define _XOPEN_SOURCE 600 + +#include +#include +#include +#include "posixtest.h" + +int handler_called = 0; + +void myhandler(int signo) +{ + printf("sigset_2-1: SIGUSR1 called. Inside handler\n"); + handler_called = 1; +} + +int main() +{ + struct sigaction act; + act.sa_flags = 0; + act.sa_handler = myhandler; + sigemptyset(&act.sa_mask); + + if (sigaction(SIGUSR1, &act, 0) != 0) { + perror("Unexpected error while using sigaction()"); + return PTS_UNRESOLVED; + } + + if (sigset(SIGUSR1,SIG_IGN) != myhandler) { + perror("Unexpected error while using signal()"); + return PTS_UNRESOLVED; + } + + raise(SIGUSR1); + + if (handler_called == 1) { + printf("Test FAILED: handler was called even though default was expected\n"); + return PTS_FAIL; + } + printf("sigset_2-1: Test PASSED\n"); + return PTS_PASS; +} diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/3-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/3-1.c new file mode 100644 index 0000000000..b4811caa83 --- /dev/null +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/3-1.c @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2003, Intel Corporation. All rights reserved. + * Created by: salwan.searty REMOVE-THIS AT intel DOT com + * This file is licensed under the GPL license. For the full content + * of this license, see the COPYING file at the top level of this + * source tree. + + This program tests the assertion that the function shall be executed + when the signal occurs if the disp parameter is the address of a function. + + How this program tests this assertion is by setting up a handler + "myhandler" for SIGCHLD, and then raising that signal. If the + handler_called variable is anything but 1, then fail, otherwise pass. + +*/ + +#define _XOPEN_SOURCE 600 + +#include +#include +#include +#include "posixtest.h" + +int handler_called = 0; + +void myhandler(int signo) +{ + printf("sigset_3-1: SIGCHLD called. Inside handler\n"); + handler_called = 1; +} + +int main() +{ + if (sigset(SIGCHLD, myhandler) == SIG_ERR) { + perror("Unexpected error while using sigset()"); + return PTS_UNRESOLVED; + } + + raise(SIGCHLD); + + if (handler_called != 1) { + printf("Test FAILED: handler was called even though default was expected\n"); + return PTS_FAIL; + } + printf("sigset_3-1: Test PASSED\n"); + return PTS_PASS; +} diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/4-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/4-1.c new file mode 100644 index 0000000000..877c6118c6 --- /dev/null +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/4-1.c @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2003, Intel Corporation. All rights reserved. + * Created by: salwan.searty REMOVE-THIS AT intel DOT com + * This file is licensed under the GPL license. For the full content + * of this license, see the COPYING file at the top level of this + * source tree. + + This program tests the assertion that the signal will be added to the + signal mask before its handler is executed. + +*/ + +#define _XOPEN_SOURCE 600 + +#include +#include +#include +#include "posixtest.h" + +int signal_blocked = 0; + +void myhandler(int signo) +{ + sigset_t mask; + printf("sigset_4-1: SIGCHLD called. Inside handler\n"); + sigprocmask(SIG_SETMASK, NULL, &mask); + if(sigismember(&mask, SIGCHLD)) { + signal_blocked = 1; + } +} + +int main() +{ + if (sigset(SIGCHLD, myhandler) == SIG_ERR) { + perror("Unexpected error while using sigset()"); + return PTS_UNRESOLVED; + } + + raise(SIGCHLD); + + if (signal_blocked != 1) { + printf("Test FAILED: handler was called even though default was expected\n"); + return PTS_FAIL; + } + printf("sigset_4-1: Test PASSED\n"); + return PTS_PASS; +} diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/5-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/5-1.c new file mode 100644 index 0000000000..383e71efd9 --- /dev/null +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/5-1.c @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2003, Intel Corporation. All rights reserved. + * Created by: salwan.searty REMOVE-THIS AT intel DOT com + * This file is licensed under the GPL license. For the full content + * of this license, see the COPYING file at the top level of this + * source tree. + + This program tests the assertion that the process's signal mask will be + restored to the state that it was in prior to the delivery of the signal + + Steps: + 1. Empty the signal mask + 2. Deliver the signal + 3. When we return from the signal handler, verify that the signal mask + is still empty, otherwise fail. + +*/ + +#define _XOPEN_SOURCE 600 + +#include +#include +#include +#include "posixtest.h" + +#define NUMSIGNALS 26 + +int is_empty(sigset_t *set) { + + int i; + int siglist[] = {SIGABRT, SIGALRM, SIGBUS, SIGCHLD, + SIGCONT, SIGFPE, SIGHUP, SIGILL, SIGINT, + SIGPIPE, SIGQUIT, SIGSEGV, + SIGTERM, SIGTSTP, SIGTTIN, SIGTTOU, + SIGUSR1, SIGUSR2, SIGPOLL, SIGPROF, SIGSYS, + SIGTRAP, SIGURG, SIGVTALRM, SIGXCPU, SIGXFSZ }; + + for (i=0; i +#include +#include +#include "posixtest.h" + + +void myhandler(int signo) +{ + printf("sigset_6-1: SIGCHLD called. Inside handler\n"); +} + +int main() +{ + sigset_t pendingset; + struct sigaction act; + act.sa_handler = myhandler; + act.sa_flags = 0; + sigemptyset(&act.sa_mask); + + if (sigaction(SIGCHLD, &act, 0) != 0) { + perror("Unexpected error while using sigaction()"); + return PTS_UNRESOLVED; + } + + if (sigset(SIGCHLD,SIG_HOLD) == SIG_ERR) { + perror("Unexpected error while using sigset()"); + return PTS_UNRESOLVED; + } + + raise(SIGCHLD); + + if (sigpending(&pendingset) == -1) { + printf("Error calling sigpending()\n"); + return PTS_UNRESOLVED; + } + + if (sigismember(&pendingset, SIGCHLD) != 1) { + printf("Test FAILED: Signal SIGCHLD was not successfully blocked\n"); + return PTS_FAIL; + } + printf("sigset_6-1: Test PASSED\n"); + return PTS_PASS; +} diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/7-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/7-1.c new file mode 100644 index 0000000000..7c288d161f --- /dev/null +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/7-1.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2003, Intel Corporation. All rights reserved. + * Created by: salwan.searty REMOVE-THIS AT intel DOT com + * This file is licensed under the GPL license. For the full content + * of this license, see the COPYING file at the top level of this + * source tree. + + This program tests the assertion that if disp is SIG_HOLD, then the + signal's disposition shall remain unchanged + + Steps: + 1. Register SIGCHLD with myhandler + 2. Add SIGCHLD to the process's signal mask using sigset with disp + equal to SIG_HOLD + 3. raise SIGCHLD + 4. remove SIGCHLD from the signal mask + 5. Verify that the original disposition hasn't been changed, by making + sure that SIGCHLD is still handled by myhandler. +*/ + +#define _XOPEN_SOURCE 600 + +#include +#include +#include +#include "posixtest.h" + +int handler_called = 0; + +void myhandler(int signo) +{ + printf("sigset_7-1: SIGCHLD called. Inside handler\n"); + handler_called = 1; +} + +int main() +{ + sigset_t pendingset; + struct sigaction act; + act.sa_handler = myhandler; + act.sa_flags = 0; + sigemptyset(&act.sa_mask); + + if (sigaction(SIGCHLD, &act, 0) != 0) { + perror("Unexpected error while using sigaction()"); + return PTS_UNRESOLVED; + } + + if (sigset(SIGCHLD,SIG_HOLD) == SIG_ERR) { + perror("Unexpected error while using sigset()"); + return PTS_UNRESOLVED; + } + + raise(SIGCHLD); + + if (sigpending(&pendingset) == -1) { + printf("Error calling sigpending()\n"); + return PTS_UNRESOLVED; + } + + if (sigismember(&pendingset, SIGCHLD) != 1) { + printf("Test UNRESOLVED: Signal SIGCHLD was not successfully blocked\n"); + return PTS_UNRESOLVED; + } + + sigrelse(SIGCHLD); + + if (handler_called != 1) { + printf("Test FAILED: Signal wasn't delivered even though it was removed from the signal mask\n"); + return PTS_FAIL; + } + printf("sigset_7-1: Test PASSED\n"); + return PTS_PASS; +} diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/8-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/8-1.c new file mode 100644 index 0000000000..466de8a0e2 --- /dev/null +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/8-1.c @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2003, Intel Corporation. All rights reserved. + * Created by: salwan.searty REMOVE-THIS AT intel DOT com + * This file is licensed under the GPL license. For the full content + * of this license, see the COPYING file at the top level of this + * source tree. + + This program tests the assertion that if signal has been blocked, then + sigset shall return SIG_HOLD + +*/ + +#define _XOPEN_SOURCE 600 + +#include +#include +#include +#include "posixtest.h" + +int main() +{ + + if (sigset(SIGCHLD,SIG_HOLD) != SIG_DFL) { + printf("Test FAILED: sigset() didn't return SIG_DFL\n"); + return PTS_FAIL; + } + printf("sigset_8-1: Test PASSED\n"); + return PTS_PASS; +} diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/9-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/9-1.c new file mode 100644 index 0000000000..5ffaca93ab --- /dev/null +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/9-1.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2003, Intel Corporation. All rights reserved. + * Created by: salwan.searty REMOVE-THIS AT intel DOT com + * This file is licensed under the GPL license. For the full content + * of this license, see the COPYING file at the top level of this + * source tree. + + This program tests the assertion that sigset shall return the signal's + previous disposition if signal had not been blocked. + +*/ + +#define _XOPEN_SOURCE 600 + +#include +#include +#include +#include "posixtest.h" + +void myhandler(int signo) +{ + printf("sigset_9-1: SIGUSR1 called. Inside handler\n"); +} + +int main() +{ + struct sigaction act; + act.sa_flags = 0; + act.sa_handler = myhandler; + sigemptyset(&act.sa_mask); + + if (sigaction(SIGUSR1, &act, 0) != 0) { + perror("Unexpected error while using sigaction()"); + return PTS_UNRESOLVED; + } + + if (sigset(SIGUSR1,SIG_DFL) != myhandler) { + printf("Test FAILED: sigset didn't return myhandler even though it was SIGUSR1's original disposition\n"); + return PTS_FAIL; + } + printf("sigset_9-1: Test PASSED\n"); + return PTS_PASS; +} diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/Jamfile b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/Jamfile new file mode 100644 index 0000000000..19ba602d90 --- /dev/null +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/Jamfile @@ -0,0 +1,14 @@ +SubDir HAIKU_TOP src tests system libroot posix posixtestsuite conformance interfaces sigset ; + +SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) $(DOTDOT) $(DOTDOT) include ] ; + +SimpleTest sigset_1-1 : 1-1.c ; +SimpleTest sigset_2-1 : 2-1.c ; +SimpleTest sigset_3-1 : 3-1.c ; +SimpleTest sigset_4-1 : 4-1.c ; +SimpleTest sigset_5-1 : 5-1.c ; +SimpleTest sigset_6-1 : 6-1.c ; +SimpleTest sigset_7-1 : 7-1.c ; +SimpleTest sigset_8-1 : 8-1.c ; +SimpleTest sigset_9-1 : 9-1.c ; +SimpleTest sigset_10-1 : 10-1.c ; diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigsuspend/6-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigsuspend/6-1.c index f3dc4b605b..d04f07d8f6 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigsuspend/6-1.c +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigsuspend/6-1.c @@ -27,7 +27,7 @@ void handler(int signo) { - printf("Now inside signal handler\n"); + printf("sigsuspend_6-1: Now inside signal handler\n"); } int main() @@ -89,7 +89,7 @@ int main() } if (exit_status == 2) { - printf("Test PASSED\n"); + printf("sigsuspend_6-1: Test PASSED\n"); return PTS_PASS; } diff --git a/src/tests/system/libroot/posix/posixtestsuite/run_posix_tests.sh b/src/tests/system/libroot/posix/posixtestsuite/run_posix_tests.sh index 4de5361cf3..ecf971f220 100644 --- a/src/tests/system/libroot/posix/posixtestsuite/run_posix_tests.sh +++ b/src/tests/system/libroot/posix/posixtestsuite/run_posix_tests.sh @@ -91,6 +91,18 @@ signals_tests() conformance/interfaces/signal/signal_6-1 conformance/interfaces/signal/signal_7-1 echo "" + echo "sigset()" + conformance/interfaces/sigset/sigset_1-1 + conformance/interfaces/sigset/sigset_2-1 + conformance/interfaces/sigset/sigset_3-1 + conformance/interfaces/sigset/sigset_4-1 + conformance/interfaces/sigset/sigset_5-1 + conformance/interfaces/sigset/sigset_6-1 + conformance/interfaces/sigset/sigset_7-1 + conformance/interfaces/sigset/sigset_8-1 + conformance/interfaces/sigset/sigset_9-1 + conformance/interfaces/sigset/sigset_10-1 + echo "" echo "sigsuspend()" echo "FIXME: haiku' sigsuspend can not 'wake up' yet." }