- doc
[oweals/gnunet.git] / src / testing / gnunet-testing.c
index cc5c6f50ce8598969c973205fb9aea48f109ecf2..28c5be96550c023de331be4ee752e496b998f4df 100644 (file)
@@ -25,7 +25,7 @@
  */
 #include "platform.h"
 #include "gnunet_util_lib.h"
-#include "gnunet_testing_lib-new.h"
+#include "gnunet_testing_lib.h"
 
 
 #define HOSTKEYFILESIZE 914
@@ -65,14 +65,15 @@ create_unique_cfgs (const char * template, const unsigned int no)
   if ((create_cfg_template != NULL) && (GNUNET_OK != GNUNET_CONFIGURATION_load(cfg_tmpl, create_cfg_template)))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Could not load template `%s'\n", create_cfg_template);
-    GNUNET_CONFIGURATION_destroy(cfg_tmpl);
+    GNUNET_CONFIGURATION_destroy (cfg_tmpl);
 
     return 1;
   }
   /* load defaults */
   if (GNUNET_OK != GNUNET_CONFIGURATION_load (cfg_tmpl,  NULL))
   {
-    GNUNET_break (0);
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Could not load template `%s'\n", create_cfg_template);
+    GNUNET_CONFIGURATION_destroy (cfg_tmpl);
     return 1;
   }
 
@@ -209,14 +210,15 @@ main (int argc, char *const *argv)
      GNUNET_YES, &GNUNET_GETOPT_set_string, &create_cfg_template},
     GNUNET_GETOPT_OPTION_END
   };
-
   if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
     return 2;
 
-  return (GNUNET_OK ==
-          GNUNET_PROGRAM_run (argc, argv, "gnunet-testing",
-                              gettext_noop ("Command line tool to access the testing library"), options, &run,
-                              NULL)) ? ret : 1;
+  ret = (GNUNET_OK ==
+        GNUNET_PROGRAM_run (argc, argv, "gnunet-testing",
+                            gettext_noop ("Command line tool to access the testing library"), options, &run,
+                            NULL)) ? ret : 1;
+  GNUNET_free ((void*) argv);
+  return ret;
 }
 
 /* end of gnunet-testing.c */