From: Dmitry V. Levin Date: Wed, 6 Jan 2016 15:57:45 +0000 (+0000) Subject: tests/uid16.c: use libtests X-Git-Tag: v4.12~682 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=67c998b7d40051318b61614e7681e8ef711df51b;p=strace tests/uid16.c: use libtests * tests/uid16.c: Use SKIP_MAIN_UNDEFINED. (main): Use perror_msg_and_skip. --- diff --git a/tests/uid16.c b/tests/uid16.c index 45d20fb8..04bf8a31 100644 --- a/tests/uid16.c +++ b/tests/uid16.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 @@ -26,15 +26,8 @@ */ #include "tests.h" -#include -#include -#include -#include #include -int -main(void) -{ #if defined(__NR_getuid) \ && defined(__NR_setuid) \ && defined(__NR_getresuid) \ @@ -59,6 +52,15 @@ main(void) && __NR_fchown != __NR_fchown32 \ && __NR_getgroups != __NR_getgroups32 \ /**/ + +# include +# include +# include +# include + +int +main(void) +{ int uid; int size; int *list = 0; @@ -74,7 +76,7 @@ main(void) buf[n] = '\0'; n = atoi(buf); if (uid == n) - return 77; + error_msg_and_skip("getuid() == overflowuid"); } close(0); } @@ -95,7 +97,15 @@ main(void) assert(list = calloc(size + 1, sizeof(*list))); assert(syscall(__NR_getgroups, size, list) == size); return 0; +} + #else - return 77; + +SKIP_MAIN_UNDEFINED("__NR_getuid && __NR_setuid && __NR_getresuid" + " && __NR_setreuid && __NR_setresuid" + " && __NR_fchown && __NR_getgroups" + " && __NR_getuid32 && __NR_setuid32 && __NR_getresuid32" + " && __NR_setreuid32 && __NR_setresuid32" + " && __NR_fchown32 && __NR_getgroups32") + #endif -}