From f387e75c669b0963e7865fdda5958791bac34363 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Mon, 24 Oct 2011 14:29:53 +0000 Subject: [PATCH] Changed testcase to not die on unknown peer, log warning instead --- src/mesh/test_mesh_small.c | 11 +++++++++-- 1 file 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 do_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "***************** test: test_task\n"); - GNUNET_MESH_peer_request_connect_add(t, &d2->id); if (test == MULTICAST) { GNUNET_MESH_peer_request_connect_add(t, &d3->id); } + GNUNET_MESH_peer_request_connect_add(t, &d2->id); if (GNUNET_SCHEDULER_NO_TASK != disconnect_task) { GNUNET_SCHEDULER_cancel (disconnect_task); @@ -519,7 +519,14 @@ topo_cb (void *cls, { p2 = GNUNET_PEER_search(second); GNUNET_assert(p2 < num_peers); - GNUNET_assert(p2 > 0); + if (p2 == 0) + { + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + "***************** test: %s is UNKNOWN!?\n", + GNUNET_i2s(second)); + GNUNET_break (0); + return; + } mesh_peers[p2]++; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "***************** test: %s IS a neighbor\n", -- 2.25.1