summaryrefslogtreecommitdiff
path: root/src/namestore/test_namestore_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/namestore/test_namestore_api.c')
-rw-r--r--src/namestore/test_namestore_api.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/src/namestore/test_namestore_api.c b/src/namestore/test_namestore_api.c
index 55601390a..9e56e569d 100644
--- a/src/namestore/test_namestore_api.c
+++ b/src/namestore/test_namestore_api.c
@@ -27,11 +27,14 @@
27#include "gnunet_testing_lib-new.h" 27#include "gnunet_testing_lib-new.h"
28 28
29#define TEST_RECORD_TYPE 1234 29#define TEST_RECORD_TYPE 1234
30
30#define TEST_RECORD_DATALEN 123 31#define TEST_RECORD_DATALEN 123
32
31#define TEST_RECORD_DATA 'a' 33#define TEST_RECORD_DATA 'a'
32 34
33#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10) 35#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10)
34 36
37
35static struct GNUNET_NAMESTORE_Handle *nsh; 38static struct GNUNET_NAMESTORE_Handle *nsh;
36 39
37static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; 40static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
@@ -118,24 +121,6 @@ put_cont (void *cls, int32_t success, const char *emsg)
118 121
119 122
120static void 123static void
121delete_existing_db (const struct GNUNET_CONFIGURATION_Handle *cfg)
122{
123 char *afsdir;
124
125 if (GNUNET_OK ==
126 GNUNET_CONFIGURATION_get_value_filename (cfg, "namestore-sqlite",
127 "FILENAME", &afsdir))
128 {
129 if (GNUNET_OK == GNUNET_DISK_file_test (afsdir))
130 if (GNUNET_OK == GNUNET_DISK_file_test (afsdir))
131 if (GNUNET_OK == GNUNET_DISK_directory_remove(afsdir))
132 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Deleted existing database `%s' \n", afsdir);
133 GNUNET_free (afsdir);
134 }
135}
136
137
138static void
139run (void *cls, 124run (void *cls,
140 const struct GNUNET_CONFIGURATION_Handle *cfg) 125 const struct GNUNET_CONFIGURATION_Handle *cfg)
141{ 126{
@@ -144,7 +129,6 @@ run (void *cls,
144 char *hostkey_file; 129 char *hostkey_file;
145 const char * name = "dummy.dummy.gnunet"; 130 const char * name = "dummy.dummy.gnunet";
146 131
147 delete_existing_db(cfg);
148 endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL); 132 endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL);
149 133
150 GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, 134 GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR,