+ /* Could be other than SIG_DFL if you changed the implementation. */
+ TESTCASE( signal( SIGABRT, SIG_IGN ) == SIG_DFL );
+ /* Should be ignored. */
+ TESTCASE( raise( SIGABRT ) == 0 );
+ /* Installing test handler, old handler should be returned */
+ TESTCASE( signal( SIGABRT, test_handler ) == SIG_IGN );
+ /* Raising and checking SIGABRT */
+ expected_signal = SIGABRT;
+ TESTCASE( raise( SIGABRT ) == 0 );
+ TESTCASE( flag == 1 );
+ /* Re-installing test handler, should have been reset to default */
+ /* Could be other than SIG_DFL if you changed the implementation. */
+ TESTCASE( signal( SIGABRT, test_handler ) == SIG_DFL );
+ /* Raising and checking SIGABRT */
+ flag = 0;
+ TESTCASE( raise( SIGABRT ) == 0 );
+ TESTCASE( flag == 1 );
+ /* Installing test handler for different signal... */
+ TESTCASE( signal( SIGTERM, test_handler ) == SIG_DFL );
+ /* Raising and checking SIGTERM */
+ expected_signal = SIGTERM;
+ TESTCASE( raise( SIGTERM ) == 0 );
+ TESTCASE( flag == 1 );