diff options
author | LRN <lrn1986@gmail.com> | 2013-12-09 17:53:31 +0000 |
---|---|---|
committer | LRN <lrn1986@gmail.com> | 2013-12-09 17:53:31 +0000 |
commit | cc57e1d42bbfee97247ad7ea1db3fa81ecbf2c08 (patch) | |
tree | a1239bef1cb83eed339459d24dad5e69f27c8aa1 /src/namestore/test_namestore_api_zone_iteration.c | |
parent | 2d828dcdcd023b9361b11491254d08f122c142b1 (diff) | |
download | gnunet-cc57e1d42bbfee97247ad7ea1db3fa81ecbf2c08.tar.gz gnunet-cc57e1d42bbfee97247ad7ea1db3fa81ecbf2c08.zip |
Remove test home at the beginning and at the VERY end
Diffstat (limited to 'src/namestore/test_namestore_api_zone_iteration.c')
-rw-r--r-- | src/namestore/test_namestore_api_zone_iteration.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/namestore/test_namestore_api_zone_iteration.c b/src/namestore/test_namestore_api_zone_iteration.c index 9c9be53c7..20e927e51 100644 --- a/src/namestore/test_namestore_api_zone_iteration.c +++ b/src/namestore/test_namestore_api_zone_iteration.c | |||
@@ -105,11 +105,6 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
105 | if (privkey2 != NULL) | 105 | if (privkey2 != NULL) |
106 | GNUNET_free (privkey2); | 106 | GNUNET_free (privkey2); |
107 | privkey2 = NULL; | 107 | privkey2 = NULL; |
108 | if (NULL != directory) | ||
109 | { | ||
110 | GNUNET_DISK_directory_remove (directory); | ||
111 | GNUNET_free (directory); | ||
112 | } | ||
113 | res = 1; | 108 | res = 1; |
114 | } | 109 | } |
115 | 110 | ||
@@ -156,11 +151,6 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
156 | } | 151 | } |
157 | if (nsh != NULL) | 152 | if (nsh != NULL) |
158 | GNUNET_NAMESTORE_disconnect (nsh); | 153 | GNUNET_NAMESTORE_disconnect (nsh); |
159 | if (NULL != directory) | ||
160 | { | ||
161 | GNUNET_DISK_directory_remove (directory); | ||
162 | GNUNET_free (directory); | ||
163 | } | ||
164 | nsh = NULL; | 154 | nsh = NULL; |
165 | } | 155 | } |
166 | 156 | ||
@@ -435,6 +425,7 @@ run (void *cls, | |||
435 | { | 425 | { |
436 | directory = NULL; | 426 | directory = NULL; |
437 | GNUNET_CONFIGURATION_get_value_string(cfg, "PATHS", "GNUNET_TEST_HOME", &directory); | 427 | GNUNET_CONFIGURATION_get_value_string(cfg, "PATHS", "GNUNET_TEST_HOME", &directory); |
428 | GNUNET_DISK_directory_remove (directory); | ||
438 | 429 | ||
439 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT, &endbadly, NULL); | 430 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT, &endbadly, NULL); |
440 | nsh = GNUNET_NAMESTORE_connect (cfg); | 431 | nsh = GNUNET_NAMESTORE_connect (cfg); |
@@ -456,13 +447,19 @@ int | |||
456 | main (int argc, char *argv[]) | 447 | main (int argc, char *argv[]) |
457 | { | 448 | { |
458 | res = 1; | 449 | res = 1; |
459 | GNUNET_DISK_directory_remove ("/tmp/test-gnunet-namestore"); | ||
460 | if (0 != | 450 | if (0 != |
461 | GNUNET_TESTING_peer_run ("test-namestore-api-zone-iteration", | 451 | GNUNET_TESTING_peer_run ("test-namestore-api-zone-iteration", |
462 | "test_namestore_api.conf", | 452 | "test_namestore_api.conf", |
463 | &run, | 453 | &run, |
464 | NULL)) | 454 | NULL)) |
465 | return 1; | 455 | { |
456 | res = 1; | ||
457 | } | ||
458 | if (NULL != directory) | ||
459 | { | ||
460 | GNUNET_DISK_directory_remove (directory); | ||
461 | GNUNET_free (directory); | ||
462 | } | ||
466 | return res; | 463 | return res; |
467 | } | 464 | } |
468 | 465 | ||