From: Dmitry V. Levin Date: Tue, 5 Jan 2016 23:14:25 +0000 (+0000) Subject: tests/restart_syscall.c: use libtests X-Git-Tag: v4.12~729 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fa63468f55f0836b3523067ec419b276ef3a8b9f;p=strace tests/restart_syscall.c: use libtests * tests/restart_syscall.c (main): Use assert, perror_msg_and_fail, and perror_msg_and_skip. --- diff --git a/tests/restart_syscall.c b/tests/restart_syscall.c index 860f1688..3f07d783 100644 --- a/tests/restart_syscall.c +++ b/tests/restart_syscall.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2016 Dmitry V. Levin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,6 +26,7 @@ */ #include "tests.h" +#include #include #include #include @@ -40,21 +41,19 @@ main(void) * x32 is broken from the beginning: * https://lkml.org/lkml/2015/11/30/790 */ - return 77; + error_msg_and_skip("x32 is broken"); #else const sigset_t set = {}; const struct sigaction act = { .sa_handler = SIG_IGN }; const struct itimerval itv = { .it_value.tv_usec = 111111 }; struct timespec req = { .tv_nsec = 222222222 }, rem; - if (sigaction(SIGALRM, &act, NULL)) - return 77; - if (sigprocmask(SIG_SETMASK, &set, NULL)) - return 77; + assert(sigaction(SIGALRM, &act, NULL) == 0); + assert(sigprocmask(SIG_SETMASK, &set, NULL) == 0); if (setitimer(ITIMER_REAL, &itv, NULL)) - return 77; + perror_msg_and_skip("setitimer"); if (nanosleep(&req, &rem)) - return 0; + perror_msg_and_fail("nanosleep"); printf("nanosleep\\(\\{%jd, %jd\\}, \\{%jd, %jd\\}\\)" " = \\? ERESTART_RESTARTBLOCK \\(Interrupted by signal\\)\n",