-tolerate it if gnunet://gns/ URI prefix is in upper case
[oweals/gnunet.git] / src / namestore / test_namestore_api_zone_iteration.c
index 9c9be53c7ac5fd31709c11dc6be4ccb6e0efa0a6..20e927e51f8229c78e9f82349abdf5e22b563702 100644 (file)
@@ -105,11 +105,6 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   if (privkey2 != NULL)
     GNUNET_free (privkey2);
   privkey2 = NULL;
-  if (NULL != directory)
-  {
-      GNUNET_DISK_directory_remove (directory);
-      GNUNET_free (directory);
-  }
   res = 1;
 }
 
@@ -156,11 +151,6 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   }
   if (nsh != NULL)
     GNUNET_NAMESTORE_disconnect (nsh);
-  if (NULL != directory)
-  {
-      GNUNET_DISK_directory_remove (directory);
-      GNUNET_free (directory);
-  }
   nsh = NULL;
 }
 
@@ -435,6 +425,7 @@ run (void *cls,
 {
   directory = NULL;
   GNUNET_CONFIGURATION_get_value_string(cfg, "PATHS", "GNUNET_TEST_HOME", &directory);
+  GNUNET_DISK_directory_remove (directory);
 
   endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT, &endbadly, NULL);
   nsh = GNUNET_NAMESTORE_connect (cfg);
@@ -456,13 +447,19 @@ int
 main (int argc, char *argv[])
 {
   res = 1;
-  GNUNET_DISK_directory_remove ("/tmp/test-gnunet-namestore");
   if (0 !=
       GNUNET_TESTING_peer_run ("test-namestore-api-zone-iteration",
                                "test_namestore_api.conf",
                                &run,
                                NULL))
-    return 1;
+  {
+    res = 1;
+  }
+  if (NULL != directory)
+  {
+      GNUNET_DISK_directory_remove (directory);
+      GNUNET_free (directory);
+  }
   return res;
 }