]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Changed test so the output doesn't depend on the order in which the parent and
authorNicholas Nethercote <njn@valgrind.org>
Fri, 27 Sep 2002 10:38:20 +0000 (10:38 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Fri, 27 Sep 2002 10:38:20 +0000 (10:38 +0000)
child run;  this was random so the test was failing spuriously sometimes.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1123

none/tests/fork.c
none/tests/fork.stdout.exp

index 2a987d2b84d23b221bf63c50dfbf7da5c0394357..8995beb5655d1cd4e34de0885d203b09c0fe1719 100644 (file)
@@ -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;
 }
index d3f09d4206fe53494bd069afb9e7e3fe1a457a93..391250caa0ad639a4ff3420607b7cef8241a15ae 100644 (file)
@@ -1,2 +1 @@
-my pid is non-zero
-my pid is zero
+XXX
\ No newline at end of file