diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-06-17 23:41:42 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-06-17 23:41:42 +0000 |
commit | 16f5cc8c24381fe697c1dc8818777c668e6163b1 (patch) | |
tree | 22c93edf8fc1547ec6607929dc377c62aee7591e /auto_tests/dht_test.c | |
parent | a725d7323514db49b3e5dd626445ef2760e51d43 (diff) |
Make dht_test more stable.
By making it run in a port range far away from other tests. This test
creates 100 DHTs and makes either itself or other tests run out of ports.
Diffstat (limited to 'auto_tests/dht_test.c')
-rw-r--r-- | auto_tests/dht_test.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/auto_tests/dht_test.c b/auto_tests/dht_test.c index 17f4563b..df9529c0 100644 --- a/auto_tests/dht_test.c +++ b/auto_tests/dht_test.c | |||
@@ -411,7 +411,7 @@ START_TEST(test_addto_lists_ipv6) | |||
411 | } | 411 | } |
412 | END_TEST | 412 | END_TEST |
413 | 413 | ||
414 | #define DHT_DEFAULT_PORT (TOX_PORT_DEFAULT + 20) | 414 | #define DHT_DEFAULT_PORT (TOX_PORT_DEFAULT + 1000) |
415 | 415 | ||
416 | static void print_pk(uint8_t *public_key) | 416 | static void print_pk(uint8_t *public_key) |
417 | { | 417 | { |
@@ -475,7 +475,8 @@ static void test_list_main(void) | |||
475 | 475 | ||
476 | dhts[i] = new_DHT(log, new_networking(log, ip, DHT_DEFAULT_PORT + i), true); | 476 | dhts[i] = new_DHT(log, new_networking(log, ip, DHT_DEFAULT_PORT + i), true); |
477 | ck_assert_msg(dhts[i] != nullptr, "Failed to create dht instances %u", i); | 477 | ck_assert_msg(dhts[i] != nullptr, "Failed to create dht instances %u", i); |
478 | ck_assert_msg(net_port(dhts[i]->net) != DHT_DEFAULT_PORT + i, "Bound to wrong port"); | 478 | ck_assert_msg(net_port(dhts[i]->net) != DHT_DEFAULT_PORT + i, |
479 | "Bound to wrong port: %d", net_port(dhts[i]->net)); | ||
479 | } | 480 | } |
480 | 481 | ||
481 | for (j = 0; j < NUM_DHT; ++j) { | 482 | for (j = 0; j < NUM_DHT; ++j) { |