]> granicus.if.org Git - strace/commitdiff
tests/times-fail.c: use assert
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 4 Jan 2016 23:43:09 +0000 (23:43 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 4 Jan 2016 23:43:09 +0000 (23:43 +0000)
* tests/times-fail.c (main): Use assert.

tests/times-fail.c

index c1a3f7e0352b6dd7a401f603a863cdef31e0c911..5f5277ca55ef91a48d070f507dcc6daa72d30ad3 100644 (file)
@@ -1,4 +1,5 @@
 #include "tests.h"
+#include <assert.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <sys/syscall.h>
@@ -6,9 +7,8 @@
 int
 main (void)
 {
-       if (syscall(__NR_times, 0x42) != -1)
-               return 77;
-       puts("times(0x42) = -1 EFAULT (Bad address)");
+       assert(syscall(__NR_times, 0x42) == -1);
+       printf("times(0x42) = -1 EFAULT (%m)\n");
        puts("+++ exited with 0 +++");
 
        return 0;