- added check against statistics
[oweals/gnunet.git] / src / datastore / perf_datastore_api.c
index 07df6a691b22128446c0b0daa71c7a448487740d..aae152db81dc5e6eb33551aa86eb555f470d67f2 100644 (file)
@@ -111,7 +111,7 @@ run_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
 
 
 static void
-check_success (void *cls, int success, const char *msg)
+check_success (void *cls, int success, struct GNUNET_TIME_Absolute min_expiration,  const char *msg)
 {
   struct CpsRunContext *crc = cls;
 
@@ -123,7 +123,7 @@ check_success (void *cls, int success, const char *msg)
     return;
   }
 #if REPORT_ID
-  fprintf (stderr, "I");
+  FPRINTF (stderr, "%s",  "I");
 #endif
   stored_bytes += crc->size;
   stored_ops++;
@@ -149,10 +149,12 @@ check_success (void *cls, int success, const char *msg)
  *
  * @param cls closure
  * @param success GNUNET_SYSERR on failure
+ * @param min_expiration minimum expiration time required for content to be stored
+ *                by the datacache at this time, zero for unknown
  * @param msg NULL on success, otherwise an error message
  */
 static void
-remove_next (void *cls, int success, const char *msg)
+remove_next (void *cls, int success, struct GNUNET_TIME_Absolute min_expiration, const char *msg)
 {
   struct CpsRunContext *crc = cls;
 
@@ -164,7 +166,7 @@ remove_next (void *cls, int success, const char *msg)
     return;
   }
 #if REPORT_ID
-  fprintf (stderr, "D");
+  FPRINTF (stderr, "%s",  "D");
 #endif
   GNUNET_assert (GNUNET_OK == success);
   GNUNET_SCHEDULER_add_now (&run_continuation, crc);
@@ -276,13 +278,13 @@ run_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
 
 static void
-run_tests (void *cls, int success, const char *msg)
+run_tests (void *cls, int success, struct GNUNET_TIME_Absolute min_expiration, const char *msg)
 {
   struct CpsRunContext *crc = cls;
 
   if (success != GNUNET_YES)
   {
-    fprintf (stderr,
+    FPRINTF (stderr,
              "Test 'put' operation failed with error `%s' database likely not setup, skipping test.",
              msg);
     GNUNET_free (crc);
@@ -312,7 +314,7 @@ run (void *cls, char *const *args, const char *cfgfile,
                             (GNUNET_TIME_UNIT_SECONDS), 0, 1,
                             GNUNET_TIME_UNIT_MINUTES, &run_tests, crc))
   {
-    fprintf (stderr, "Test 'put' operation failed.\n");
+    FPRINTF (stderr, "%s",  "Test 'put' operation failed.\n");
     ok = 1;
     GNUNET_free (crc);
   }
@@ -341,7 +343,7 @@ check ()
   GNUNET_snprintf (cfg_name, sizeof (cfg_name),
                    "test_datastore_api_data_%s.conf", plugin_name);
   proc =
-      GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm",
+      GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-arm",
                                "gnunet-service-arm",
 #if VERBOSE
                                "-L", "DEBUG",
@@ -394,7 +396,7 @@ main (int argc, char *argv[])
   if (pos != plugin_name)
     pos[0] = '.';
 #if REPORT_ID
-  fprintf (stderr, "\n");
+  FPRINTF (stderr, "%s",  "\n");
 #endif
   GNUNET_DISK_directory_remove (dir_name);
   return ret;