Browse Source

Improved safety and removed busy waiting from the CTestTestTimeout test.

Zach Mullen 16 years ago
parent
commit
cc8c4a3f4f
1 changed files with 11 additions and 6 deletions
  1. 11 6
      Tests/CTestTestTimeout/timeout.c

+ 11 - 6
Tests/CTestTestTimeout/timeout.c

@@ -1,10 +1,15 @@
-#include <stdio.h>
+#if defined(_WIN32)
+# include <windows.h>
+#else
+# include <unistd.h>
+#endif
 
-/* infinite loop */
 int main(void)
 {
-  while(1)
-    {
-    }
-  return 0;
+#if defined(_WIN32)
+  Sleep(5000);
+#else
+  sleep(5);
+#endif
+  return -1;
 }