]> granicus.if.org Git - strace/commitdiff
tests/caps.c: use libtests
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 4 Jan 2016 23:51:11 +0000 (23:51 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 6 Jan 2016 00:14:36 +0000 (00:14 +0000)
* tests/caps.c (main): Use perror_msg_and_skip.

tests/caps.c

index c00e3d4f327fcb1a3e4c9b6d915a1219cecb6337..2aca86258a1170576d75fc3723fef60e943210d4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * Copyright (c) 2014-2016 Dmitry V. Levin <ldv@altlinux.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -25,6 +25,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "tests.h"
 #include <errno.h>
 
 extern int capget(int *, int *);
@@ -38,9 +39,12 @@ main(void)
        const int v3 = 0x20080522;
        int head[] = { v3, 0 };
 
-       if (capget(head, unused) || head[0] != v3 ||
-           capset(head, data) == 0 || errno != EPERM)
-               return 77;
+       if (capget(head, unused))
+               perror_msg_and_skip("capget");
+       if (head[0] != v3)
+               error_msg_and_skip("capget: v3 expected");
+       if (capset(head, data) == 0 || errno != EPERM)
+               perror_msg_and_skip("capset");
 
        return 0;
 }