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_remove.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_remove.c')
-rw-r--r-- | src/namestore/test_namestore_api_remove.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/namestore/test_namestore_api_remove.c b/src/namestore/test_namestore_api_remove.c index 7c8f47f5d..5ae82b1ef 100644 --- a/src/namestore/test_namestore_api_remove.c +++ b/src/namestore/test_namestore_api_remove.c | |||
@@ -48,6 +48,7 @@ static int removed; | |||
48 | 48 | ||
49 | static struct GNUNET_NAMESTORE_QueueEntry *nsqe; | 49 | static struct GNUNET_NAMESTORE_QueueEntry *nsqe; |
50 | 50 | ||
51 | static char *directory; | ||
51 | 52 | ||
52 | static void | 53 | static void |
53 | cleanup () | 54 | cleanup () |
@@ -62,6 +63,11 @@ cleanup () | |||
62 | GNUNET_free (privkey); | 63 | GNUNET_free (privkey); |
63 | privkey = NULL; | 64 | privkey = NULL; |
64 | } | 65 | } |
66 | if (NULL != directory) | ||
67 | { | ||
68 | GNUNET_DISK_directory_remove (directory); | ||
69 | GNUNET_free (directory); | ||
70 | } | ||
65 | GNUNET_SCHEDULER_shutdown (); | 71 | GNUNET_SCHEDULER_shutdown (); |
66 | } | 72 | } |
67 | 73 | ||
@@ -153,6 +159,9 @@ run (void *cls, | |||
153 | char *hostkey_file; | 159 | char *hostkey_file; |
154 | const char * name = "dummy.dummy.gnunet"; | 160 | const char * name = "dummy.dummy.gnunet"; |
155 | 161 | ||
162 | directory = NULL; | ||
163 | GNUNET_CONFIGURATION_get_value_string(cfg, "PATHS", "GNUNET_TEST_HOME", &directory); | ||
164 | |||
156 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 165 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
157 | &endbadly, NULL); | 166 | &endbadly, NULL); |
158 | GNUNET_asprintf (&hostkey_file, | 167 | GNUNET_asprintf (&hostkey_file, |