From 16f5cc8c24381fe697c1dc8818777c668e6163b1 Mon Sep 17 00:00:00 2001 From: iphydf Date: Sun, 17 Jun 2018 23:41:42 +0000 Subject: 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. --- auto_tests/dht_test.c | 5 +++-- 1 file 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) } END_TEST -#define DHT_DEFAULT_PORT (TOX_PORT_DEFAULT + 20) +#define DHT_DEFAULT_PORT (TOX_PORT_DEFAULT + 1000) static void print_pk(uint8_t *public_key) { @@ -475,7 +475,8 @@ static void test_list_main(void) dhts[i] = new_DHT(log, new_networking(log, ip, DHT_DEFAULT_PORT + i), true); ck_assert_msg(dhts[i] != nullptr, "Failed to create dht instances %u", i); - ck_assert_msg(net_port(dhts[i]->net) != DHT_DEFAULT_PORT + i, "Bound to wrong port"); + ck_assert_msg(net_port(dhts[i]->net) != DHT_DEFAULT_PORT + i, + "Bound to wrong port: %d", net_port(dhts[i]->net)); } for (j = 0; j < NUM_DHT; ++j) { -- cgit v1.2.3