aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/test_namestore_api_zone_to_name.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-11-28 08:10:19 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-11-28 08:10:19 +0000
commit55942930db8ad9c07d1ee5878bdb414495743c7f (patch)
treea729b931ac0af2fd2c5fd981866372cd66d9e04a /src/namestore/test_namestore_api_zone_to_name.c
parent2e785bfc13a5e12559c1ceec0879891ce9601fe7 (diff)
downloadgnunet-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_to_name.c')
-rw-r--r--src/namestore/test_namestore_api_zone_to_name.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/namestore/test_namestore_api_zone_to_name.c b/src/namestore/test_namestore_api_zone_to_name.c
index c7cbe0ebe..26593547b 100644
--- a/src/namestore/test_namestore_api_zone_to_name.c
+++ b/src/namestore/test_namestore_api_zone_to_name.c
@@ -57,6 +57,7 @@ static struct GNUNET_CRYPTO_EcdsaSignature *s_signature;
57 57
58static int res; 58static int res;
59 59
60static char *directory;
60 61
61/** 62/**
62 * Re-establish the connection to the service. 63 * Re-establish the connection to the service.
@@ -72,6 +73,11 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
72 nsh = NULL; 73 nsh = NULL;
73 if (privkey != NULL) 74 if (privkey != NULL)
74 GNUNET_free (privkey); 75 GNUNET_free (privkey);
76 if (NULL != directory)
77 {
78 GNUNET_DISK_directory_remove (directory);
79 GNUNET_free (directory);
80 }
75 privkey = NULL; 81 privkey = NULL;
76 res = 1; 82 res = 1;
77} 83}
@@ -90,6 +96,11 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
90 privkey = NULL; 96 privkey = NULL;
91 if (nsh != NULL) 97 if (nsh != NULL)
92 GNUNET_NAMESTORE_disconnect (nsh); 98 GNUNET_NAMESTORE_disconnect (nsh);
99 if (NULL != directory)
100 {
101 GNUNET_DISK_directory_remove (directory);
102 GNUNET_free (directory);
103 }
93 nsh = NULL; 104 nsh = NULL;
94} 105}
95 106
@@ -167,6 +178,9 @@ run (void *cls,
167{ 178{
168 struct GNUNET_TIME_Absolute et; 179 struct GNUNET_TIME_Absolute et;
169 180
181 directory = NULL;
182 GNUNET_CONFIGURATION_get_value_string(cfg, "PATHS", "GNUNET_TEST_HOME", &directory);
183
170 endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL); 184 endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL);
171 GNUNET_asprintf (&s_name, "dummy"); 185 GNUNET_asprintf (&s_name, "dummy");
172 /* load privat key */ 186 /* load privat key */