diff options
author | Bart Polot <bart@net.in.tum.de> | 2011-10-24 14:29:53 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2011-10-24 14:29:53 +0000 |
commit | f387e75c669b0963e7865fdda5958791bac34363 (patch) | |
tree | af9bb216ac90fb4f1cd90d527356b3e5b67650e7 /src/mesh | |
parent | fbc27c5aaa6a05ddc547b1a5607519644019cc2d (diff) | |
download | gnunet-f387e75c669b0963e7865fdda5958791bac34363.tar.gz gnunet-f387e75c669b0963e7865fdda5958791bac34363.zip |
Changed testcase to not die on unknown peer, log warning instead
Diffstat (limited to 'src/mesh')
-rw-r--r-- | src/mesh/test_mesh_small.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mesh/test_mesh_small.c b/src/mesh/test_mesh_small.c index 0888c1e00..e77ddcf15 100644 --- a/src/mesh/test_mesh_small.c +++ b/src/mesh/test_mesh_small.c | |||
@@ -477,11 +477,11 @@ static void | |||
477 | do_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 477 | do_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
478 | { | 478 | { |
479 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "***************** test: test_task\n"); | 479 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "***************** test: test_task\n"); |
480 | GNUNET_MESH_peer_request_connect_add(t, &d2->id); | ||
481 | if (test == MULTICAST) | 480 | if (test == MULTICAST) |
482 | { | 481 | { |
483 | GNUNET_MESH_peer_request_connect_add(t, &d3->id); | 482 | GNUNET_MESH_peer_request_connect_add(t, &d3->id); |
484 | } | 483 | } |
484 | GNUNET_MESH_peer_request_connect_add(t, &d2->id); | ||
485 | if (GNUNET_SCHEDULER_NO_TASK != disconnect_task) | 485 | if (GNUNET_SCHEDULER_NO_TASK != disconnect_task) |
486 | { | 486 | { |
487 | GNUNET_SCHEDULER_cancel (disconnect_task); | 487 | GNUNET_SCHEDULER_cancel (disconnect_task); |
@@ -519,7 +519,14 @@ topo_cb (void *cls, | |||
519 | { | 519 | { |
520 | p2 = GNUNET_PEER_search(second); | 520 | p2 = GNUNET_PEER_search(second); |
521 | GNUNET_assert(p2 < num_peers); | 521 | GNUNET_assert(p2 < num_peers); |
522 | GNUNET_assert(p2 > 0); | 522 | if (p2 == 0) |
523 | { | ||
524 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
525 | "***************** test: %s is UNKNOWN!?\n", | ||
526 | GNUNET_i2s(second)); | ||
527 | GNUNET_break (0); | ||
528 | return; | ||
529 | } | ||
523 | mesh_peers[p2]++; | 530 | mesh_peers[p2]++; |
524 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 531 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
525 | "***************** test: %s IS a neighbor\n", | 532 | "***************** test: %s IS a neighbor\n", |