port 0 for tcp plugin is BAD
[oweals/gnunet.git] / src / datacache / test_datacache_quota.c
index 9028196bd32f80e1e2057250ee255b4ce37e08d1..77ad63815713dc8f23c7fff4b2cc853f0bc6a645 100644 (file)
@@ -45,7 +45,6 @@ static const char *plugin_name;
  */
 static void
 run (void *cls,
-     struct GNUNET_SCHEDULER_Handle *sched,
      char *const *args,
      const char *cfgfile, 
      const struct GNUNET_CONFIGURATION_Handle *cfg)
@@ -59,13 +58,17 @@ run (void *cls,
   struct GNUNET_TIME_Absolute exp;
 
   ok = 0;
-  h = GNUNET_DATACACHE_create (sched,
-                              cfg,
+  h = GNUNET_DATACACHE_create (cfg,
                               "testcache");
 
-  ASSERT (NULL != h);
+  if (h == NULL)
+    {
+      fprintf (stderr,
+              "Failed to initialize datacache.  Database likely not setup, skipping test.\n");
+      return;
+    }
   exp = GNUNET_TIME_absolute_get ();
-  exp.value += 20 * 60 * 1000;
+  exp.abs_value += 20 * 60 * 1000;
   memset (buf, 1, sizeof (buf));
   memset (&k, 0, sizeof (GNUNET_HashCode));
   for (i = 0; i < 10; i++)
@@ -74,7 +77,7 @@ run (void *cls,
       GNUNET_CRYPTO_hash (&k, sizeof (GNUNET_HashCode), &n);
       for (j = i; j < sizeof (buf); j += 10)
         {
-         exp.value++;
+         exp.abs_value++;
           buf[j] = i;
           ASSERT (GNUNET_OK == 
                  GNUNET_DATACACHE_put (h,