diff --git a/tests/signals/sigset-10.c b/tests/signals/sigset-10.c index e6b8d478c8..9762881ce3 100644 --- a/tests/signals/sigset-10.c +++ b/tests/signals/sigset-10.c @@ -4,18 +4,23 @@ #include #include #include +#include "../test_helpers.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"); - exit(EXIT_FAILURE); - } - } else { - printf("Test FAILED: sigset() didn't return SIG_ERROR even though SIGKILL was passed to it\n"); - exit(EXIT_FAILURE); - } - printf("test passed: error was set successfully\n"); + void (*status) (int); + status = sigset(SIGKILL,SIG_IGN); + ERROR_IF(sigset, status, == SIG_ERR); + ERROR_IF(sigset, errno, != EINVAL); + // 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"); + // exit(EXIT_FAILURE); + // } + // } else { + // printf("Test FAILED: sigset() didn't return SIG_ERROR even though SIGKILL was passed to it\n"); + // exit(EXIT_FAILURE); + // } + // printf("test passed: error was set successfully\n"); return EXIT_SUCCESS; } \ No newline at end of file diff --git a/tests/signals/sigset-5.c b/tests/signals/sigset-5.c index 80ec9d6514..b0ad6763da 100644 --- a/tests/signals/sigset-5.c +++ b/tests/signals/sigset-5.c @@ -36,20 +36,25 @@ int sigset_test5(int signum) sigemptyset(&mask); sigprocmask(SIG_SETMASK, &mask, NULL); + void (*status) (int); - if (sigset(signum, sig_handler) == SIG_ERR) { - perror("Unexpected error while using sigset()"); - exit(EXIT_FAILURE); - } + status = sigset(signum, sig_handler); + ERROR_IF(sigset, status, == SIG_ERR); + // if (sigset(signum, sig_handler) == SIG_ERR) { + // perror("Unexpected error while using sigset()"); + // exit(EXIT_FAILURE); + // } raise(signum); sigprocmask(SIG_SETMASK, NULL, &mask); - - if (is_empty(&mask) != 1) { - printf("Test FAILED: signal mask should be empty\n"); - exit(EXIT_FAILURE); - } - printf("sig %d was successfully removed from the mask when handler returned\n", signum); + int status1; + status1 = is_empty(&mask); + ERROR_IF(is_empty, status1, != 1); + // if (is_empty(&mask) != 1) { + // printf("Test FAILED: signal mask should be empty\n"); + // exit(EXIT_FAILURE); + // } + // printf("sig %d was successfully removed from the mask when handler returned\n", signum); return EXIT_SUCCESS; }