From: Dmitry V. Levin Date: Mon, 4 Jan 2016 23:51:11 +0000 (+0000) Subject: tests/caps.c: use libtests X-Git-Tag: v4.12~758 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e301e983428ba038d3c0291dcb4eef2dacbb1555;p=strace tests/caps.c: use libtests * tests/caps.c (main): Use perror_msg_and_skip. --- diff --git a/tests/caps.c b/tests/caps.c index c00e3d4f..2aca8625 100644 --- a/tests/caps.c +++ b/tests/caps.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015 Dmitry V. Levin + * Copyright (c) 2014-2016 Dmitry V. Levin * 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 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; }