-tolerate it if gnunet://gns/ URI prefix is in upper case
[oweals/gnunet.git] / src / namestore / test_namestore_api_zone_iteration.c
index 7ff21a39d11a4870f2fb09ca9ea3bbb390c4f413..20e927e51f8229c78e9f82349abdf5e22b563702 100644 (file)
@@ -56,6 +56,8 @@ static char * s_name_3;
 
 static struct GNUNET_GNSRECORD_Data *s_rd_3;
 
+static char *directory;
+
 
 /**
  * Re-establish the connection to the service.
@@ -330,6 +332,7 @@ create_record (unsigned int count)
     rd[c].record_type = 1111;
     rd[c].data_size = 50;
     rd[c].data = GNUNET_malloc(50);
+    rd[c].flags = 0;
     memset ((char *) rd[c].data, 'a', 50);
   }
   return rd;
@@ -420,6 +423,10 @@ run (void *cls,
      const struct GNUNET_CONFIGURATION_Handle *cfg,
      struct GNUNET_TESTING_Peer *peer)
 {
+  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);
   GNUNET_break (NULL != nsh);
@@ -440,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;
 }