diff options
-rw-r--r-- | src/mesh/test_mesh_path_api.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/mesh/test_mesh_path_api.c b/src/mesh/test_mesh_path_api.c index 177250901..6817abacc 100644 --- a/src/mesh/test_mesh_path_api.c +++ b/src/mesh/test_mesh_path_api.c | |||
@@ -142,6 +142,7 @@ main (int argc, char *argv[]) | |||
142 | if (GNUNET_PEER_search(path_get_first_hop(tree, 4)) != 2) | 142 | if (GNUNET_PEER_search(path_get_first_hop(tree, 4)) != 2) |
143 | { | 143 | { |
144 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Wrong first hop!\n"); | 144 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Wrong first hop!\n"); |
145 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "4 GOT: %u\n", GNUNET_PEER_search(path_get_first_hop(tree, 4))); | ||
145 | failed++; | 146 | failed++; |
146 | } | 147 | } |
147 | 148 | ||
@@ -161,9 +162,10 @@ main (int argc, char *argv[]) | |||
161 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Retrieved peer wrong nchildren!\n"); | 162 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Retrieved peer wrong nchildren!\n"); |
162 | failed++; | 163 | failed++; |
163 | } | 164 | } |
164 | if (GNUNET_PEER_search(path_get_first_hop(tree, 3)) != 2) | 165 | if (GNUNET_PEER_search(path_get_first_hop(tree, 4)) != 2) |
165 | { | 166 | { |
166 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Wrong first hop!\n"); | 167 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Wrong first hop!\n"); |
168 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "4 GOT: %u\n", GNUNET_PEER_search(path_get_first_hop(tree, 4))); | ||
167 | failed++; | 169 | failed++; |
168 | } | 170 | } |
169 | 171 | ||
@@ -198,6 +200,7 @@ main (int argc, char *argv[]) | |||
198 | if (node->status != MESH_PEER_SEARCHING) | 200 | if (node->status != MESH_PEER_SEARCHING) |
199 | { | 201 | { |
200 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Retrieved peer wrong status!\n"); | 202 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Retrieved peer wrong status!\n"); |
203 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, " expected SEARCHING, got %u\n", node->status); | ||
201 | failed++; | 204 | failed++; |
202 | } | 205 | } |
203 | if (node->children_head != node->children_tail) | 206 | if (node->children_head != node->children_tail) |
@@ -227,6 +230,7 @@ main (int argc, char *argv[]) | |||
227 | if (node->status != MESH_PEER_RELAY) | 230 | if (node->status != MESH_PEER_RELAY) |
228 | { | 231 | { |
229 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Retrieved peer wrong status!\n"); | 232 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Retrieved peer wrong status!\n"); |
233 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, " expected RELAY\n"); | ||
230 | failed++; | 234 | failed++; |
231 | } | 235 | } |
232 | if (node->children_head != node->children_tail) | 236 | if (node->children_head != node->children_tail) |
@@ -330,9 +334,9 @@ main (int argc, char *argv[]) | |||
330 | 334 | ||
331 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "test: Adding new shorter first path...\n"); | 335 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "test: Adding new shorter first path...\n"); |
332 | path->length = 2; | 336 | path->length = 2; |
333 | path->peers[1] = 3; | 337 | path->peers[1] = 4; |
334 | cb_call = 1; | 338 | cb_call = 1; |
335 | tree_find_peer(tree->root, 3)->status = MESH_PEER_READY; | 339 | tree_find_peer(tree->root, 4)->status = MESH_PEER_READY; |
336 | tree_add_path(tree, path, cb); | 340 | tree_add_path(tree, path, cb); |
337 | tree_debug(tree); | 341 | tree_debug(tree); |
338 | if (cb_call != 0) | 342 | if (cb_call != 0) |
@@ -340,8 +344,8 @@ main (int argc, char *argv[]) | |||
340 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "%u callbacks missed!\n", cb_call); | 344 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "%u callbacks missed!\n", cb_call); |
341 | failed++; | 345 | failed++; |
342 | } | 346 | } |
343 | node = tree_find_peer(tree->root, 2); | 347 | node = tree_find_peer(tree->root, 3); |
344 | if (node->peer != 2) | 348 | if (node->peer != 3) |
345 | { | 349 | { |
346 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Retrieved peer != original\n"); | 350 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Retrieved peer != original\n"); |
347 | failed++; | 351 | failed++; |
@@ -356,8 +360,8 @@ main (int argc, char *argv[]) | |||
356 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Retrieved peer wrong nchildren!\n"); | 360 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Retrieved peer wrong nchildren!\n"); |
357 | failed++; | 361 | failed++; |
358 | } | 362 | } |
359 | node = tree_find_peer(tree->root, 3); | 363 | node = tree_find_peer(tree->root, 4); |
360 | if (node->peer != 3) | 364 | if (node->peer != 4) |
361 | { | 365 | { |
362 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Retrieved peer != original\n"); | 366 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Retrieved peer != original\n"); |
363 | failed++; | 367 | failed++; |
@@ -372,12 +376,12 @@ main (int argc, char *argv[]) | |||
372 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Retrieved peer wrong nchildren!\n"); | 376 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Retrieved peer wrong nchildren!\n"); |
373 | failed++; | 377 | failed++; |
374 | } | 378 | } |
375 | if (GNUNET_PEER_search(path_get_first_hop(tree, 2)) != 1) | 379 | if (GNUNET_PEER_search(path_get_first_hop(tree, 3)) != 1) |
376 | { | 380 | { |
377 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Wrong first hop!\n"); | 381 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Wrong first hop!\n"); |
378 | failed++; | 382 | failed++; |
379 | } | 383 | } |
380 | if (GNUNET_PEER_search(path_get_first_hop(tree, 3)) != 3) | 384 | if (GNUNET_PEER_search(path_get_first_hop(tree, 4)) != 4) |
381 | { | 385 | { |
382 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Wrong first hop!\n"); | 386 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Wrong first hop!\n"); |
383 | failed++; | 387 | failed++; |