aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/test_namestore_api_remove_not_existing_record.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-03-02 10:21:58 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-03-02 10:21:58 +0000
commite892ec3a25fc315d58ae7aafbd138b79aff2ca34 (patch)
tree618d778ee297a080cc4aa17b1013ef03dc99fb9c /src/namestore/test_namestore_api_remove_not_existing_record.c
parente2f8c8f83b67abb62b8858beb684b0b7f43c3ed7 (diff)
downloadgnunet-e892ec3a25fc315d58ae7aafbd138b79aff2ca34.tar.gz
gnunet-e892ec3a25fc315d58ae7aafbd138b79aff2ca34.zip
- reset db before test
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.c19
1 files changed, 19 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 85652874c..4ee633598 100644
--- a/src/namestore/test_namestore_api_remove_not_existing_record.c
+++ b/src/namestore/test_namestore_api_remove_not_existing_record.c
@@ -195,10 +195,29 @@ create_record (int count)
195 return rd; 195 return rd;
196} 196}
197 197
198void
199delete_existing_db (const struct GNUNET_CONFIGURATION_Handle *cfg)
200{
201 char *afsdir;
202
203 if (GNUNET_OK ==
204 GNUNET_CONFIGURATION_get_value_filename (cfg, "namestore-sqlite",
205 "FILENAME", &afsdir))
206 {
207 if (GNUNET_OK == GNUNET_DISK_file_test (afsdir))
208 if (GNUNET_OK == GNUNET_DISK_file_test (afsdir))
209 if (GNUNET_OK == GNUNET_DISK_directory_remove(afsdir))
210 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Deleted existing database `%s' \n", afsdir);
211 GNUNET_free (afsdir);
212 }
213
214}
215
198static void 216static void
199run (void *cls, char *const *args, const char *cfgfile, 217run (void *cls, char *const *args, const char *cfgfile,
200 const struct GNUNET_CONFIGURATION_Handle *cfg) 218 const struct GNUNET_CONFIGURATION_Handle *cfg)
201{ 219{
220 delete_existing_db(cfg);
202 endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL); 221 endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL);
203 size_t rd_ser_len; 222 size_t rd_ser_len;
204 223