diff options
Diffstat (limited to 'auto_tests/bootstrap_test.c')
-rw-r--r-- | auto_tests/bootstrap_test.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/auto_tests/bootstrap_test.c b/auto_tests/bootstrap_test.c index 488bd48e..12cfabcf 100644 --- a/auto_tests/bootstrap_test.c +++ b/auto_tests/bootstrap_test.c | |||
@@ -13,22 +13,24 @@ static uint8_t const key[] = { | |||
13 | 13 | ||
14 | int main(void) | 14 | int main(void) |
15 | { | 15 | { |
16 | Tox *tox = tox_new_log(nullptr, nullptr, nullptr); | 16 | setvbuf(stdout, nullptr, _IONBF, 0); |
17 | 17 | ||
18 | tox_bootstrap(tox, "node.tox.biribiri.org", 33445, key, nullptr); | 18 | Tox *tox_udp = tox_new_log(nullptr, nullptr, nullptr); |
19 | |||
20 | tox_bootstrap(tox_udp, "node.tox.biribiri.org", 33445, key, nullptr); | ||
19 | 21 | ||
20 | printf("Waiting for connection"); | 22 | printf("Waiting for connection"); |
21 | 23 | ||
22 | while (tox_self_get_connection_status(tox) == TOX_CONNECTION_NONE) { | 24 | while (tox_self_get_connection_status(tox_udp) == TOX_CONNECTION_NONE) { |
23 | printf("."); | 25 | printf("."); |
24 | fflush(stdout); | 26 | fflush(stdout); |
25 | 27 | ||
26 | tox_iterate(tox, nullptr); | 28 | tox_iterate(tox_udp, nullptr); |
27 | c_sleep(1000); | 29 | c_sleep(ITERATION_INTERVAL); |
28 | } | 30 | } |
29 | 31 | ||
30 | printf("Connection: %d\n", tox_self_get_connection_status(tox)); | 32 | printf("Connection (UDP): %d\n", tox_self_get_connection_status(tox_udp)); |
31 | 33 | ||
32 | tox_kill(tox); | 34 | tox_kill(tox_udp); |
33 | return 0; | 35 | return 0; |
34 | } | 36 | } |