tolerate missing DB setup
authorChristian Grothoff <christian@grothoff.org>
Sat, 14 Aug 2010 14:55:23 +0000 (14:55 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sat, 14 Aug 2010 14:55:23 +0000 (14:55 +0000)
src/datacache/perf_datacache.c
src/datacache/test_datacache.c
src/datacache/test_datacache_quota.c

index e2eb474d4f56a55898b5591437eacbef1aad897c..10efa5eee99db89ffe4c000fb1663b7c5945e97c 100644 (file)
@@ -76,7 +76,12 @@ run (void *cls,
                               cfg,
                               "perfcache");
 
-  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 ();
   start = exp;
   exp.value += 5 * 60 * 1000;
index c5acf365aa74d538481d890b2c3efe7349551cfb..0c9399affabb1e29cd8a36c0b5509fc0d4979e08 100644 (file)
@@ -77,8 +77,12 @@ run (void *cls,
   h = GNUNET_DATACACHE_create (sched,
                               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 += 5 * 60 * 1000;
   memset (&k, 0, sizeof (GNUNET_HashCode));
index 9028196bd32f80e1e2057250ee255b4ce37e08d1..ada5ae1715c57e7176bfbe55c3802e70c76406af 100644 (file)
@@ -63,7 +63,12 @@ run (void *cls,
                               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;
   memset (buf, 1, sizeof (buf));