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_not_existing_record.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_not_existing_record.c')
-rw-r--r-- | src/namestore/test_namestore_api_remove_not_existing_record.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/namestore/test_namestore_api_remove_not_existing_record.c b/src/namestore/test_namestore_api_remove_not_existing_record.c index d1a664b17..c3afee6ff 100644 --- a/src/namestore/test_namestore_api_remove_not_existing_record.c +++ b/src/namestore/test_namestore_api_remove_not_existing_record.c | |||
@@ -46,6 +46,7 @@ static int res; | |||
46 | 46 | ||
47 | static struct GNUNET_NAMESTORE_QueueEntry *nsqe; | 47 | static struct GNUNET_NAMESTORE_QueueEntry *nsqe; |
48 | 48 | ||
49 | static char *directory; | ||
49 | 50 | ||
50 | static void | 51 | static void |
51 | cleanup () | 52 | cleanup () |
@@ -60,6 +61,11 @@ cleanup () | |||
60 | GNUNET_free (privkey); | 61 | GNUNET_free (privkey); |
61 | privkey = NULL; | 62 | privkey = NULL; |
62 | } | 63 | } |
64 | if (NULL != directory) | ||
65 | { | ||
66 | GNUNET_DISK_directory_remove (directory); | ||
67 | GNUNET_free (directory); | ||
68 | } | ||
63 | GNUNET_SCHEDULER_shutdown (); | 69 | GNUNET_SCHEDULER_shutdown (); |
64 | } | 70 | } |
65 | 71 | ||
@@ -133,6 +139,9 @@ run (void *cls, | |||
133 | char *hostkey_file; | 139 | char *hostkey_file; |
134 | const char * name = "dummy.dummy.gnunet"; | 140 | const char * name = "dummy.dummy.gnunet"; |
135 | 141 | ||
142 | directory = NULL; | ||
143 | GNUNET_CONFIGURATION_get_value_string(cfg, "PATHS", "GNUNET_TEST_HOME", &directory); | ||
144 | |||
136 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 145 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
137 | &endbadly, NULL); | 146 | &endbadly, NULL); |
138 | GNUNET_asprintf (&hostkey_file, | 147 | GNUNET_asprintf (&hostkey_file, |