if (n->peer != peer_id)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Retrieved peer has wrong ID! (Got %u, expected %u)\n",
- n->peer, peer_id);
+ "Retrieved peer has wrong ID! (Got %u, expected %u)\n", n->peer,
+ peer_id);
failed++;
}
if (n->status != status)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Retrieved peer has wrong status! (Got %u, expected %u)\n",
- n->status,
- status);
+ n->status, status);
failed++;
}
for (c = n->children_head, i = 0; NULL != c; c = c->next, i++) ;
if (0 != first_hop &&
GNUNET_PEER_search (tree_get_first_hop (tree, peer_id)) != first_hop)
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Wrong first hop! (Got %u, expected %u)\n",
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Wrong first hop! (Got %u, expected %u)\n",
GNUNET_PEER_search (tree_get_first_hop (tree, peer_id)),
first_hop);
failed++;
GNUNET_PEER_resolve (peer_id, &id);
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "*** Peer %s (%u) has failed %d checks!\n",
- GNUNET_i2s (&id), peer_id, failed - pre_failed);
+ "*** Peer %s (%u) has failed %d checks!\n", GNUNET_i2s (&id),
+ peer_id, failed - pre_failed);
}
}
}
tree = tree_new (1);
tree->me = tree->root;
- path = path_new (4);
+ path = path_new (5);
path->peers[0] = 1;
path->peers[1] = 2;
path->peers[2] = 3;
tree_add_path (tree, path, &cb, NULL);
tree_debug (tree);
path1 = tree_get_path_to_peer (tree, 4);
- if (path->length != path1->length ||
+ if (NULL == path1 || path->length != path1->length ||
memcmp (path->peers, path1->peers, path->length) != 0)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Retrieved path != original\n");
for (i = 1; i < 5; i++)
{
path->length = i;
- if (tree_get_path_cost(tree, path) != 0)
+ if (tree_get_path_cost (tree, path) != 0)
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "test: length %u cost failed!\n",
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "test: length %u cost failed!\n",
i);
failed++;
}
}
path->length++;
path->peers[4] = 6;
- if (tree_get_path_cost(tree, path) != 1)
+ if (tree_get_path_cost (tree, path) != 1)
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "test: length %u cost failed!\n",
- i);
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "test: length %u cost failed!\n", i);
failed++;
}
path->peers[3] = 7;
- if (tree_get_path_cost(tree, path) != 2)
+ if (tree_get_path_cost (tree, path) != 2)
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "test: length %u cost failed!\n",
- i);
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "test: length %u cost failed!\n", i);
failed++;
}
path->length--;
- if (tree_get_path_cost(tree, path) != 1)
+ if (tree_get_path_cost (tree, path) != 1)
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "test: length %u cost failed!\n",
- i);
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "test: length %u cost failed!\n", i);
failed++;
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Deleting third path (5)\n");
- tree_set_status(tree, 5, MESH_PEER_READY);
+ tree_set_status (tree, 5, MESH_PEER_READY);
cb_call = 1;
node = tree_del_path (tree, 5, &cb, NULL);
tree_debug (tree);