-never store NICKs anywhere but in '+', do not display nicks in gnunet-namestore
[oweals/gnunet.git] / src / namestore / test_namestore_api_remove_not_existing_record.c
index d35d867c5485b07692de2e2dda3644e72bfdc40d..2bc53c192673fc371c34438cadad0710589bd5bc 100644 (file)
@@ -46,6 +46,7 @@ static int res;
 
 static struct GNUNET_NAMESTORE_QueueEntry *nsqe;
 
+static char *directory;
 
 static void
 cleanup ()
@@ -105,19 +106,20 @@ put_cont (void *cls, int32_t success, const char *emsg)
 
   switch (success) {
     case GNUNET_NO:
+      /* We expected GNUNET_NO, since record was not found */
       GNUNET_SCHEDULER_add_now (&end, NULL);
       break;
     case GNUNET_OK:
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                   "Namestore could remove non-existing record: `%s'\n",
-                  emsg);
+                  (NULL !=emsg) ? emsg : "");
       GNUNET_SCHEDULER_add_now (&endbadly, NULL);
       break;
     case GNUNET_SYSERR:
     default:
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                   "Namestore failed: `%s'\n",
-                  emsg);
+                  (NULL !=emsg) ? emsg : "");
       GNUNET_SCHEDULER_add_now (&endbadly, NULL);
       break;
   }
@@ -132,6 +134,10 @@ run (void *cls,
   char *hostkey_file;
   const char * name = "dummy.dummy.gnunet";
 
+  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);
   GNUNET_asprintf (&hostkey_file,
@@ -168,7 +174,14 @@ main (int argc, char *argv[])
                                "test_namestore_api.conf",
                                &run,
                                NULL))
-    return 1;
+  {
+    res = 1;
+  }
+  if (NULL != directory)
+  {
+      GNUNET_DISK_directory_remove (directory);
+      GNUNET_free (directory);
+  }
   return res;
 }