aboutsummaryrefslogtreecommitdiff
path: root/src/mesh
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-11-29 20:47:18 +0000
committerChristian Grothoff <christian@grothoff.org>2011-11-29 20:47:18 +0000
commit71ea5bd2d05058008e604ffd42993be9c7250e04 (patch)
treea5074671ddfaa9d1621a4182fc95a91a98b3d536 /src/mesh
parentb335777fd435142c16eb05e86c8a64a4b1a45447 (diff)
downloadgnunet-71ea5bd2d05058008e604ffd42993be9c7250e04.tar.gz
gnunet-71ea5bd2d05058008e604ffd42993be9c7250e04.zip
-fixing indentation
Diffstat (limited to 'src/mesh')
-rw-r--r--src/mesh/gnunet-service-mesh.c44
-rw-r--r--src/mesh/mesh_tunnel_tree.c2
-rw-r--r--src/mesh/test_mesh_2dtorus.c58
-rw-r--r--src/mesh/test_mesh_small.c2
-rw-r--r--src/mesh/test_mesh_small_unicast_far.c2
-rw-r--r--src/mesh/test_mesh_tree_api.c39
6 files changed, 58 insertions, 89 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c
index 8883602ab..564640acd 100644
--- a/src/mesh/gnunet-service-mesh.c
+++ b/src/mesh/gnunet-service-mesh.c
@@ -1461,7 +1461,8 @@ peer_info_remove_path (struct MeshPeerInfo *peer, GNUNET_PEER_Id p1,
1461 for (i = 0; i < peer->ntunnels; i++) 1461 for (i = 0; i < peer->ntunnels; i++)
1462 { 1462 {
1463 d = tunnel_notify_connection_broken (peer->tunnels[i], p1, p2); 1463 d = tunnel_notify_connection_broken (peer->tunnels[i], p1, p2);
1464 if (0 == d) continue; 1464 if (0 == d)
1465 continue;
1465 /* TODO 1466 /* TODO
1466 * Problem: one or more peers have been deleted from the tunnel tree. 1467 * Problem: one or more peers have been deleted from the tunnel tree.
1467 * We don't know who they are to try to add them again. 1468 * We don't know who they are to try to add them again.
@@ -1699,7 +1700,7 @@ path_build_from_dht (const struct GNUNET_PeerIdentity *get_path,
1699 1700
1700/** 1701/**
1701 * Adds a path to the peer_infos of all the peers in the path 1702 * Adds a path to the peer_infos of all the peers in the path
1702 * 1703 *
1703 * @param p Path to process. 1704 * @param p Path to process.
1704 * @param confirmed Whether we know if the path works or not. FIXME use 1705 * @param confirmed Whether we know if the path works or not. FIXME use
1705 */ 1706 */
@@ -1709,16 +1710,16 @@ path_add_to_peers (struct MeshPeerPath *p, int confirmed)
1709 unsigned int i; 1710 unsigned int i;
1710 1711
1711 /* TODO: invert and add */ 1712 /* TODO: invert and add */
1712 for (i = 0; i < p->length && p->peers[i] != myid; i++) /* skip'em */; 1713 for (i = 0; i < p->length && p->peers[i] != myid; i++) /* skip'em */ ;
1713 for (i++; i < p->length; i++) 1714 for (i++; i < p->length; i++)
1714 { 1715 {
1715 struct MeshPeerInfo *aux; 1716 struct MeshPeerInfo *aux;
1716 struct MeshPeerPath *copy; 1717 struct MeshPeerPath *copy;
1717 1718
1718 aux = peer_info_get_short(p->peers[i]); 1719 aux = peer_info_get_short (p->peers[i]);
1719 copy = path_duplicate(p); 1720 copy = path_duplicate (p);
1720 copy->length = i + 1; 1721 copy->length = i + 1;
1721 peer_info_add_path(aux, copy, GNUNET_NO); 1722 peer_info_add_path (aux, copy, GNUNET_NO);
1722 } 1723 }
1723} 1724}
1724 1725
@@ -2063,14 +2064,12 @@ tunnel_send_multicast (struct MeshTunnel *t,
2063 mcast = (struct GNUNET_MESH_Multicast *) mdata->data; 2064 mcast = (struct GNUNET_MESH_Multicast *) mdata->data;
2064 mcast->ttl = htonl (ntohl (mcast->ttl) - 1); 2065 mcast->ttl = htonl (ntohl (mcast->ttl) - 1);
2065#if MESH_DEBUG 2066#if MESH_DEBUG
2066 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2067 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: data packet, ttl: %u\n",
2067 "MESH: data packet, ttl: %u\n",
2068 ntohl (mcast->ttl)); 2068 ntohl (mcast->ttl));
2069 } 2069 }
2070 else 2070 else
2071 { 2071 {
2072 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2072 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: not a data packet, no ttl\n");
2073 "MESH: not a data packet, no ttl\n");
2074#endif 2073#endif
2075 } 2074 }
2076 if (NULL != t->client) 2075 if (NULL != t->client)
@@ -2601,7 +2600,7 @@ handle_mesh_path_create (void *cls, const struct GNUNET_PeerIdentity *peer,
2601 /* FIXME error. destroy tunnel? leave for timeout? */ 2600 /* FIXME error. destroy tunnel? leave for timeout? */
2602 return 0; 2601 return 0;
2603 } 2602 }
2604 path_add_to_peers(path, GNUNET_NO); 2603 path_add_to_peers (path, GNUNET_NO);
2605 tunnel_add_path (t, path, own_pos); 2604 tunnel_add_path (t, path, own_pos);
2606 if (own_pos == size - 1) 2605 if (own_pos == size - 1)
2607 { 2606 {
@@ -2938,16 +2937,14 @@ handle_mesh_data_multicast (void *cls, const struct GNUNET_PeerIdentity *peer,
2938 { 2937 {
2939 /* FIXME: already seen this packet, log dropping */ 2938 /* FIXME: already seen this packet, log dropping */
2940 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 2939 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
2941 "MESH: Already seen mid %u, DROPPING!\n", 2940 "MESH: Already seen mid %u, DROPPING!\n", t->mid);
2942 t->mid);
2943 return GNUNET_OK; 2941 return GNUNET_OK;
2944 } 2942 }
2945#if MESH_DEBUG 2943#if MESH_DEBUG
2946 else 2944 else
2947 { 2945 {
2948 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2946 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2949 "MESH: mid %u not seen yet, forwarding\n", 2947 "MESH: mid %u not seen yet, forwarding\n", ntohl (msg->mid));
2950 ntohl (msg->mid));
2951 } 2948 }
2952#endif 2949#endif
2953 t->mid = ntohl (msg->mid); 2950 t->mid = ntohl (msg->mid);
@@ -2960,15 +2957,12 @@ handle_mesh_data_multicast (void *cls, const struct GNUNET_PeerIdentity *peer,
2960 send_subscribed_clients (message, &msg[1].header); 2957 send_subscribed_clients (message, &msg[1].header);
2961 } 2958 }
2962#if MESH_DEBUG 2959#if MESH_DEBUG
2963 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2960 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: ttl: %u\n", ntohl (msg->ttl));
2964 "MESH: ttl: %u\n",
2965 ntohl (msg->ttl));
2966#endif 2961#endif
2967 if (ntohl (msg->ttl) == 0) 2962 if (ntohl (msg->ttl) == 0)
2968 { 2963 {
2969 /* FIXME: ttl is 0, log dropping */ 2964 /* FIXME: ttl is 0, log dropping */
2970 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 2965 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "MESH: TTL is 0, DROPPING!\n");
2971 "MESH: TTL is 0, DROPPING!\n");
2972 return GNUNET_OK; 2966 return GNUNET_OK;
2973 } 2967 }
2974 tunnel_send_multicast (t, message); 2968 tunnel_send_multicast (t, message);
@@ -3097,11 +3091,11 @@ handle_mesh_path_ack (void *cls, const struct GNUNET_PeerIdentity *peer,
3097 peer_info = peer_info_get (&msg->peer_id); 3091 peer_info = peer_info_get (&msg->peer_id);
3098 3092
3099 /* Add paths to peers? */ 3093 /* Add paths to peers? */
3100 p = tree_get_path_to_peer(t->tree, peer_info->id); 3094 p = tree_get_path_to_peer (t->tree, peer_info->id);
3101 if (NULL != p) 3095 if (NULL != p)
3102 { 3096 {
3103 path_add_to_peers (p, GNUNET_YES); 3097 path_add_to_peers (p, GNUNET_YES);
3104 path_destroy(p); 3098 path_destroy (p);
3105 } 3099 }
3106 else 3100 else
3107 { 3101 {
@@ -3122,7 +3116,7 @@ handle_mesh_path_ack (void *cls, const struct GNUNET_PeerIdentity *peer,
3122 GNUNET_DHT_get_stop (t->dht_get_type); 3116 GNUNET_DHT_get_stop (t->dht_get_type);
3123 t->dht_get_type = NULL; 3117 t->dht_get_type = NULL;
3124 } 3118 }
3125 if (tree_get_status(t->tree, peer_info->id) != MESH_PEER_READY) 3119 if (tree_get_status (t->tree, peer_info->id) != MESH_PEER_READY)
3126 { 3120 {
3127 tree_set_status (t->tree, peer_info->id, MESH_PEER_READY); 3121 tree_set_status (t->tree, peer_info->id, MESH_PEER_READY);
3128 send_client_peer_connected (t, peer_info->id); 3122 send_client_peer_connected (t, peer_info->id);
@@ -3308,7 +3302,7 @@ dht_get_id_handler (void *cls, struct GNUNET_TIME_Absolute exp,
3308 3302
3309 p = path_build_from_dht (get_path, get_path_length, put_path, 3303 p = path_build_from_dht (get_path, get_path_length, put_path,
3310 put_path_length); 3304 put_path_length);
3311 path_add_to_peers(p, GNUNET_NO); 3305 path_add_to_peers (p, GNUNET_NO);
3312 for (i = 0; i < path_info->peer->ntunnels; i++) 3306 for (i = 0; i < path_info->peer->ntunnels; i++)
3313 { 3307 {
3314 tunnel_add_peer (path_info->peer->tunnels[i], path_info->peer); 3308 tunnel_add_peer (path_info->peer->tunnels[i], path_info->peer);
@@ -3362,7 +3356,7 @@ dht_get_type_handler (void *cls, struct GNUNET_TIME_Absolute exp,
3362 3356
3363 p = path_build_from_dht (get_path, get_path_length, put_path, 3357 p = path_build_from_dht (get_path, get_path_length, put_path,
3364 put_path_length); 3358 put_path_length);
3365 path_add_to_peers(p, GNUNET_NO); 3359 path_add_to_peers (p, GNUNET_NO);
3366 tunnel_add_peer (t, peer_info); 3360 tunnel_add_peer (t, peer_info);
3367 peer_info_connect (peer_info, t); 3361 peer_info_connect (peer_info, t);
3368} 3362}
diff --git a/src/mesh/mesh_tunnel_tree.c b/src/mesh/mesh_tunnel_tree.c
index 7b04385bc..a7577e36f 100644
--- a/src/mesh/mesh_tunnel_tree.c
+++ b/src/mesh/mesh_tunnel_tree.c
@@ -992,7 +992,7 @@ tree_del_peer (struct MeshTunnelTree *t, GNUNET_PEER_Id peer,
992 * 992 *
993 * @return Number of hops to reach destination, UINT_MAX in case the peer is not 993 * @return Number of hops to reach destination, UINT_MAX in case the peer is not
994 * in the path. 994 * in the path.
995 * 995 *
996 * TODO: adapt to allow any start / root combination 996 * TODO: adapt to allow any start / root combination
997 * TODO: take in account state of the nodes 997 * TODO: take in account state of the nodes
998 */ 998 */
diff --git a/src/mesh/test_mesh_2dtorus.c b/src/mesh/test_mesh_2dtorus.c
index 718ab0864..6d91185cc 100644
--- a/src/mesh/test_mesh_2dtorus.c
+++ b/src/mesh/test_mesh_2dtorus.c
@@ -104,8 +104,7 @@ shutdown_callback (void *cls, const char *emsg)
104 if (emsg != NULL) 104 if (emsg != NULL)
105 { 105 {
106 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 106 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
107 "test: Shutdown of peers failed! (%s)\n", 107 "test: Shutdown of peers failed! (%s)\n", emsg);
108 emsg);
109 ok--; 108 ok--;
110 } 109 }
111#if VERBOSE 110#if VERBOSE
@@ -122,8 +121,7 @@ static void
122shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 121shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
123{ 122{
124#if VERBOSE 123#if VERBOSE
125 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 124 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Ending test.\n");
126 "test: Ending test.\n");
127#endif 125#endif
128 126
129 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); 127 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
@@ -134,8 +132,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
134static void 132static void
135disconnect_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 133disconnect_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
136{ 134{
137 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 135 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: disconnecting peers\n");
138 "test: disconnecting peers\n");
139 136
140 if (GNUNET_SCHEDULER_NO_TASK != shutdown_handle) 137 if (GNUNET_SCHEDULER_NO_TASK != shutdown_handle)
141 { 138 {
@@ -162,33 +159,26 @@ topo_cb (void *cls, const struct GNUNET_PeerIdentity *first,
162 topo_connections++; 159 topo_connections++;
163 if (NULL != emsg) 160 if (NULL != emsg)
164 { 161 {
165 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 162 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "test: Error by topo %u: %s\n",
166 "test: Error by topo %u: %s\n",
167 topo_connections, emsg); 163 topo_connections, emsg);
168 } 164 }
169 else 165 else
170 { 166 {
171 if (first == NULL || second == NULL) 167 if (first == NULL || second == NULL)
172 { 168 {
173 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 169 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Connection %u NULL\n",
174 "test: Connection %u NULL\n",
175 topo_connections); 170 topo_connections);
176 if (disconnect_task != GNUNET_SCHEDULER_NO_TASK) 171 if (disconnect_task != GNUNET_SCHEDULER_NO_TASK)
177 { 172 {
178 GNUNET_SCHEDULER_cancel (disconnect_task); 173 GNUNET_SCHEDULER_cancel (disconnect_task);
179 GNUNET_SCHEDULER_add_now(&disconnect_peers, NULL); 174 GNUNET_SCHEDULER_add_now (&disconnect_peers, NULL);
180 } 175 }
181 return; 176 return;
182 } 177 }
183 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 178 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Connection %u ok\n",
184 "test: Connection %u ok\n",
185 topo_connections); 179 topo_connections);
186 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 180 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: %s\n", GNUNET_i2s (first));
187 "test: %s\n", 181 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: %s\n", GNUNET_i2s (second));
188 GNUNET_i2s (first));
189 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
190 "test: %s\n",
191 GNUNET_i2s (second));
192 } 182 }
193} 183}
194 184
@@ -205,8 +195,8 @@ peergroup_ready (void *cls, const char *emsg)
205 { 195 {
206 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 196 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
207 "test: Peergroup callback called with error, aborting test!\n"); 197 "test: Peergroup callback called with error, aborting test!\n");
208 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 198 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Error from testing: `%s'\n",
209 "test: Error from testing: `%s'\n", emsg); 199 emsg);
210 ok--; 200 ok--;
211 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); 201 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
212 return; 202 return;
@@ -216,8 +206,7 @@ peergroup_ready (void *cls, const char *emsg)
216 "************************************************************\n"); 206 "************************************************************\n");
217 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 207 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
218 "test: Peer Group started successfully!\n"); 208 "test: Peer Group started successfully!\n");
219 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 209 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Have %u connections\n",
220 "test: Have %u connections\n",
221 total_connections); 210 total_connections);
222#endif 211#endif
223 212
@@ -225,8 +214,7 @@ peergroup_ready (void *cls, const char *emsg)
225 if (0 < failed_connections) 214 if (0 < failed_connections)
226 { 215 {
227 ok = GNUNET_SYSERR; 216 ok = GNUNET_SYSERR;
228 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 217 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "test: %u connections have FAILED!\n",
229 "test: %u connections have FAILED!\n",
230 failed_connections); 218 failed_connections);
231 disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_peers, NULL); 219 disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_peers, NULL);
232 220
@@ -272,12 +260,9 @@ connect_cb (void *cls, const struct GNUNET_PeerIdentity *first,
272 { 260 {
273 failed_connections++; 261 failed_connections++;
274 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 262 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
275 "test: Problem with new connection (%s)\n", 263 "test: Problem with new connection (%s)\n", emsg);
276 emsg); 264 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: (%s)\n", GNUNET_i2s (first));
277 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: (%s)\n", 265 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: (%s)\n", GNUNET_i2s (second));
278 GNUNET_i2s (first));
279 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: (%s)\n",
280 GNUNET_i2s (second));
281 } 266 }
282 267
283} 268}
@@ -310,8 +295,7 @@ run (void *cls, char *const *args, const char *cfgfile,
310 NULL); 295 NULL);
311 296
312#if VERBOSE 297#if VERBOSE
313 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 298 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Starting daemons.\n");
314 "test: Starting daemons.\n");
315 GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing", 299 GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing",
316 "use_progressbars", "YES"); 300 "use_progressbars", "YES");
317#endif 301#endif
@@ -369,16 +353,14 @@ main (int argc, char *argv[])
369 353
370 354
371 GNUNET_PROGRAM_run ((sizeof (argv2) / sizeof (char *)) - 1, argv2, 355 GNUNET_PROGRAM_run ((sizeof (argv2) / sizeof (char *)) - 1, argv2,
372 "test_mesh_2dtorus", 356 "test_mesh_2dtorus", gettext_noop ("Test mesh 2d torus."),
373 gettext_noop ("Test mesh 2d torus."), options, 357 options, &run, NULL);
374 &run, NULL);
375#if REMOVE_DIR 358#if REMOVE_DIR
376 GNUNET_DISK_directory_remove ("/tmp/test_mesh_2dtorus"); 359 GNUNET_DISK_directory_remove ("/tmp/test_mesh_2dtorus");
377#endif 360#endif
378 if (GNUNET_OK != ok) 361 if (GNUNET_OK != ok)
379 { 362 {
380 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 363 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "test: FAILED!\n");
381 "test: FAILED!\n");
382 return 1; 364 return 1;
383 } 365 }
384 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: success\n"); 366 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: success\n");
diff --git a/src/mesh/test_mesh_small.c b/src/mesh/test_mesh_small.c
index 5a83994f3..f273b04ab 100644
--- a/src/mesh/test_mesh_small.c
+++ b/src/mesh/test_mesh_small.c
@@ -767,7 +767,7 @@ run (void *cls, char *const *args, const char *cfgfile,
767 767
768 if (GNUNET_OK != 768 if (GNUNET_OK !=
769 GNUNET_CONFIGURATION_get_value_time (testing_cfg, "test_mesh_small", 769 GNUNET_CONFIGURATION_get_value_time (testing_cfg, "test_mesh_small",
770 "WAIT_TIME", &wait_time)) 770 "WAIT_TIME", &wait_time))
771 { 771 {
772 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 772 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
773 "Option test_mesh_small:wait_time is required!\n"); 773 "Option test_mesh_small:wait_time is required!\n");
diff --git a/src/mesh/test_mesh_small_unicast_far.c b/src/mesh/test_mesh_small_unicast_far.c
index 1708e96cd..ed65da2e4 100644
--- a/src/mesh/test_mesh_small_unicast_far.c
+++ b/src/mesh/test_mesh_small_unicast_far.c
@@ -480,7 +480,7 @@ run (void *cls, char *const *args, const char *cfgfile,
480 480
481 if (GNUNET_OK != 481 if (GNUNET_OK !=
482 GNUNET_CONFIGURATION_get_value_time (testing_cfg, "test_mesh_small", 482 GNUNET_CONFIGURATION_get_value_time (testing_cfg, "test_mesh_small",
483 "WAIT_TIME", &wait_time)) 483 "WAIT_TIME", &wait_time))
484 { 484 {
485 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 485 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
486 "Option test_mesh_small:wait_time is required!\n"); 486 "Option test_mesh_small:wait_time is required!\n");
diff --git a/src/mesh/test_mesh_tree_api.c b/src/mesh/test_mesh_tree_api.c
index ec92a5ece..60e31bdde 100644
--- a/src/mesh/test_mesh_tree_api.c
+++ b/src/mesh/test_mesh_tree_api.c
@@ -78,16 +78,15 @@ test_assert (GNUNET_PEER_Id peer_id, enum MeshPeerState status,
78 if (n->peer != peer_id) 78 if (n->peer != peer_id)
79 { 79 {
80 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 80 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
81 "Retrieved peer has wrong ID! (Got %u, expected %u)\n", 81 "Retrieved peer has wrong ID! (Got %u, expected %u)\n", n->peer,
82 n->peer, peer_id); 82 peer_id);
83 failed++; 83 failed++;
84 } 84 }
85 if (n->status != status) 85 if (n->status != status)
86 { 86 {
87 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 87 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
88 "Retrieved peer has wrong status! (Got %u, expected %u)\n", 88 "Retrieved peer has wrong status! (Got %u, expected %u)\n",
89 n->status, 89 n->status, status);
90 status);
91 failed++; 90 failed++;
92 } 91 }
93 for (c = n->children_head, i = 0; NULL != c; c = c->next, i++) ; 92 for (c = n->children_head, i = 0; NULL != c; c = c->next, i++) ;
@@ -101,7 +100,8 @@ test_assert (GNUNET_PEER_Id peer_id, enum MeshPeerState status,
101 if (0 != first_hop && 100 if (0 != first_hop &&
102 GNUNET_PEER_search (tree_get_first_hop (tree, peer_id)) != first_hop) 101 GNUNET_PEER_search (tree_get_first_hop (tree, peer_id)) != first_hop)
103 { 102 {
104 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Wrong first hop! (Got %u, expected %u)\n", 103 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
104 "Wrong first hop! (Got %u, expected %u)\n",
105 GNUNET_PEER_search (tree_get_first_hop (tree, peer_id)), 105 GNUNET_PEER_search (tree_get_first_hop (tree, peer_id)),
106 first_hop); 106 first_hop);
107 failed++; 107 failed++;
@@ -112,8 +112,8 @@ test_assert (GNUNET_PEER_Id peer_id, enum MeshPeerState status,
112 112
113 GNUNET_PEER_resolve (peer_id, &id); 113 GNUNET_PEER_resolve (peer_id, &id);
114 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 114 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
115 "*** Peer %s (%u) has failed %d checks!\n", 115 "*** Peer %s (%u) has failed %d checks!\n", GNUNET_i2s (&id),
116 GNUNET_i2s (&id), peer_id, failed - pre_failed); 116 peer_id, failed - pre_failed);
117 } 117 }
118} 118}
119 119
@@ -219,41 +219,34 @@ main (int argc, char *argv[])
219 for (i = 1; i < 5; i++) 219 for (i = 1; i < 5; i++)
220 { 220 {
221 path->length = i; 221 path->length = i;
222 if (tree_get_path_cost(tree, path) != 0) 222 if (tree_get_path_cost (tree, path) != 0)
223 { 223 {
224 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 224 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "test: length %u cost failed!\n",
225 "test: length %u cost failed!\n",
226 i); 225 i);
227 failed++; 226 failed++;
228 } 227 }
229 } 228 }
230 path->length++; 229 path->length++;
231 path->peers[4] = 6; 230 path->peers[4] = 6;
232 if (tree_get_path_cost(tree, path) != 1) 231 if (tree_get_path_cost (tree, path) != 1)
233 { 232 {
234 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 233 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "test: length %u cost failed!\n", i);
235 "test: length %u cost failed!\n",
236 i);
237 failed++; 234 failed++;
238 } 235 }
239 path->peers[3] = 7; 236 path->peers[3] = 7;
240 if (tree_get_path_cost(tree, path) != 2) 237 if (tree_get_path_cost (tree, path) != 2)
241 { 238 {
242 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 239 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "test: length %u cost failed!\n", i);
243 "test: length %u cost failed!\n",
244 i);
245 failed++; 240 failed++;
246 } 241 }
247 path->length--; 242 path->length--;
248 if (tree_get_path_cost(tree, path) != 1) 243 if (tree_get_path_cost (tree, path) != 1)
249 { 244 {
250 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 245 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "test: length %u cost failed!\n", i);
251 "test: length %u cost failed!\n",
252 i);
253 failed++; 246 failed++;
254 } 247 }
255 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Deleting third path (5)\n"); 248 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Deleting third path (5)\n");
256 tree_set_status(tree, 5, MESH_PEER_READY); 249 tree_set_status (tree, 5, MESH_PEER_READY);
257 cb_call = 1; 250 cb_call = 1;
258 node = tree_del_path (tree, 5, &cb, NULL); 251 node = tree_del_path (tree, 5, &cb, NULL);
259 tree_debug (tree); 252 tree_debug (tree);