diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-11-28 08:10:19 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-11-28 08:10:19 +0000 |
commit | 55942930db8ad9c07d1ee5878bdb414495743c7f (patch) | |
tree | a729b931ac0af2fd2c5fd981866372cd66d9e04a /src/namestore/test_namestore_api_zone_iteration.c | |
parent | 2e785bfc13a5e12559c1ceec0879891ce9601fe7 (diff) | |
download | gnunet-55942930db8ad9c07d1ee5878bdb414495743c7f.tar.gz gnunet-55942930db8ad9c07d1ee5878bdb414495743c7f.zip |
- Tests did not clean up: TEST_HOME with namestore db was not removed after test
Therefore test_namestore_api_remove_not_existing_record passed when executed on a clean system,
but failed if ran after a previous test adding a record
- remove unused file namestore/test_namestore_api_put.c
Diffstat (limited to 'src/namestore/test_namestore_api_zone_iteration.c')
-rw-r--r-- | src/namestore/test_namestore_api_zone_iteration.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/namestore/test_namestore_api_zone_iteration.c b/src/namestore/test_namestore_api_zone_iteration.c index f2eb1d17b..9c9be53c7 100644 --- a/src/namestore/test_namestore_api_zone_iteration.c +++ b/src/namestore/test_namestore_api_zone_iteration.c | |||
@@ -56,6 +56,8 @@ static char * s_name_3; | |||
56 | 56 | ||
57 | static struct GNUNET_GNSRECORD_Data *s_rd_3; | 57 | static struct GNUNET_GNSRECORD_Data *s_rd_3; |
58 | 58 | ||
59 | static char *directory; | ||
60 | |||
59 | 61 | ||
60 | /** | 62 | /** |
61 | * Re-establish the connection to the service. | 63 | * Re-establish the connection to the service. |
@@ -103,6 +105,11 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
103 | if (privkey2 != NULL) | 105 | if (privkey2 != NULL) |
104 | GNUNET_free (privkey2); | 106 | GNUNET_free (privkey2); |
105 | privkey2 = NULL; | 107 | privkey2 = NULL; |
108 | if (NULL != directory) | ||
109 | { | ||
110 | GNUNET_DISK_directory_remove (directory); | ||
111 | GNUNET_free (directory); | ||
112 | } | ||
106 | res = 1; | 113 | res = 1; |
107 | } | 114 | } |
108 | 115 | ||
@@ -149,6 +156,11 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
149 | } | 156 | } |
150 | if (nsh != NULL) | 157 | if (nsh != NULL) |
151 | GNUNET_NAMESTORE_disconnect (nsh); | 158 | GNUNET_NAMESTORE_disconnect (nsh); |
159 | if (NULL != directory) | ||
160 | { | ||
161 | GNUNET_DISK_directory_remove (directory); | ||
162 | GNUNET_free (directory); | ||
163 | } | ||
152 | nsh = NULL; | 164 | nsh = NULL; |
153 | } | 165 | } |
154 | 166 | ||
@@ -421,6 +433,9 @@ run (void *cls, | |||
421 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 433 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
422 | struct GNUNET_TESTING_Peer *peer) | 434 | struct GNUNET_TESTING_Peer *peer) |
423 | { | 435 | { |
436 | directory = NULL; | ||
437 | GNUNET_CONFIGURATION_get_value_string(cfg, "PATHS", "GNUNET_TEST_HOME", &directory); | ||
438 | |||
424 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT, &endbadly, NULL); | 439 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT, &endbadly, NULL); |
425 | nsh = GNUNET_NAMESTORE_connect (cfg); | 440 | nsh = GNUNET_NAMESTORE_connect (cfg); |
426 | GNUNET_break (NULL != nsh); | 441 | GNUNET_break (NULL != nsh); |