aboutsummaryrefslogtreecommitdiff
path: root/src/psycstore/test_plugin_psycstore.c
diff options
context:
space:
mode:
authorGabor X Toth <*@tg-x.net>2015-07-18 00:03:06 +0000
committerGabor X Toth <*@tg-x.net>2015-07-18 00:03:06 +0000
commitd38544730123a1f365ef287a7e88060d97b266b7 (patch)
treee66f5ee143adde1a5206f50bbbdd00a8a179fb81 /src/psycstore/test_plugin_psycstore.c
parent2275976cf61565bde4f17e8c2c0bc0d359541ac4 (diff)
downloadgnunet-d38544730123a1f365ef287a7e88060d97b266b7.tar.gz
gnunet-d38544730123a1f365ef287a7e88060d97b266b7.zip
psyc/store: apply state modifiers
Diffstat (limited to 'src/psycstore/test_plugin_psycstore.c')
-rw-r--r--src/psycstore/test_plugin_psycstore.c41
1 files changed, 23 insertions, 18 deletions
diff --git a/src/psycstore/test_plugin_psycstore.c b/src/psycstore/test_plugin_psycstore.c
index 9e4def7ea..0a7824929 100644
--- a/src/psycstore/test_plugin_psycstore.c
+++ b/src/psycstore/test_plugin_psycstore.c
@@ -85,7 +85,7 @@ load_plugin (const struct GNUNET_CONFIGURATION_Handle *cfg)
85 struct GNUNET_PSYCSTORE_PluginFunctions *ret; 85 struct GNUNET_PSYCSTORE_PluginFunctions *ret;
86 char *libname; 86 char *libname;
87 87
88 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Loading `%s' psycstore plugin\n"), 88 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _ ("Loading `%s' psycstore plugin\n"),
89 plugin_name); 89 plugin_name);
90 GNUNET_asprintf (&libname, "libgnunet_plugin_psycstore_%s", plugin_name); 90 GNUNET_asprintf (&libname, "libgnunet_plugin_psycstore_%s", plugin_name);
91 if (NULL == (ret = GNUNET_PLUGIN_load (libname, (void*) cfg))) 91 if (NULL == (ret = GNUNET_PLUGIN_load (libname, (void*) cfg)))
@@ -306,15 +306,17 @@ run (void *cls, char *const *args, const char *cfgfile,
306 306
307 message_id = GNUNET_ntohll (fcls.msg[0]->message_id) + 1; 307 message_id = GNUNET_ntohll (fcls.msg[0]->message_id) + 1;
308 GNUNET_assert (GNUNET_OK == db->state_modify_begin (db->cls, &channel_pub_key, 308 GNUNET_assert (GNUNET_OK == db->state_modify_begin (db->cls, &channel_pub_key,
309 message_id, 1)); 309 message_id, 0));
310 310
311 GNUNET_assert (GNUNET_OK == db->state_modify_set (db->cls, &channel_pub_key, 311 GNUNET_assert (GNUNET_OK == db->state_modify_op (db->cls, &channel_pub_key,
312 "_foo", 312 GNUNET_ENV_OP_ASSIGN,
313 C2ARG("one two three"))); 313 "_foo",
314 C2ARG("one two three")));
314 315
315 GNUNET_assert (GNUNET_OK == db->state_modify_set (db->cls, &channel_pub_key, 316 GNUNET_assert (GNUNET_OK == db->state_modify_op (db->cls, &channel_pub_key,
316 "_foo_bar", slave_key, 317 GNUNET_ENV_OP_ASSIGN,
317 sizeof (*slave_key))); 318 "_foo_bar", slave_key,
319 sizeof (*slave_key)));
318 320
319 GNUNET_assert (GNUNET_OK == db->state_modify_end (db->cls, &channel_pub_key, 321 GNUNET_assert (GNUNET_OK == db->state_modify_end (db->cls, &channel_pub_key,
320 message_id)); 322 message_id));
@@ -366,15 +368,16 @@ run (void *cls, char *const *args, const char *cfgfile,
366 368
367 GNUNET_assert (GNUNET_OK == db->state_sync_begin (db->cls, &channel_pub_key)); 369 GNUNET_assert (GNUNET_OK == db->state_sync_begin (db->cls, &channel_pub_key));
368 370
369 GNUNET_assert (GNUNET_OK == db->state_sync_set (db->cls, &channel_pub_key, 371 GNUNET_assert (GNUNET_OK == db->state_sync_assign (db->cls, &channel_pub_key,
370 "_sync_bar", scls.value[0], 372 "_sync_bar", scls.value[0],
371 scls.value_size[0])); 373 scls.value_size[0]));
372 374
373 GNUNET_assert (GNUNET_OK == db->state_sync_set (db->cls, &channel_pub_key, 375 GNUNET_assert (GNUNET_OK == db->state_sync_assign (db->cls, &channel_pub_key,
374 "_sync_foo", scls.value[1], 376 "_sync_foo", scls.value[1],
375 scls.value_size[1])); 377 scls.value_size[1]));
376 378
377 GNUNET_assert (GNUNET_OK == db->state_sync_end (db->cls, &channel_pub_key, 379 GNUNET_assert (GNUNET_OK == db->state_sync_end (db->cls, &channel_pub_key,
380 max_state_msg_id,
378 INT64_MAX - 5)); 381 INT64_MAX - 5));
379 382
380 GNUNET_assert (GNUNET_NO == db->state_get_prefix (db->cls, &channel_pub_key, 383 GNUNET_assert (GNUNET_NO == db->state_get_prefix (db->cls, &channel_pub_key,
@@ -394,11 +397,13 @@ run (void *cls, char *const *args, const char *cfgfile,
394 397
395 message_id = GNUNET_ntohll (fcls.msg[0]->message_id) + 6; 398 message_id = GNUNET_ntohll (fcls.msg[0]->message_id) + 6;
396 GNUNET_assert (GNUNET_OK == db->state_modify_begin (db->cls, &channel_pub_key, 399 GNUNET_assert (GNUNET_OK == db->state_modify_begin (db->cls, &channel_pub_key,
397 message_id, 3)); 400 message_id,
401 message_id - max_state_msg_id));
398 402
399 GNUNET_assert (GNUNET_OK == db->state_modify_set (db->cls, &channel_pub_key, 403 GNUNET_assert (GNUNET_OK == db->state_modify_op (db->cls, &channel_pub_key,
400 "_sync_foo", 404 GNUNET_ENV_OP_ASSIGN,
401 C2ARG("five six seven"))); 405 "_sync_foo",
406 C2ARG("five six seven")));
402 407
403 GNUNET_assert (GNUNET_OK == db->state_modify_end (db->cls, &channel_pub_key, 408 GNUNET_assert (GNUNET_OK == db->state_modify_end (db->cls, &channel_pub_key,
404 message_id)); 409 message_id));