From: Dmitry V. Levin Date: Tue, 5 Jan 2016 23:18:25 +0000 (+0000) Subject: tests/xattr.c: use libtests X-Git-Tag: v4.12~727 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c2c840d40e5e589f9bac25c7e6d073b22fa63b14;p=strace tests/xattr.c: use libtests * tests/xattr.c: Use SKIP_MAIN_UNDEFINED. (main): Use perror_msg_and_skip. --- diff --git a/tests/xattr.c b/tests/xattr.c index dd940d7a..7ae13c0d 100644 --- a/tests/xattr.c +++ b/tests/xattr.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,7 +26,9 @@ */ #include "tests.h" + #ifdef HAVE_SYS_XATTR_H + # include int @@ -34,18 +36,15 @@ main(void) { #define NAME "strace.test" #define VALUE "foo\0bar" - if (!removexattr(".", NAME) || - !setxattr(".", NAME, VALUE, sizeof(VALUE), XATTR_CREATE)) - return 77; + if (!removexattr(".", NAME)) + error_msg_and_skip("removexattr: error expected"); + if (!setxattr(".", NAME, VALUE, sizeof(VALUE), XATTR_CREATE)) + error_msg_and_skip("setxattr: error expected"); return 0; } #else -int -main(void) -{ - return 77; -} +SKIP_MAIN_UNDEFINED("HAVE_SYS_XATTR_H") #endif