aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/testing/test_testing_topology.c3
-rw-r--r--src/testing/testing.c1
-rw-r--r--src/testing/testing_group.c20
3 files changed, 15 insertions, 9 deletions
diff --git a/src/testing/test_testing_topology.c b/src/testing/test_testing_topology.c
index adb5211fe..d1172916e 100644
--- a/src/testing/test_testing_topology.c
+++ b/src/testing/test_testing_topology.c
@@ -302,8 +302,7 @@ static void topology_cb (void *cls,
302 uint32_t distance, 302 uint32_t distance,
303 const char *emsg) 303 const char *emsg)
304{ 304{
305 FILE *outfile; 305 FILE *outfile = cls;
306 outfile = cls;
307 if (first != NULL) 306 if (first != NULL)
308 { 307 {
309 if (outfile != NULL) 308 if (outfile != NULL)
diff --git a/src/testing/testing.c b/src/testing/testing.c
index d5b585a62..cf53c4a2e 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -790,6 +790,7 @@ GNUNET_TESTING_daemon_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
790#endif 790#endif
791 if (NULL == ret->cfgfile) 791 if (NULL == ret->cfgfile)
792 { 792 {
793 GNUNET_free_non_null (ret->ssh_port_str);
793 GNUNET_free_non_null (ret->hostname); 794 GNUNET_free_non_null (ret->hostname);
794 GNUNET_free (ret); 795 GNUNET_free (ret);
795 return NULL; 796 return NULL;
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c
index 8697044e3..d5a43fd37 100644
--- a/src/testing/testing_group.c
+++ b/src/testing/testing_group.c
@@ -2515,9 +2515,6 @@ GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg,
2515 break; 2515 break;
2516 } 2516 }
2517 2517
2518 if (num_connections < 0)
2519 return GNUNET_SYSERR;
2520
2521 if (GNUNET_YES == GNUNET_CONFIGURATION_get_value_yesno (pg->cfg, "TESTING", "F2F")) 2518 if (GNUNET_YES == GNUNET_CONFIGURATION_get_value_yesno (pg->cfg, "TESTING", "F2F"))
2522 { 2519 {
2523 ret = create_and_copy_friend_files(pg); 2520 ret = create_and_copy_friend_files(pg);
@@ -3025,7 +3022,7 @@ add_closest (struct GNUNET_TESTING_PeerGroup *pg, unsigned int num, GNUNET_TESTI
3025 GNUNET_CONTAINER_multihashmap_iterate(pg->peers[pg_iter].allowed_peers, &find_closest_peers, &closest_ctx); 3022 GNUNET_CONTAINER_multihashmap_iterate(pg->peers[pg_iter].allowed_peers, &find_closest_peers, &closest_ctx);
3026 if (closest_ctx.closest != NULL) 3023 if (closest_ctx.closest != NULL)
3027 { 3024 {
3028 GNUNET_assert((0 <= closest_ctx.closest_num) && (closest_ctx.closest_num < pg->total)); 3025 GNUNET_assert(closest_ctx.closest_num < pg->total);
3029 proc(pg, pg_iter, closest_ctx.closest_num); 3026 proc(pg, pg_iter, closest_ctx.closest_num);
3030 } 3027 }
3031 } 3028 }
@@ -3196,7 +3193,13 @@ GNUNET_TESTING_get_topology (struct GNUNET_TESTING_PeerGroup *pg, GNUNET_TESTING
3196 total_count++; 3193 total_count++;
3197 } 3194 }
3198 } 3195 }
3199 topology_context->total = total_count; 3196 if (total_count == 0)
3197 {
3198 cb(cls, NULL, NULL, GNUNET_TIME_relative_get_zero(), 0, "Cannot iterate over topology, no running peers!");
3199 GNUNET_free(topology_context);
3200 }
3201 else
3202 topology_context->total = total_count;
3200 return; 3203 return;
3201} 3204}
3202 3205
@@ -3333,7 +3336,8 @@ stats_check_existing(struct GNUNET_TESTING_PeerGroup *pg, struct PeerData *speci
3333 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string(specific_peer->cfg, "statistics", "unixpath", &unix_domain_socket)) 3336 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string(specific_peer->cfg, "statistics", "unixpath", &unix_domain_socket))
3334 return GNUNET_NO; 3337 return GNUNET_NO;
3335 3338
3336 GNUNET_CONFIGURATION_get_value_number(specific_peer->cfg, "statistics", "port", &port); 3339 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number(specific_peer->cfg, "statistics", "port", &port))
3340 return GNUNET_NO;
3337 3341
3338 if (specific_peer->daemon->hostname != NULL) 3342 if (specific_peer->daemon->hostname != NULL)
3339 GNUNET_asprintf(&to_match, "%s%s%llu", specific_peer->daemon->hostname, unix_domain_socket, port); 3343 GNUNET_asprintf(&to_match, "%s%s%llu", specific_peer->daemon->hostname, unix_domain_socket, port);
@@ -3344,7 +3348,8 @@ stats_check_existing(struct GNUNET_TESTING_PeerGroup *pg, struct PeerData *speci
3344 { 3348 {
3345 if (0 == strcmp(to_match, pos->unique_string)) 3349 if (0 == strcmp(to_match, pos->unique_string))
3346 { 3350 {
3347 GNUNET_free(to_match); 3351 GNUNET_free (unix_domain_socket);
3352 GNUNET_free (to_match);
3348 return GNUNET_YES; 3353 return GNUNET_YES;
3349 } 3354 }
3350 pos = pos->next; 3355 pos = pos->next;
@@ -3353,6 +3358,7 @@ stats_check_existing(struct GNUNET_TESTING_PeerGroup *pg, struct PeerData *speci
3353 pos->unique_string = to_match; 3358 pos->unique_string = to_match;
3354 pos->next = *stats_list; 3359 pos->next = *stats_list;
3355 *stats_list = pos; 3360 *stats_list = pos;
3361 GNUNET_free (unix_domain_socket);
3356 return GNUNET_NO; 3362 return GNUNET_NO;
3357} 3363}
3358 3364