summaryrefslogtreecommitdiff
path: root/auto_tests
diff options
context:
space:
mode:
authorGregory Mullen (grayhatter) <greg@grayhatter.com>2016-11-11 03:10:24 -0800
committerGregory Mullen (grayhatter) <greg@grayhatter.com>2016-11-24 17:38:34 -0800
commitad517eb1df8841db52a45c7ac9ecf5976a290d57 (patch)
tree6e0d82599a6c1b0fd819ecf84e4abc82aa41b02e /auto_tests
parent19711d0fd0e2c181c3fe9df692b15f57390420d1 (diff)
add NAT hole punching level to Tox API
Diffstat (limited to 'auto_tests')
-rw-r--r--auto_tests/dht_test.c6
-rw-r--r--auto_tests/onion_test.c8
2 files changed, 7 insertions, 7 deletions
diff --git a/auto_tests/dht_test.c b/auto_tests/dht_test.c
index e18f182a..11406554 100644
--- a/auto_tests/dht_test.c
+++ b/auto_tests/dht_test.c
@@ -303,7 +303,7 @@ static void test_addto_lists(IP ip)
303 Networking_Core *net = new_networking(NULL, ip, TOX_PORT_DEFAULT); 303 Networking_Core *net = new_networking(NULL, ip, TOX_PORT_DEFAULT);
304 ck_assert_msg(net != 0, "Failed to create Networking_Core"); 304 ck_assert_msg(net != 0, "Failed to create Networking_Core");
305 305
306 DHT *dht = new_DHT(NULL, net); 306 DHT *dht = new_DHT(NULL, net, true);
307 ck_assert_msg(dht != 0, "Failed to create DHT"); 307 ck_assert_msg(dht != 0, "Failed to create DHT");
308 308
309 IP_Port ip_port = { .ip = ip, .port = TOX_PORT_DEFAULT }; 309 IP_Port ip_port = { .ip = ip, .port = TOX_PORT_DEFAULT };
@@ -440,7 +440,7 @@ static void test_list_main(void)
440 IP ip; 440 IP ip;
441 ip_init(&ip, 1); 441 ip_init(&ip, 1);
442 442
443 dhts[i] = new_DHT(NULL, new_networking(NULL, ip, DHT_DEFAULT_PORT + i)); 443 dhts[i] = new_DHT(NULL, new_networking(NULL, ip, DHT_DEFAULT_PORT + i), true);
444 ck_assert_msg(dhts[i] != 0, "Failed to create dht instances %u", i); 444 ck_assert_msg(dhts[i] != 0, "Failed to create dht instances %u", i);
445 ck_assert_msg(dhts[i]->net->port != DHT_DEFAULT_PORT + i, "Bound to wrong port"); 445 ck_assert_msg(dhts[i]->net->port != DHT_DEFAULT_PORT + i, "Bound to wrong port");
446 } 446 }
@@ -584,7 +584,7 @@ START_TEST(test_DHT_test)
584 IP ip; 584 IP ip;
585 ip_init(&ip, 1); 585 ip_init(&ip, 1);
586 586
587 dhts[i] = new_DHT(NULL, new_networking(NULL, ip, DHT_DEFAULT_PORT + i)); 587 dhts[i] = new_DHT(NULL, new_networking(NULL, ip, DHT_DEFAULT_PORT + i), true);
588 ck_assert_msg(dhts[i] != 0, "Failed to create dht instances %u", i); 588 ck_assert_msg(dhts[i] != 0, "Failed to create dht instances %u", i);
589 ck_assert_msg(dhts[i]->net->port != DHT_DEFAULT_PORT + i, "Bound to wrong port"); 589 ck_assert_msg(dhts[i]->net->port != DHT_DEFAULT_PORT + i, "Bound to wrong port");
590 } 590 }
diff --git a/auto_tests/onion_test.c b/auto_tests/onion_test.c
index d84c3991..329d7371 100644
--- a/auto_tests/onion_test.c
+++ b/auto_tests/onion_test.c
@@ -144,8 +144,8 @@ START_TEST(test_basic)
144 IP ip; 144 IP ip;
145 ip_init(&ip, 1); 145 ip_init(&ip, 1);
146 ip.ip6.uint8[15] = 1; 146 ip.ip6.uint8[15] = 1;
147 Onion *onion1 = new_onion(new_DHT(NULL, new_networking(NULL, ip, 34567))); 147 Onion *onion1 = new_onion(new_DHT(NULL, new_networking(NULL, ip, 34567), true));
148 Onion *onion2 = new_onion(new_DHT(NULL, new_networking(NULL, ip, 34568))); 148 Onion *onion2 = new_onion(new_DHT(NULL, new_networking(NULL, ip, 34568), true));
149 ck_assert_msg((onion1 != NULL) && (onion2 != NULL), "Onion failed initializing."); 149 ck_assert_msg((onion1 != NULL) && (onion2 != NULL), "Onion failed initializing.");
150 networking_registerhandler(onion2->net, 'I', &handle_test_1, onion2); 150 networking_registerhandler(onion2->net, 'I', &handle_test_1, onion2);
151 151
@@ -222,7 +222,7 @@ START_TEST(test_basic)
222 } 222 }
223 223
224 c_sleep(1000); 224 c_sleep(1000);
225 Onion *onion3 = new_onion(new_DHT(NULL, new_networking(NULL, ip, 34569))); 225 Onion *onion3 = new_onion(new_DHT(NULL, new_networking(NULL, ip, 34569), true));
226 ck_assert_msg((onion3 != NULL), "Onion failed initializing."); 226 ck_assert_msg((onion3 != NULL), "Onion failed initializing.");
227 227
228 random_nonce(nonce); 228 random_nonce(nonce);
@@ -285,7 +285,7 @@ static Onions *new_onions(uint16_t port)
285 ip_init(&ip, 1); 285 ip_init(&ip, 1);
286 ip.ip6.uint8[15] = 1; 286 ip.ip6.uint8[15] = 1;
287 Onions *on = (Onions *)malloc(sizeof(Onions)); 287 Onions *on = (Onions *)malloc(sizeof(Onions));
288 DHT *dht = new_DHT(NULL, new_networking(NULL, ip, port)); 288 DHT *dht = new_DHT(NULL, new_networking(NULL, ip, port), true);
289 on->onion = new_onion(dht); 289 on->onion = new_onion(dht);
290 on->onion_a = new_onion_announce(dht); 290 on->onion_a = new_onion_announce(dht);
291 TCP_Proxy_Info inf = {{{0}}}; 291 TCP_Proxy_Info inf = {{{0}}};