WiP
[oweals/gnunet.git] / src / util / test_scheduler_delay.c
index f5477fd4c4922a5317f8fb7419ef6f54df522649..1f60ca9fd1c474d0976d2a0a9ee7b38765fc6e75 100644 (file)
@@ -4,7 +4,7 @@
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 2, or (at your
+     by the Free Software Foundation; either version 3, or (at your
      option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
@@ -52,10 +52,10 @@ test_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   struct GNUNET_TIME_Absolute now;
 
   now = GNUNET_TIME_absolute_get ();
-  if (now.value > target.value)
-    cumDelta += (now.value - target.value);
+  if (now.abs_value > target.abs_value)
+    cumDelta += (now.abs_value - target.abs_value);
   else
-    cumDelta += (target.value - now.value);
+    cumDelta += (target.abs_value - now.abs_value);
   target =
     GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_multiply
                                       (GNUNET_TIME_UNIT_MILLISECONDS, i));
@@ -65,11 +65,7 @@ test_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
       fprintf (stderr, "\n");
       return;
     }
-  GNUNET_SCHEDULER_add_delayed (tc->sched,
-                                GNUNET_NO,
-                                GNUNET_SCHEDULER_PRIORITY_DEFAULT,
-                                GNUNET_SCHEDULER_NO_TASK,
-                                GNUNET_TIME_relative_multiply
+  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
                                 (GNUNET_TIME_UNIT_MILLISECONDS, i),
                                 &test_task, NULL);
   i += INCR;