aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/test_plugin_datastore.c
diff options
context:
space:
mode:
authorDavid Barksdale <amatus@amat.us>2017-04-16 12:39:43 -0500
committerDavid Barksdale <amatus@amat.us>2017-04-16 12:42:34 -0500
commit4907330f51ffd48af1f7bac6f43c7c7f78c37818 (patch)
treea2cd65dbb24ea5caeda1fff2521f935dd7ea6256 /src/datastore/test_plugin_datastore.c
parentcacd64d8635201459e59bf2cd8a2ea8fd0699b84 (diff)
downloadgnunet-4907330f51ffd48af1f7bac6f43c7c7f78c37818.tar.gz
gnunet-4907330f51ffd48af1f7bac6f43c7c7f78c37818.zip
[datastore] Combine put and update plugin APIs
This resolves issue #4965.
Diffstat (limited to 'src/datastore/test_plugin_datastore.c')
-rw-r--r--src/datastore/test_plugin_datastore.c36
1 files changed, 9 insertions, 27 deletions
diff --git a/src/datastore/test_plugin_datastore.c b/src/datastore/test_plugin_datastore.c
index 1867d6755..0c34a5f66 100644
--- a/src/datastore/test_plugin_datastore.c
+++ b/src/datastore/test_plugin_datastore.c
@@ -49,7 +49,6 @@ enum RunPhase
49 RP_ERROR = 0, 49 RP_ERROR = 0,
50 RP_PUT, 50 RP_PUT,
51 RP_GET, 51 RP_GET,
52 RP_UPDATE,
53 RP_ITER_ZERO, 52 RP_ITER_ZERO,
54 RP_REPL_GET, 53 RP_REPL_GET,
55 RP_EXPI_GET, 54 RP_EXPI_GET,
@@ -168,8 +167,13 @@ do_put (struct CpsRunContext *crc)
168 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 167 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
169 "putting type %u, anon %u under key %s\n", i + 1, i, 168 "putting type %u, anon %u under key %s\n", i + 1, i,
170 GNUNET_h2s (&key)); 169 GNUNET_h2s (&key));
171 crc->api->put (crc->api->cls, &key, size, value, i + 1 /* type */ , 170 crc->api->put (crc->api->cls,
172 prio, i /* anonymity */ , 171 &key,
172 false /* absent */,
173 size,
174 value, i + 1 /* type */ ,
175 prio,
176 i /* anonymity */ ,
173 0 /* replication */ , 177 0 /* replication */ ,
174 GNUNET_TIME_relative_to_absolute 178 GNUNET_TIME_relative_to_absolute
175 (GNUNET_TIME_relative_multiply 179 (GNUNET_TIME_relative_multiply
@@ -177,7 +181,8 @@ do_put (struct CpsRunContext *crc)
177 60 * 60 * 60 * 1000 + 181 60 * 60 * 60 * 1000 +
178 GNUNET_CRYPTO_random_u32 182 GNUNET_CRYPTO_random_u32
179 (GNUNET_CRYPTO_QUALITY_WEAK, 1000))), 183 (GNUNET_CRYPTO_QUALITY_WEAK, 1000))),
180 put_continuation, crc); 184 put_continuation,
185 crc);
181 i++; 186 i++;
182} 187}
183 188
@@ -264,19 +269,6 @@ cleaning_task (void *cls)
264 269
265 270
266static void 271static void
267update_continuation (void *cls,
268 int status,
269 const char *msg)
270{
271 struct CpsRunContext *crc = cls;
272
273 GNUNET_assert (GNUNET_OK == status);
274 crc->phase++;
275 GNUNET_SCHEDULER_add_now (&test, crc);
276}
277
278
279static void
280test (void *cls) 272test (void *cls)
281{ 273{
282 struct CpsRunContext *crc = cls; 274 struct CpsRunContext *crc = cls;
@@ -316,16 +308,6 @@ test (void *cls)
316 &iterate_one_shot, 308 &iterate_one_shot,
317 crc); 309 crc);
318 break; 310 break;
319 case RP_UPDATE:
320 crc->api->update (crc->api->cls,
321 guid,
322 1,
323 1,
324 GNUNET_TIME_UNIT_ZERO_ABS,
325 &update_continuation,
326 crc);
327 break;
328
329 case RP_ITER_ZERO: 311 case RP_ITER_ZERO:
330 if (crc->cnt == 1) 312 if (crc->cnt == 1)
331 { 313 {