diff options
Diffstat (limited to 'src/dht/test_dht_multipeer.c')
-rw-r--r-- | src/dht/test_dht_multipeer.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/dht/test_dht_multipeer.c b/src/dht/test_dht_multipeer.c index 1a4fbaf13..8aba2743d 100644 --- a/src/dht/test_dht_multipeer.c +++ b/src/dht/test_dht_multipeer.c | |||
@@ -220,7 +220,7 @@ shutdown_callback (void *cls, const char *emsg) | |||
220 | { | 220 | { |
221 | if (emsg != NULL) | 221 | if (emsg != NULL) |
222 | { | 222 | { |
223 | fprintf (stderr, "Failed to shutdown testing topology: %s\n", emsg); | 223 | FPRINTF (stderr, "Failed to shutdown testing topology: %s\n", emsg); |
224 | if (ok == 0) | 224 | if (ok == 0) |
225 | ok = 2; | 225 | ok = 2; |
226 | } | 226 | } |
@@ -311,7 +311,7 @@ print_stat (void *cls, const char *subsystem, const char *name, uint64_t value, | |||
311 | struct StatMaster *sm = cls; | 311 | struct StatMaster *sm = cls; |
312 | 312 | ||
313 | stats[sm->value].total += value; | 313 | stats[sm->value].total += value; |
314 | fprintf (stderr, "Peer %2u: %12s/%50s = %12llu\n", sm->daemon, subsystem, | 314 | FPRINTF (stderr, "Peer %2u: %12s/%50s = %12llu\n", sm->daemon, subsystem, |
315 | name, (unsigned long long) value); | 315 | name, (unsigned long long) value); |
316 | return GNUNET_OK; | 316 | return GNUNET_OK; |
317 | } | 317 | } |
@@ -369,7 +369,7 @@ stat_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
369 | i = 0; | 369 | i = 0; |
370 | while (stats[i].name != NULL) | 370 | while (stats[i].name != NULL) |
371 | { | 371 | { |
372 | fprintf (stderr, "Total : %12s/%50s = %12llu\n", stats[i].subsystem, | 372 | FPRINTF (stderr, "Total : %12s/%50s = %12llu\n", stats[i].subsystem, |
373 | stats[i].name, (unsigned long long) stats[i].total); | 373 | stats[i].name, (unsigned long long) stats[i].total); |
374 | i++; | 374 | i++; |
375 | } | 375 | } |
@@ -439,7 +439,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
439 | struct TestGetContext *test_get; | 439 | struct TestGetContext *test_get; |
440 | 440 | ||
441 | die_task = GNUNET_SCHEDULER_NO_TASK; | 441 | die_task = GNUNET_SCHEDULER_NO_TASK; |
442 | fprintf (stderr, "Failing test with error: `%s'!\n", emsg); | 442 | FPRINTF (stderr, "Failing test with error: `%s'!\n", emsg); |
443 | while (NULL != (test_put = all_puts_head)) | 443 | while (NULL != (test_put = all_puts_head)) |
444 | { | 444 | { |
445 | if (test_put->task != GNUNET_SCHEDULER_NO_TASK) | 445 | if (test_put->task != GNUNET_SCHEDULER_NO_TASK) |
@@ -484,7 +484,7 @@ get_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
484 | if (test_get->succeeded != GNUNET_YES) | 484 | if (test_get->succeeded != GNUNET_YES) |
485 | { | 485 | { |
486 | gets_failed++; | 486 | gets_failed++; |
487 | fprintf (stderr, "Get from peer %s for key %s failed!\n", | 487 | FPRINTF (stderr, "Get from peer %s for key %s failed!\n", |
488 | GNUNET_i2s (&test_get->daemon->id), GNUNET_h2s (&search_key)); | 488 | GNUNET_i2s (&test_get->daemon->id), GNUNET_h2s (&search_key)); |
489 | } | 489 | } |
490 | GNUNET_assert (test_get->get_handle != NULL); | 490 | GNUNET_assert (test_get->get_handle != NULL); |
@@ -500,7 +500,7 @@ get_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
500 | if ((gets_failed > 10) && (outstanding_gets == 0)) | 500 | if ((gets_failed > 10) && (outstanding_gets == 0)) |
501 | { | 501 | { |
502 | /* Had more than 10% failures */ | 502 | /* Had more than 10% failures */ |
503 | fprintf (stderr, "%llu gets succeeded, %llu gets failed!\n", gets_completed, | 503 | FPRINTF (stderr, "%llu gets succeeded, %llu gets failed!\n", gets_completed, |
504 | gets_failed); | 504 | gets_failed); |
505 | GNUNET_SCHEDULER_cancel (die_task); | 505 | GNUNET_SCHEDULER_cancel (die_task); |
506 | ok = 1; | 506 | ok = 1; |
@@ -510,7 +510,7 @@ get_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
510 | } | 510 | } |
511 | if ((gets_completed + gets_failed == num_peers * num_peers) && (outstanding_gets == 0)) /* All gets successful */ | 511 | if ((gets_completed + gets_failed == num_peers * num_peers) && (outstanding_gets == 0)) /* All gets successful */ |
512 | { | 512 | { |
513 | fprintf (stderr, "%llu gets succeeded, %llu gets failed!\n", gets_completed, | 513 | FPRINTF (stderr, "%llu gets succeeded, %llu gets failed!\n", gets_completed, |
514 | gets_failed); | 514 | gets_failed); |
515 | GNUNET_SCHEDULER_cancel (die_task); | 515 | GNUNET_SCHEDULER_cancel (die_task); |
516 | ok = 0; | 516 | ok = 0; |
@@ -552,19 +552,19 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, | |||
552 | { | 552 | { |
553 | unsigned int i; | 553 | unsigned int i; |
554 | 554 | ||
555 | fprintf (stderr, "PUT (%u) Path: ", test_get->uid); | 555 | FPRINTF (stderr, "PUT (%u) Path: ", test_get->uid); |
556 | for (i = 0; i < put_path_length; i++) | 556 | for (i = 0; i < put_path_length; i++) |
557 | fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&put_path[i])); | 557 | FPRINTF (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&put_path[i])); |
558 | fprintf (stderr, "\n"); | 558 | FPRINTF (stderr, "%s", "\n"); |
559 | } | 559 | } |
560 | if (get_path != NULL) | 560 | if (get_path != NULL) |
561 | { | 561 | { |
562 | unsigned int i; | 562 | unsigned int i; |
563 | 563 | ||
564 | fprintf (stderr, "GET (%u) Path: ", test_get->uid); | 564 | FPRINTF (stderr, "GET (%u) Path: ", test_get->uid); |
565 | for (i = 0; i < get_path_length; i++) | 565 | for (i = 0; i < get_path_length; i++) |
566 | fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&get_path[i])); | 566 | FPRINTF (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&get_path[i])); |
567 | fprintf (stderr, "%s%s\n", get_path_length > 0 ? "->" : "", | 567 | FPRINTF (stderr, "%s%s\n", get_path_length > 0 ? "->" : "", |
568 | GNUNET_i2s (&test_get->daemon->id)); | 568 | GNUNET_i2s (&test_get->daemon->id)); |
569 | } | 569 | } |
570 | #endif | 570 | #endif |
@@ -572,7 +572,7 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, | |||
572 | if ((0 != memcmp (&search_key, key, sizeof (GNUNET_HashCode))) || | 572 | if ((0 != memcmp (&search_key, key, sizeof (GNUNET_HashCode))) || |
573 | (0 != memcmp (original_data, data, sizeof (original_data)))) | 573 | (0 != memcmp (original_data, data, sizeof (original_data)))) |
574 | { | 574 | { |
575 | fprintf (stderr, "Key or data is not the same as was inserted!\n"); | 575 | FPRINTF (stderr, "%s", "Key or data is not the same as was inserted!\n"); |
576 | return; | 576 | return; |
577 | } | 577 | } |
578 | gets_completed++; | 578 | gets_completed++; |
@@ -639,7 +639,7 @@ start_gets (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
639 | struct TestGetContext *test_get; | 639 | struct TestGetContext *test_get; |
640 | 640 | ||
641 | #if VERBOSE | 641 | #if VERBOSE |
642 | fprintf (stderr, "Issuing %llu GETs\n", | 642 | FPRINTF (stderr, "Issuing %llu GETs\n", |
643 | (unsigned long long) (num_peers * num_peers)); | 643 | (unsigned long long) (num_peers * num_peers)); |
644 | #endif | 644 | #endif |
645 | for (i = 0; i < num_peers; i++) | 645 | for (i = 0; i < num_peers; i++) |
@@ -697,7 +697,7 @@ do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
697 | GNUNET_assert (test_put->dht_handle != NULL); | 697 | GNUNET_assert (test_put->dht_handle != NULL); |
698 | outstanding_puts++; | 698 | outstanding_puts++; |
699 | #if VERBOSE > 2 | 699 | #if VERBOSE > 2 |
700 | fprintf (stderr, "PUT %u at `%s'\n", test_put->uid, | 700 | FPRINTF (stderr, "PUT %u at `%s'\n", test_put->uid, |
701 | GNUNET_i2s (&test_put->daemon->id)); | 701 | GNUNET_i2s (&test_put->daemon->id)); |
702 | #endif | 702 | #endif |
703 | GNUNET_DHT_put (test_put->dht_handle, &key, 1, route_option, | 703 | GNUNET_DHT_put (test_put->dht_handle, &key, 1, route_option, |
@@ -725,7 +725,7 @@ run_dht_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
725 | die_task = | 725 | die_task = |
726 | GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, | 726 | GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, |
727 | "from setup puts/gets"); | 727 | "from setup puts/gets"); |
728 | fprintf (stderr, "Issuing %llu PUTs (one per peer)\n", | 728 | FPRINTF (stderr, "Issuing %llu PUTs (one per peer)\n", |
729 | (unsigned long long) (num_peers * num_peers)); | 729 | (unsigned long long) (num_peers * num_peers)); |
730 | for (i = 0; i < num_peers * num_peers; i++) | 730 | for (i = 0; i < num_peers * num_peers; i++) |
731 | { | 731 | { |
@@ -750,7 +750,7 @@ startup_done (void *cls, const char *emsg) | |||
750 | { | 750 | { |
751 | if (emsg != NULL) | 751 | if (emsg != NULL) |
752 | { | 752 | { |
753 | fprintf (stderr, "Failed to setup topology: %s\n", emsg); | 753 | FPRINTF (stderr, "Failed to setup topology: %s\n", emsg); |
754 | die_task = GNUNET_SCHEDULER_add_now (&end_badly, "topology setup failed"); | 754 | die_task = GNUNET_SCHEDULER_add_now (&end_badly, "topology setup failed"); |
755 | return; | 755 | return; |
756 | } | 756 | } |