[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r11114 - gnunet/src/testing
From: |
gnunet |
Subject: |
[GNUnet-SVN] r11114 - gnunet/src/testing |
Date: |
Thu, 29 Apr 2010 11:19:29 +0200 |
Author: nevans
Date: 2010-04-29 11:19:29 +0200 (Thu, 29 Apr 2010)
New Revision: 11114
Modified:
gnunet/src/testing/test_testing_topology.c
Log:
coverity warning fixes
Modified: gnunet/src/testing/test_testing_topology.c
===================================================================
--- gnunet/src/testing/test_testing_topology.c 2010-04-29 09:15:05 UTC (rev
11113)
+++ gnunet/src/testing/test_testing_topology.c 2010-04-29 09:19:29 UTC (rev
11114)
@@ -25,7 +25,7 @@
#include "gnunet_testing_lib.h"
#include "gnunet_core_service.h"
-#define VERBOSE GNUNET_NO
+#define VERBOSE GNUNET_YES
/**
* How long until we fail the whole testcase?
@@ -83,6 +83,8 @@
static enum GNUNET_TESTING_Topology topology;
+static char *test_directory;
+
#define MTYPE 12345
struct GNUNET_TestMessage
@@ -592,6 +594,12 @@
"Starting daemons based on config file %s\n", cfgfile);
#endif
+ if (GNUNET_YES != GNUNET_CONFIGURATION_get_value_string(cfg, "paths",
"servicehome", &test_directory))
+ {
+ ok = 404;
+ return;
+ }
+
if (GNUNET_YES ==
GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "topology",
&topology_num))
@@ -625,6 +633,7 @@
char *config_file_name;
GNUNET_asprintf(&binary_name, "test-testing-topology-%s", topology_string);
GNUNET_asprintf(&config_file_name, "test_testing_data_topology_%s.conf",
topology_string);
+ int ret;
char *const argv[] = {binary_name,
"-c",
config_file_name,
@@ -636,9 +645,13 @@
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_OPTION_END
};
- GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1,
+ ret = GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1,
argv, binary_name, "nohelp",
options, &run, &ok);
+ if (ret != GNUNET_OK)
+ {
+ GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "`test-testing-topology-%s':
Failed with error code %d\n", topology_string, ret);
+ }
GNUNET_free(binary_name);
GNUNET_free(config_file_name);
return ok;
@@ -676,7 +689,10 @@
* Need to remove base directory, subdirectories taken care
* of by the testing framework.
*/
- GNUNET_DISK_directory_remove ("/tmp/test-gnunet-testing");
+ if (GNUNET_DISK_directory_remove (test_directory) != GNUNET_OK)
+ {
+ GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Failed to remove testing
directory %s\n", test_directory);
+ }
GNUNET_free(our_binary_name);
return ret;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r11114 - gnunet/src/testing,
gnunet <=