use big endian
[oweals/gnunet.git] / src / datastore / perf_plugin_datastore.c
index 4efb684a5acb9ae1483fdfa334a2f0dede2ac8cb..17cd009bcd4e304f9a37f72646b6fe61ff2420ca 100644 (file)
@@ -334,7 +334,13 @@ load_plugin (const struct GNUNET_CONFIGURATION_Handle *cfg,
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               _("Loading `%s' datastore plugin\n"), name);
   GNUNET_asprintf (&libname, "libgnunet_plugin_datastore_%s", name);
-  GNUNET_assert (NULL != (ret = GNUNET_PLUGIN_load (libname, &env)));
+  if (NULL == (ret = GNUNET_PLUGIN_load (libname, &env)))
+    {
+      fprintf (stderr,
+              "Failed to load plugin `%s'!\n",
+              name);
+      return NULL;
+    }
   GNUNET_free (libname);
   GNUNET_free (name);
   return ret;
@@ -352,15 +358,19 @@ run (void *cls,
   struct CpsRunContext *crc;
 
   api = load_plugin (c, s);
-  GNUNET_assert (api != NULL);
+  if (api == NULL)
+    {
+      fprintf (stderr, 
+              "Could not initialize plugin, assuming database not configured. Test not run!\n");
+      return;
+    }
   crc = GNUNET_malloc(sizeof(struct CpsRunContext));
   crc->api = api;
   crc->sched = s;
   crc->cfg = c;
   crc->phase = RP_PUT;
-  GNUNET_SCHEDULER_add_after (s,
-                             GNUNET_SCHEDULER_NO_TASK,
-                             &test, crc);
+  GNUNET_SCHEDULER_add_now (crc->sched,
+                           &test, crc);
 }
 
 
@@ -419,7 +429,7 @@ main (int argc, char *argv[])
 #endif
                     NULL);
   ret = check ();
-  GNUNET_DISK_directory_remove ("/tmp/perf-gnunet-datastore");
+  GNUNET_DISK_directory_remove (dir_name);
 
   return ret;
 }