-code deduplication in rsa sign/verify code
[oweals/gnunet.git] / src / util / test_scheduler_delay.c
index 8bcfa096e9b76135f551f9fbad8a345138a8fc10..1320669796f8db14ce19793d274f4433ec0e637c 100644 (file)
@@ -28,8 +28,6 @@
 #include "gnunet_scheduler_lib.h"
 #include "gnunet_time_lib.h"
 
-#define VERBOSE GNUNET_NO
-
 static struct GNUNET_TIME_Absolute target;
 
 static int i;
@@ -59,10 +57,10 @@ test_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   target =
       GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_multiply
                                         (GNUNET_TIME_UNIT_MILLISECONDS, i));
-  fprintf (stderr, ".");
+  FPRINTF (stderr, "%s",  ".");
   if (i > MAXV)
   {
-    fprintf (stderr, "\n");
+    FPRINTF (stderr, "%s",  "\n");
     return;
   }
   GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
@@ -71,33 +69,24 @@ test_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   i += INCR;
 }
 
-static int
-check ()
+
+int
+main (int argc, char *argv[])
 {
+  GNUNET_log_setup ("test-scheduler-delay", "WARNING", NULL);
   target = GNUNET_TIME_absolute_get ();
   GNUNET_SCHEDULER_run (&test_task, NULL);
   FPRINTF (stdout, "Sleep precision: %llu ms. ",
            cumDelta / 1000 / (MAXV / INCR));
   if (cumDelta <= 10 * MAXV / INCR)
-    fprintf (stdout, "Timer precision is excellent.\n");
+    FPRINTF (stdout, "%s",  "Timer precision is excellent.\n");
   else if (cumDelta <= 50 * MAXV / INCR)        /* 50 ms average deviation */
-    fprintf (stdout, "Timer precision is good.\n");
+    FPRINTF (stdout, "%s",  "Timer precision is good.\n");
   else if (cumDelta > 250 * MAXV / INCR)
-    fprintf (stdout, "Timer precision is awful.\n");
+    FPRINTF (stdout, "%s",  "Timer precision is awful.\n");
   else
-    fprintf (stdout, "Timer precision is acceptable.\n");
+    FPRINTF (stdout, "%s",  "Timer precision is acceptable.\n");
   return 0;
 }
 
-int
-main (int argc, char *argv[])
-{
-  int ret;
-
-  GNUNET_log_setup ("test-scheduler-delay", "WARNING", NULL);
-  ret = check ();
-
-  return ret;
-}
-
 /* end of test_scheduler_delay.c */