diff options
Diffstat (limited to 'src/peerstore/test_peerstore_api_sync.c')
-rw-r--r-- | src/peerstore/test_peerstore_api_sync.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/peerstore/test_peerstore_api_sync.c b/src/peerstore/test_peerstore_api_sync.c index ad113a778..765ae9113 100644 --- a/src/peerstore/test_peerstore_api_sync.c +++ b/src/peerstore/test_peerstore_api_sync.c | |||
@@ -80,7 +80,7 @@ static const char *val = "test_peerstore_api_store_val"; | |||
80 | * @return #GNUNET_YES (all good, continue) | 80 | * @return #GNUNET_YES (all good, continue) |
81 | */ | 81 | */ |
82 | static int | 82 | static int |
83 | iterate_cb (void *cls, | 83 | iterate_cb (void *cls, |
84 | const struct GNUNET_PEERSTORE_Record *record, | 84 | const struct GNUNET_PEERSTORE_Record *record, |
85 | const char *emsg) | 85 | const char *emsg) |
86 | { | 86 | { |
@@ -89,7 +89,7 @@ iterate_cb (void *cls, | |||
89 | GNUNET_break (NULL == emsg); | 89 | GNUNET_break (NULL == emsg); |
90 | if (NULL == record) | 90 | if (NULL == record) |
91 | { | 91 | { |
92 | GNUNET_PEERSTORE_disconnect (h, | 92 | GNUNET_PEERSTORE_disconnect (h, |
93 | GNUNET_NO); | 93 | GNUNET_NO); |
94 | GNUNET_SCHEDULER_shutdown (); | 94 | GNUNET_SCHEDULER_shutdown (); |
95 | return GNUNET_YES; | 95 | return GNUNET_YES; |
@@ -106,17 +106,15 @@ iterate_cb (void *cls, | |||
106 | * data that should have been stored. | 106 | * data that should have been stored. |
107 | * | 107 | * |
108 | * @param cls NULL | 108 | * @param cls NULL |
109 | * @param tc unused | ||
110 | */ | 109 | */ |
111 | static void | 110 | static void |
112 | test_cont (void *cls, | 111 | test_cont (void *cls) |
113 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
114 | { | 112 | { |
115 | h = GNUNET_PEERSTORE_connect (cfg); | 113 | h = GNUNET_PEERSTORE_connect (cfg); |
116 | GNUNET_PEERSTORE_iterate (h, | 114 | GNUNET_PEERSTORE_iterate (h, |
117 | subsystem, | 115 | subsystem, |
118 | &pid, key, | 116 | &pid, key, |
119 | GNUNET_TIME_UNIT_FOREVER_REL, | 117 | GNUNET_TIME_UNIT_FOREVER_REL, |
120 | &iterate_cb, NULL); | 118 | &iterate_cb, NULL); |
121 | } | 119 | } |
122 | 120 | ||
@@ -128,15 +126,15 @@ static void | |||
128 | test1 () | 126 | test1 () |
129 | { | 127 | { |
130 | h = GNUNET_PEERSTORE_connect (cfg); | 128 | h = GNUNET_PEERSTORE_connect (cfg); |
131 | GNUNET_PEERSTORE_store (h, | 129 | GNUNET_PEERSTORE_store (h, |
132 | subsystem, | 130 | subsystem, |
133 | &pid, | 131 | &pid, |
134 | key, | 132 | key, |
135 | val, strlen (val) + 1, | 133 | val, strlen (val) + 1, |
136 | GNUNET_TIME_UNIT_FOREVER_ABS, | 134 | GNUNET_TIME_UNIT_FOREVER_ABS, |
137 | GNUNET_PEERSTORE_STOREOPTION_REPLACE, | 135 | GNUNET_PEERSTORE_STOREOPTION_REPLACE, |
138 | NULL, NULL); | 136 | NULL, NULL); |
139 | GNUNET_PEERSTORE_disconnect (h, | 137 | GNUNET_PEERSTORE_disconnect (h, |
140 | GNUNET_YES); | 138 | GNUNET_YES); |
141 | h = NULL; | 139 | h = NULL; |
142 | /* We need to wait a little bit to give the disconnect | 140 | /* We need to wait a little bit to give the disconnect |
@@ -158,7 +156,7 @@ test1 () | |||
158 | * @param peer handle to our peer (unused) | 156 | * @param peer handle to our peer (unused) |
159 | */ | 157 | */ |
160 | static void | 158 | static void |
161 | run (void *cls, | 159 | run (void *cls, |
162 | const struct GNUNET_CONFIGURATION_Handle *c, | 160 | const struct GNUNET_CONFIGURATION_Handle *c, |
163 | struct GNUNET_TESTING_Peer *peer) | 161 | struct GNUNET_TESTING_Peer *peer) |
164 | { | 162 | { |
@@ -173,7 +171,7 @@ int | |||
173 | main (int argc, char *argv[]) | 171 | main (int argc, char *argv[]) |
174 | { | 172 | { |
175 | if (0 != | 173 | if (0 != |
176 | GNUNET_TESTING_service_run ("test-gnunet-peerstore-sync", | 174 | GNUNET_TESTING_service_run ("test-gnunet-peerstore-sync", |
177 | "peerstore", | 175 | "peerstore", |
178 | "test_peerstore_api_data.conf", | 176 | "test_peerstore_api_data.conf", |
179 | &run, NULL)) | 177 | &run, NULL)) |