From: Nicholas Nethercote Date: Fri, 27 Sep 2002 10:38:20 +0000 (+0000) Subject: Changed test so the output doesn't depend on the order in which the parent and X-Git-Tag: svn/VALGRIND_1_9_4~298 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0eb6b6654a673ff0089faaba180c0a792dfc4366;p=thirdparty%2Fvalgrind.git Changed test so the output doesn't depend on the order in which the parent and child run; this was random so the test was failing spuriously sometimes. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1123 --- diff --git a/none/tests/fork.c b/none/tests/fork.c index 2a987d2b84..8995beb565 100644 --- a/none/tests/fork.c +++ b/none/tests/fork.c @@ -9,7 +9,12 @@ int main(void) pid = fork (); - printf("my pid is %s\n", pid==0 ? "zero" : "non-zero"); + /* Sometimes child goes first (non-zero), sometimes parent (zero). This + printing means we can detect if we correctly get a zero result and a + non-zero result (--> three 'X's printed), but the output doesn't depend + on the order. */ + + printf("%s", pid==0 ? "X" : "XX"); return 0; } diff --git a/none/tests/fork.stdout.exp b/none/tests/fork.stdout.exp index d3f09d4206..391250caa0 100644 --- a/none/tests/fork.stdout.exp +++ b/none/tests/fork.stdout.exp @@ -1,2 +1 @@ -my pid is non-zero -my pid is zero +XXX \ No newline at end of file