]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
memcheck/tests/linux/timerfd-syscall: send output to stderr instead of stdout.
authorBart Van Assche <bvanassche@acm.org>
Sun, 19 Sep 2010 17:13:53 +0000 (17:13 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sun, 19 Sep 2010 17:13:53 +0000 (17:13 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11366

memcheck/tests/linux/timerfd-syscall.c
memcheck/tests/linux/timerfd-syscall.stderr.exp
memcheck/tests/linux/timerfd-syscall.stdout.exp [deleted file]

index 1e5ba53810374844a7459381c7bb1c6170cd19e1..71c7ddbbdf2e7e890836fc4c933b23efa1206cd9 100644 (file)
@@ -153,7 +153,7 @@ long waittmr(int tfd, int timeo)
   }
   if ((pfd.revents & POLLIN) == 0)
   {
-    fprintf(stdout, "no ticks happened\n");
+    fprintf(stderr, "no ticks happened\n");
     return -1;
   }
   if (read(tfd, &ticks, sizeof(ticks)) != sizeof(ticks))
@@ -182,11 +182,11 @@ int main(int ac, char **av)
 
   for (i = 0; i < sizeof(clks) / sizeof(clks[0]); i++)
   {
-    fprintf(stdout, "\n\n---------------------------------------\n");
-    fprintf(stdout, "| testing %s\n", clks[i].name);
-    fprintf(stdout, "---------------------------------------\n\n");
+    fprintf(stderr, "\n\n---------------------------------------\n");
+    fprintf(stderr, "| testing %s\n", clks[i].name);
+    fprintf(stderr, "---------------------------------------\n\n");
 
-    fprintf(stdout, "relative timer test (at 500 ms) ...\n");
+    fprintf(stderr, "relative timer test (at 500 ms) ...\n");
     set_timespec(&tmr.it_value, 500 * 1000);
     set_timespec(&tmr.it_interval, 0);
     tnow = getustime(clks[i].id);
@@ -202,17 +202,17 @@ int main(int ac, char **av)
       return 1;
     }
 
-    fprintf(stdout, "wating timer ...\n");
+    fprintf(stderr, "wating timer ...\n");
     ticks = waittmr(tfd, -1);
     ttmr = getustime(clks[i].id);
     if (ticks <= 0)
-      fprintf(stdout, "whooops! no timer showed up!\n");
+      fprintf(stderr, "whooops! no timer showed up!\n");
     else
-      fprintf(stdout, "got timer ticks (%ld) after %.1f s\n",
+      fprintf(stderr, "got timer ticks (%ld) after %.1f s\n",
               ticks, (ttmr - tnow) * 1e-6);
 
 
-    fprintf(stdout, "absolute timer test (at 500 ms) ...\n");
+    fprintf(stderr, "absolute timer test (at 500 ms) ...\n");
     tnow = getustime(clks[i].id);
     set_timespec(&tmr.it_value, tnow + 500 * 1000);
     set_timespec(&tmr.it_interval, 0);
@@ -222,16 +222,16 @@ int main(int ac, char **av)
       return 1;
     }
 
-    fprintf(stdout, "wating timer ...\n");
+    fprintf(stderr, "wating timer ...\n");
     ticks = waittmr(tfd, -1);
     ttmr = getustime(clks[i].id);
     if (ticks <= 0)
-      fprintf(stdout, "whooops! no timer showed up!\n");
+      fprintf(stderr, "whooops! no timer showed up!\n");
     else
-      fprintf(stdout, "got timer ticks (%ld) after %.1f s\n",
+      fprintf(stderr, "got timer ticks (%ld) after %.1f s\n",
               ticks, (ttmr - tnow) * 1e-6);
 
-    fprintf(stdout, "sequential timer test (100 ms clock) ...\n");
+    fprintf(stderr, "sequential timer test (100 ms clock) ...\n");
     tnow = getustime(clks[i].id);
     set_timespec(&tmr.it_value, tnow + 100 * 1000);
     set_timespec(&tmr.it_interval, 100 * 1000);
@@ -241,31 +241,31 @@ int main(int ac, char **av)
       return 1;
     }
 
-    fprintf(stdout, "sleeping one second ...\n");
+    fprintf(stderr, "sleeping one second ...\n");
     sleep(1);
     if (timerfd_gettime(tfd, &tmr))
     {
       perror("timerfd_gettime");
       return 1;
     }
-    fprintf(stdout, "timerfd_gettime returned:\n"
+    fprintf(stderr, "timerfd_gettime returned:\n"
             "\tit_value = %.1f it_interval = %.1f\n",
             tmr.it_value.tv_sec + 1e-9 * tmr.it_value.tv_nsec,
             tmr.it_interval.tv_sec + 1e-9 * tmr.it_interval.tv_nsec);
-    fprintf(stdout, "sleeping 1 second ...\n");
+    fprintf(stderr, "sleeping 1 second ...\n");
     sleep(1);
 
-    fprintf(stdout, "wating timer ...\n");
+    fprintf(stderr, "wating timer ...\n");
     ticks = waittmr(tfd, -1);
     ttmr = getustime(clks[i].id);
     if (ticks <= 0)
-      fprintf(stdout, "whooops! no timer showed up!\n");
+      fprintf(stderr, "whooops! no timer showed up!\n");
     else
-      fprintf(stdout, "got timer ticks (%ld) after %.1f s\n",
+      fprintf(stderr, "got timer ticks (%ld) after %.1f s\n",
               ticks, (ttmr - tnow) * 1e-6);
 
 
-    fprintf(stdout, "O_NONBLOCK test ...\n");
+    fprintf(stderr, "O_NONBLOCK test ...\n");
     tnow = getustime(clks[i].id);
     set_timespec(&tmr.it_value, 100 * 1000);
     set_timespec(&tmr.it_interval, 0);
@@ -275,27 +275,27 @@ int main(int ac, char **av)
       return 1;
     }
 #if 0
-    fprintf(stdout, "timerfd = %d\n", tfd);
+    fprintf(stderr, "timerfd = %d\n", tfd);
 #endif
 
-    fprintf(stdout, "wating timer (flush the single tick) ...\n");
+    fprintf(stderr, "wating timer (flush the single tick) ...\n");
     ticks = waittmr(tfd, -1);
     ttmr = getustime(clks[i].id);
     if (ticks <= 0)
-      fprintf(stdout, "whooops! no timer showed up!\n");
+      fprintf(stderr, "whooops! no timer showed up!\n");
     else
-      fprintf(stdout, "got timer ticks (%ld) after %.1f s\n",
+      fprintf(stderr, "got timer ticks (%ld) after %.1f s\n",
               ticks, (ttmr - tnow) * 1e-6);
 
     fcntl(tfd, F_SETFL, fcntl(tfd, F_GETFL, 0) | O_NONBLOCK);
 
     if (read(tfd, &uticks, sizeof(uticks)) > 0)
-      fprintf(stdout, "whooops! timer ticks not zero when should have been\n");
+      fprintf(stderr, "whooops! timer ticks not zero when should have been\n");
     else if (errno != EAGAIN)
-      fprintf(stdout, "whooops! bad errno value (%d = '%s')!\n",
+      fprintf(stderr, "whooops! bad errno value (%d = '%s')!\n",
               errno, strerror(errno));
     else
-      fprintf(stdout, "success\n");
+      fprintf(stderr, "success\n");
 
     fcntl(tfd, F_SETFL, fcntl(tfd, F_GETFL, 0) & ~O_NONBLOCK);
 
index c22dd7f4c021e0a5ab601b6b40f02df363b4a997..b19e906c4c85ca693cd0f74c80f0662b87dd794b 100644 (file)
@@ -1,5 +1,51 @@
 
 
+
+---------------------------------------
+| testing CLOCK MONOTONIC
+---------------------------------------
+
+relative timer test (at 500 ms) ...
+wating timer ...
+got timer ticks (1) after 0.5 s
+absolute timer test (at 500 ms) ...
+wating timer ...
+got timer ticks (1) after 0.5 s
+sequential timer test (100 ms clock) ...
+sleeping one second ...
+timerfd_gettime returned:
+       it_value = 0.1 it_interval = 0.1
+sleeping 1 second ...
+wating timer ...
+got timer ticks (20) after 2.0 s
+O_NONBLOCK test ...
+wating timer (flush the single tick) ...
+got timer ticks (1) after 0.1 s
+success
+
+
+---------------------------------------
+| testing CLOCK REALTIME
+---------------------------------------
+
+relative timer test (at 500 ms) ...
+wating timer ...
+got timer ticks (1) after 0.5 s
+absolute timer test (at 500 ms) ...
+wating timer ...
+got timer ticks (1) after 0.5 s
+sequential timer test (100 ms clock) ...
+sleeping one second ...
+timerfd_gettime returned:
+       it_value = 0.1 it_interval = 0.1
+sleeping 1 second ...
+wating timer ...
+got timer ticks (20) after 2.0 s
+O_NONBLOCK test ...
+wating timer (flush the single tick) ...
+got timer ticks (1) after 0.1 s
+success
+
 HEAP SUMMARY:
     in use at exit: 0 bytes in 0 blocks
   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
diff --git a/memcheck/tests/linux/timerfd-syscall.stdout.exp b/memcheck/tests/linux/timerfd-syscall.stdout.exp
deleted file mode 100644 (file)
index 651d6f3..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
----------------------------------------
-| testing CLOCK MONOTONIC
----------------------------------------
-
-relative timer test (at 500 ms) ...
-wating timer ...
-got timer ticks (1) after 0.5 s
-absolute timer test (at 500 ms) ...
-wating timer ...
-got timer ticks (1) after 0.5 s
-sequential timer test (100 ms clock) ...
-sleeping one second ...
-timerfd_gettime returned:
-       it_value = 0.1 it_interval = 0.1
-sleeping 1 second ...
-wating timer ...
-got timer ticks (20) after 2.0 s
-O_NONBLOCK test ...
-wating timer (flush the single tick) ...
-got timer ticks (1) after 0.1 s
-success
-
-
----------------------------------------
-| testing CLOCK REALTIME
----------------------------------------
-
-relative timer test (at 500 ms) ...
-wating timer ...
-got timer ticks (1) after 0.5 s
-absolute timer test (at 500 ms) ...
-wating timer ...
-got timer ticks (1) after 0.5 s
-sequential timer test (100 ms clock) ...
-sleeping one second ...
-timerfd_gettime returned:
-       it_value = 0.1 it_interval = 0.1
-sleeping 1 second ...
-wating timer ...
-got timer ticks (20) after 2.0 s
-O_NONBLOCK test ...
-wating timer (flush the single tick) ...
-got timer ticks (1) after 0.1 s
-success