aboutsummaryrefslogtreecommitdiff
path: root/src/datacache/perf_datacache.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/datacache/perf_datacache.c')
-rw-r--r--src/datacache/perf_datacache.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/datacache/perf_datacache.c b/src/datacache/perf_datacache.c
index 77edbf9255..94cd7a58e6 100644
--- a/src/datacache/perf_datacache.c
+++ b/src/datacache/perf_datacache.c
@@ -25,9 +25,9 @@
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_datacache_lib.h"
+#include "gnunet_testing_lib-new.h"
#include <gauger.h>
-#define VERBOSE GNUNET_NO
#define ASSERT(x) do { if (! (x)) { printf("Error at %s:%d\n", __FILE__, __LINE__); goto FAILURE;} } while (0)
@@ -129,16 +129,11 @@ FAILURE:
int
main (int argc, char *argv[])
{
- char *pos;
char cfg_name[128];
-
char *const xargv[] = {
"perf-datacache",
"-c",
cfg_name,
-#if VERBOSE
- "-L", "DEBUG",
-#endif
NULL
};
struct GNUNET_GETOPT_CommandLineOption options[] = {
@@ -146,25 +141,11 @@ main (int argc, char *argv[])
};
GNUNET_log_setup ("perf-datacache",
-#if VERBOSE
- "DEBUG",
-#else
"WARNING",
-#endif
NULL);
- /* determine name of plugin to use */
- plugin_name = argv[0];
- while (NULL != (pos = strstr (plugin_name, "_")))
- plugin_name = pos + 1;
- if (NULL != (pos = strstr (plugin_name, ".")))
- pos[0] = 0;
- else
- pos = (char *) plugin_name;
-
+ plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]);
GNUNET_snprintf (cfg_name, sizeof (cfg_name), "perf_datacache_data_%s.conf",
plugin_name);
- if (pos != plugin_name)
- pos[0] = '.';
GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, xargv,
"perf-datacache", "nohelp", options, &run, NULL);
if (ok != 0)