diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-06-10 11:43:20 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-06-10 11:43:20 +0000 |
commit | dadbf4c950bf4cd459c95ac4ab61a02af7b3668b (patch) | |
tree | ddaf0644dcd97fbef7f67a68eff2a5cf204b0bb7 /src/datastore/perf_plugin_datastore.c | |
parent | 8efaae301b29ec7cbdb921ac5e6b30ae2c143568 (diff) | |
download | gnunet-dadbf4c950bf4cd459c95ac4ab61a02af7b3668b.tar.gz gnunet-dadbf4c950bf4cd459c95ac4ab61a02af7b3668b.zip |
-using new testing api to determine plugin name
Diffstat (limited to 'src/datastore/perf_plugin_datastore.c')
-rw-r--r-- | src/datastore/perf_plugin_datastore.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/datastore/perf_plugin_datastore.c b/src/datastore/perf_plugin_datastore.c index daea8d796..763b38766 100644 --- a/src/datastore/perf_plugin_datastore.c +++ b/src/datastore/perf_plugin_datastore.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "gnunet_util_lib.h" | 27 | #include "gnunet_util_lib.h" |
28 | #include "gnunet_protocols.h" | 28 | #include "gnunet_protocols.h" |
29 | #include "gnunet_datastore_plugin.h" | 29 | #include "gnunet_datastore_plugin.h" |
30 | #include "gnunet_testing_lib-new.h" | ||
30 | #include <gauger.h> | 31 | #include <gauger.h> |
31 | 32 | ||
32 | /** | 33 | /** |
@@ -453,7 +454,6 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
453 | int | 454 | int |
454 | main (int argc, char *argv[]) | 455 | main (int argc, char *argv[]) |
455 | { | 456 | { |
456 | char *pos; | ||
457 | char dir_name[128]; | 457 | char dir_name[128]; |
458 | char cfg_name[128]; | 458 | char cfg_name[128]; |
459 | char *const argv[] = { | 459 | char *const argv[] = { |
@@ -466,14 +466,7 @@ main (int argc, char *argv[]) | |||
466 | GNUNET_GETOPT_OPTION_END | 466 | GNUNET_GETOPT_OPTION_END |
467 | }; | 467 | }; |
468 | 468 | ||
469 | /* determine name of plugin to use */ | 469 | plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]); |
470 | plugin_name = argv[0]; | ||
471 | while (NULL != (pos = strstr (plugin_name, "_"))) | ||
472 | plugin_name = pos + 1; | ||
473 | if (NULL != (pos = strstr (plugin_name, "."))) | ||
474 | pos[0] = 0; | ||
475 | else | ||
476 | pos = (char *) plugin_name; | ||
477 | GNUNET_snprintf (dir_name, sizeof (dir_name), "/tmp/perf-gnunet-datastore-%s", | 470 | GNUNET_snprintf (dir_name, sizeof (dir_name), "/tmp/perf-gnunet-datastore-%s", |
478 | plugin_name); | 471 | plugin_name); |
479 | GNUNET_DISK_directory_remove (dir_name); | 472 | GNUNET_DISK_directory_remove (dir_name); |
@@ -487,8 +480,6 @@ main (int argc, char *argv[]) | |||
487 | "perf-plugin-datastore", "nohelp", options, &run, NULL); | 480 | "perf-plugin-datastore", "nohelp", options, &run, NULL); |
488 | if (ok != 0) | 481 | if (ok != 0) |
489 | FPRINTF (stderr, "Missed some testcases: %u\n", ok); | 482 | FPRINTF (stderr, "Missed some testcases: %u\n", ok); |
490 | if (pos != plugin_name) | ||
491 | pos[0] = '.'; | ||
492 | GNUNET_DISK_directory_remove (dir_name); | 483 | GNUNET_DISK_directory_remove (dir_name); |
493 | 484 | ||
494 | return ok; | 485 | return ok; |