X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Ftest-sys_wait.c;h=dce89c6a8b1bbf61b496cc59167bac002c378cbc;hb=c4c53bb2f7c0a05e9795da46ea3ddc17b2ef0c78;hp=917de0dc692980da966592ca498412ee8c98a96d;hpb=91935a638321ad61c876153d149ee09fc701c2db;p=pspp diff --git a/tests/test-sys_wait.c b/tests/test-sys_wait.c index 917de0dc69..dce89c6a8b 100644 --- a/tests/test-sys_wait.c +++ b/tests/test-sys_wait.c @@ -1,5 +1,5 @@ /* Test of substitute. - Copyright (C) 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2009-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,29 +23,25 @@ /* Check for existence of required types. */ static pid_t a; +#include "test-sys_wait.h" + int main (void) { - /* Check for existence of required macros. Note that we document - that these are safe only on lvalues. */ - int i; - for (i = 0; i < 0x10000; i = (i ? i << 1 : 1)) - if (!!WIFSIGNALED (i) + !!WIFEXITED (i) + !!WIFSTOPPED (i) != 1) - return 1; - i = WEXITSTATUS (i) + WSTOPSIG (i) + WTERMSIG (i); - - switch (i) + if (test_sys_wait_macros ()) + return 1; + + switch (0) { #if 0 /* Gnulib doesn't guarantee these, yet. */ case WCONTINUED: - case WNOHANG: - case WUNTRACED: case WEXITED: case WNOWAIT: case WSTOPPED: #endif break; } - return a ? i : 0; + + return a ? 1 : 0; }