diff options
author | Gabor X Toth <*@tg-x.net> | 2015-05-07 12:15:58 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2015-05-07 12:15:58 +0000 |
commit | 4725d59b468f1f30ba2910992333ca157682ce29 (patch) | |
tree | 23715ee20879c94a3363e28ea184370a4a71e44d /src/psycstore/test_psycstore.c | |
parent | a5edf8ac9f03a368c87ea6163994d4ac3d62af06 (diff) | |
download | gnunet-4725d59b468f1f30ba2910992333ca157682ce29.tar.gz gnunet-4725d59b468f1f30ba2910992333ca157682ce29.zip |
psyc/social: request history & state from psycstore; more documentation, tests, cleanup
Diffstat (limited to 'src/psycstore/test_psycstore.c')
-rw-r--r-- | src/psycstore/test_psycstore.c | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/src/psycstore/test_psycstore.c b/src/psycstore/test_psycstore.c index 5b1b8a335..021c457b9 100644 --- a/src/psycstore/test_psycstore.c +++ b/src/psycstore/test_psycstore.c | |||
@@ -154,7 +154,8 @@ end () | |||
154 | 154 | ||
155 | 155 | ||
156 | void | 156 | void |
157 | state_reset_result (void *cls, int64_t result, const char *err_msg) | 157 | state_reset_result (void *cls, int64_t result, |
158 | const char *err_msg, uint16_t err_msg_size) | ||
158 | { | 159 | { |
159 | op = NULL; | 160 | op = NULL; |
160 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "state_reset_result:\t%d\n", result); | 161 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "state_reset_result:\t%d\n", result); |
@@ -195,7 +196,8 @@ state_result (void *cls, const char *name, const void *value, size_t value_size) | |||
195 | 196 | ||
196 | 197 | ||
197 | void | 198 | void |
198 | state_get_prefix_result (void *cls, int64_t result, const char *err_msg) | 199 | state_get_prefix_result (void *cls, int64_t result, |
200 | const char *err_msg, uint16_t err_msg_size) | ||
199 | { | 201 | { |
200 | struct StateClosure *scls = cls; | 202 | struct StateClosure *scls = cls; |
201 | op = NULL; | 203 | op = NULL; |
@@ -208,7 +210,8 @@ state_get_prefix_result (void *cls, int64_t result, const char *err_msg) | |||
208 | 210 | ||
209 | 211 | ||
210 | void | 212 | void |
211 | state_get_result (void *cls, int64_t result, const char *err_msg) | 213 | state_get_result (void *cls, int64_t result, |
214 | const char *err_msg, uint16_t err_msg_size) | ||
212 | { | 215 | { |
213 | op = NULL; | 216 | op = NULL; |
214 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "state_get_result:\t%d\n", result); | 217 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "state_get_result:\t%d\n", result); |
@@ -260,7 +263,8 @@ counters_result (void *cls, int status, uint64_t max_fragment_id, | |||
260 | 263 | ||
261 | 264 | ||
262 | void | 265 | void |
263 | state_modify_result (void *cls, int64_t result, const char *err_msg) | 266 | state_modify_result (void *cls, int64_t result, |
267 | const char *err_msg, uint16_t err_msg_size) | ||
264 | { | 268 | { |
265 | op = NULL; | 269 | op = NULL; |
266 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "state_modify_result:\t%d\n", result); | 270 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "state_modify_result:\t%d\n", result); |
@@ -272,7 +276,8 @@ state_modify_result (void *cls, int64_t result, const char *err_msg) | |||
272 | 276 | ||
273 | 277 | ||
274 | void | 278 | void |
275 | state_sync_result (void *cls, int64_t result, const char *err_msg) | 279 | state_sync_result (void *cls, int64_t result, |
280 | const char *err_msg, uint16_t err_msg_size) | ||
276 | { | 281 | { |
277 | struct FragmentClosure *fcls = cls; | 282 | struct FragmentClosure *fcls = cls; |
278 | op = NULL; | 283 | op = NULL; |
@@ -328,7 +333,8 @@ fragment_result (void *cls, | |||
328 | 333 | ||
329 | 334 | ||
330 | void | 335 | void |
331 | message_get_latest_result (void *cls, int64_t result, const char *err_msg) | 336 | message_get_latest_result (void *cls, int64_t result, |
337 | const char *err_msg, uint16_t err_msg_size) | ||
332 | { | 338 | { |
333 | struct FragmentClosure *fcls = cls; | 339 | struct FragmentClosure *fcls = cls; |
334 | op = NULL; | 340 | op = NULL; |
@@ -355,7 +361,8 @@ message_get_latest_result (void *cls, int64_t result, const char *err_msg) | |||
355 | 361 | ||
356 | 362 | ||
357 | void | 363 | void |
358 | message_get_result (void *cls, int64_t result, const char *err_msg) | 364 | message_get_result (void *cls, int64_t result, |
365 | const char *err_msg, uint16_t err_msg_size) | ||
359 | { | 366 | { |
360 | struct FragmentClosure *fcls = cls; | 367 | struct FragmentClosure *fcls = cls; |
361 | op = NULL; | 368 | op = NULL; |
@@ -365,13 +372,14 @@ message_get_result (void *cls, int64_t result, const char *err_msg) | |||
365 | fcls->n = 0; | 372 | fcls->n = 0; |
366 | fcls->n_expected = 3; | 373 | fcls->n_expected = 3; |
367 | op = GNUNET_PSYCSTORE_message_get_latest (h, &channel_pub_key, &slave_pub_key, | 374 | op = GNUNET_PSYCSTORE_message_get_latest (h, &channel_pub_key, &slave_pub_key, |
368 | 1, &fragment_result, | 375 | 1, "", &fragment_result, |
369 | &message_get_latest_result, fcls); | 376 | &message_get_latest_result, fcls); |
370 | } | 377 | } |
371 | 378 | ||
372 | 379 | ||
373 | void | 380 | void |
374 | message_get_fragment_result (void *cls, int64_t result, const char *err_msg) | 381 | message_get_fragment_result (void *cls, int64_t result, |
382 | const char *err_msg, uint16_t err_msg_size) | ||
375 | { | 383 | { |
376 | struct FragmentClosure *fcls = cls; | 384 | struct FragmentClosure *fcls = cls; |
377 | op = NULL; | 385 | op = NULL; |
@@ -382,14 +390,15 @@ message_get_fragment_result (void *cls, int64_t result, const char *err_msg) | |||
382 | fcls->n_expected = 3; | 390 | fcls->n_expected = 3; |
383 | uint64_t message_id = GNUNET_ntohll (fcls->msg[0]->message_id); | 391 | uint64_t message_id = GNUNET_ntohll (fcls->msg[0]->message_id); |
384 | op = GNUNET_PSYCSTORE_message_get (h, &channel_pub_key, &slave_pub_key, | 392 | op = GNUNET_PSYCSTORE_message_get (h, &channel_pub_key, &slave_pub_key, |
385 | message_id, message_id, | 393 | message_id, message_id, "", |
386 | &fragment_result, | 394 | &fragment_result, |
387 | &message_get_result, fcls); | 395 | &message_get_result, fcls); |
388 | } | 396 | } |
389 | 397 | ||
390 | 398 | ||
391 | void | 399 | void |
392 | fragment_get_latest_result (void *cls, int64_t result, const char *err_msg) | 400 | fragment_get_latest_result (void *cls, int64_t result, |
401 | const char *err_msg, uint16_t err_msg_size) | ||
393 | { | 402 | { |
394 | struct FragmentClosure *fcls = cls; | 403 | struct FragmentClosure *fcls = cls; |
395 | op = NULL; | 404 | op = NULL; |
@@ -407,7 +416,8 @@ fragment_get_latest_result (void *cls, int64_t result, const char *err_msg) | |||
407 | 416 | ||
408 | 417 | ||
409 | void | 418 | void |
410 | fragment_get_result (void *cls, int64_t result, const char *err_msg) | 419 | fragment_get_result (void *cls, int64_t result, |
420 | const char *err_msg, uint16_t err_msg_size) | ||
411 | { | 421 | { |
412 | struct FragmentClosure *fcls = cls; | 422 | struct FragmentClosure *fcls = cls; |
413 | op = NULL; | 423 | op = NULL; |
@@ -424,7 +434,8 @@ fragment_get_result (void *cls, int64_t result, const char *err_msg) | |||
424 | 434 | ||
425 | 435 | ||
426 | void | 436 | void |
427 | fragment_store_result (void *cls, int64_t result, const char *err_msg) | 437 | fragment_store_result (void *cls, int64_t result, |
438 | const char *err_msg, uint16_t err_msg_size) | ||
428 | { | 439 | { |
429 | op = NULL; | 440 | op = NULL; |
430 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "fragment_store:\t%d\n", result); | 441 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "fragment_store:\t%d\n", result); |
@@ -495,7 +506,8 @@ fragment_store () | |||
495 | 506 | ||
496 | 507 | ||
497 | void | 508 | void |
498 | membership_test_result (void *cls, int64_t result, const char *err_msg) | 509 | membership_test_result (void *cls, int64_t result, |
510 | const char *err_msg, uint16_t err_msg_size) | ||
499 | { | 511 | { |
500 | op = NULL; | 512 | op = NULL; |
501 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "membership_test:\t%d\n", result); | 513 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "membership_test:\t%d\n", result); |
@@ -506,7 +518,8 @@ membership_test_result (void *cls, int64_t result, const char *err_msg) | |||
506 | 518 | ||
507 | 519 | ||
508 | void | 520 | void |
509 | membership_store_result (void *cls, int64_t result, const char *err_msg) | 521 | membership_store_result (void *cls, int64_t result, |
522 | const char *err_msg, uint16_t err_msg_size) | ||
510 | { | 523 | { |
511 | op = NULL; | 524 | op = NULL; |
512 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "membership_store:\t%d\n", result); | 525 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "membership_store:\t%d\n", result); |
@@ -517,6 +530,7 @@ membership_store_result (void *cls, int64_t result, const char *err_msg) | |||
517 | &membership_test_result, NULL); | 530 | &membership_test_result, NULL); |
518 | } | 531 | } |
519 | 532 | ||
533 | |||
520 | /** | 534 | /** |
521 | * Main function of the test, run from scheduler. | 535 | * Main function of the test, run from scheduler. |
522 | * | 536 | * |