From a6a510bb5d2f182d26ed5e1597a98a3ae195fb5c Mon Sep 17 00:00:00 2001 From: "Nathan S. Evans" Date: Tue, 8 Feb 2011 11:10:50 +0000 Subject: [PATCH] test case changes required due to testing api change --- src/dht/gnunet-dht-driver.c | 2 +- src/dht/test_dht_multipeer.c | 20 +++++++++++++++++--- src/dht/test_dht_twopeer.c | 13 +++++++++++-- src/dht/test_dht_twopeer_path_tracking.c | 21 ++++++++++++++++++--- src/dht/test_dht_twopeer_put_get.c | 20 +++++++++++++++++--- 5 files changed, 64 insertions(+), 12 deletions(-) diff --git a/src/dht/gnunet-dht-driver.c b/src/dht/gnunet-dht-driver.c index af8812d48..772b96d6e 100644 --- a/src/dht/gnunet-dht-driver.c +++ b/src/dht/gnunet-dht-driver.c @@ -77,7 +77,7 @@ #define DEFAULT_MAX_OUTSTANDING_PUTS 10 -#define DEFAULT_MAX_OUTSTANDING_FIND_PEERS 128 +#define DEFAULT_MAX_OUTSTANDING_FIND_PEERS 64 #define DEFAULT_FIND_PEER_OFFSET GNUNET_TIME_relative_divide (DEFAULT_FIND_PEER_DELAY, DEFAULT_MAX_OUTSTANDING_FIND_PEERS) diff --git a/src/dht/test_dht_multipeer.c b/src/dht/test_dht_multipeer.c index e4d1a7d20..626c1bc30 100644 --- a/src/dht/test_dht_multipeer.c +++ b/src/dht/test_dht_multipeer.c @@ -682,7 +682,13 @@ peers_started_callback (void *cls, expected_connections = -1; if ((pg != NULL) && (peers_left == 0)) { - expected_connections = GNUNET_TESTING_connect_topology (pg, connection_topology, connect_topology_option, connect_topology_option_modifier, NULL, NULL); + expected_connections = GNUNET_TESTING_connect_topology (pg, + connection_topology, + connect_topology_option, + connect_topology_option_modifier, + TIMEOUT, + num_peers, + NULL, NULL); #if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Have %d expected connections\n", expected_connections); @@ -870,8 +876,16 @@ run (void *cls, &end_badly, "didn't generate all hostkeys within a reasonable amount of time!!!"); pg = GNUNET_TESTING_daemons_start (cfg, - peers_left, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, SECONDS_PER_PEER_START * num_peers), &hostkey_callback, NULL, &peers_started_callback, NULL, - &topology_callback, NULL, NULL); + peers_left, + peers_left, + GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, SECONDS_PER_PEER_START * num_peers), + &hostkey_callback, + NULL, + &peers_started_callback, + NULL, + &topology_callback, + NULL, + NULL); } diff --git a/src/dht/test_dht_twopeer.c b/src/dht/test_dht_twopeer.c index aab3a1231..e85c6101b 100644 --- a/src/dht/test_dht_twopeer.c +++ b/src/dht/test_dht_twopeer.c @@ -318,7 +318,11 @@ connect_topology (void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc) { expected_connections = -1; if ((pg != NULL) && (peers_left == 0)) - expected_connections = GNUNET_TESTING_connect_topology (pg, GNUNET_TESTING_TOPOLOGY_CLIQUE, GNUNET_TESTING_TOPOLOGY_OPTION_ALL, 0.0, NULL, NULL); + expected_connections = GNUNET_TESTING_connect_topology (pg, + GNUNET_TESTING_TOPOLOGY_CLIQUE, + GNUNET_TESTING_TOPOLOGY_OPTION_ALL, + 0.0, + TIMEOUT, 12, NULL, NULL); GNUNET_SCHEDULER_cancel (die_task); if (expected_connections == GNUNET_SYSERR) @@ -409,7 +413,12 @@ run (void *cls, &end_badly, "didn't start all daemons in reasonable amount of time!!!"); pg = GNUNET_TESTING_daemons_start (cfg, - num_peers, TIMEOUT, NULL, NULL, &peers_started_callback, NULL, + num_peers, + 10, + TIMEOUT, + NULL, NULL, + &peers_started_callback, + NULL, &topology_callback, NULL, NULL); } diff --git a/src/dht/test_dht_twopeer_path_tracking.c b/src/dht/test_dht_twopeer_path_tracking.c index ab4bc81e0..f8ce26da6 100644 --- a/src/dht/test_dht_twopeer_path_tracking.c +++ b/src/dht/test_dht_twopeer_path_tracking.c @@ -410,7 +410,14 @@ peers_started_callback (void *cls, if ((pg != NULL)) /* Sanity check */ { /* Connect peers in a "straight line" topology, return the number of expected connections */ - expected_connections = GNUNET_TESTING_connect_topology (pg, GNUNET_TESTING_TOPOLOGY_LINE, GNUNET_TESTING_TOPOLOGY_OPTION_ALL, 0.0, NULL, NULL); + expected_connections = GNUNET_TESTING_connect_topology (pg, + GNUNET_TESTING_TOPOLOGY_LINE, + GNUNET_TESTING_TOPOLOGY_OPTION_ALL, + 0.0, + TIMEOUT, + 2, + NULL, + NULL); } /* Cancel current timeout fail task */ @@ -454,8 +461,16 @@ run (void *cls, /* Start num_peers peers, call peers_started_callback on peer start, topology_callback on peer connect */ /* Read the API documentation for other parameters! */ pg = GNUNET_TESTING_daemons_start (cfg, - num_peers, TIMEOUT, NULL, NULL, &peers_started_callback, NULL, - &topology_callback, NULL, NULL); + num_peers, + num_peers, + TIMEOUT, + NULL, + NULL, + &peers_started_callback, + NULL, + &topology_callback, + NULL, + NULL); } diff --git a/src/dht/test_dht_twopeer_put_get.c b/src/dht/test_dht_twopeer_put_get.c index 2427edef9..187b99479 100644 --- a/src/dht/test_dht_twopeer_put_get.c +++ b/src/dht/test_dht_twopeer_put_get.c @@ -488,7 +488,13 @@ peers_started_callback (void *cls, if ((pg != NULL)) /* Sanity check */ { /* Connect peers in a "straight line" topology, return the number of expected connections */ - expected_connections = GNUNET_TESTING_connect_topology (pg, GNUNET_TESTING_TOPOLOGY_LINE, GNUNET_TESTING_TOPOLOGY_OPTION_ALL, 0.0, NULL, NULL); + expected_connections = GNUNET_TESTING_connect_topology (pg, + GNUNET_TESTING_TOPOLOGY_LINE, + GNUNET_TESTING_TOPOLOGY_OPTION_ALL, + 0.0, + TIMEOUT, + 12, + NULL, NULL); } /* Cancel current timeout fail task */ @@ -532,8 +538,16 @@ run (void *cls, /* Start num_peers peers, call peers_started_callback on peer start, topology_callback on peer connect */ /* Read the API documentation for other parameters! */ pg = GNUNET_TESTING_daemons_start (cfg, - num_peers, TIMEOUT, NULL, NULL, &peers_started_callback, NULL, - &topology_callback, NULL, NULL); + num_peers, + 2, + TIMEOUT, + NULL, + NULL, + &peers_started_callback, + NULL, + &topology_callback, + NULL, + NULL); } -- 2.25.1