mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
10d59d610b
- Use one node list and public bootstrap function for all autotests - Use ifdefs for testnet/mainnet nodes - Replace a few broken nodes with working ones
42 lines
954 B
C
42 lines
954 B
C
#include <stdio.h>
|
|
|
|
#include "../testing/misc_tools.h"
|
|
#include "check_compat.h"
|
|
|
|
typedef struct State {
|
|
uint32_t index;
|
|
uint64_t clock;
|
|
} State;
|
|
|
|
#include "run_auto_test.h"
|
|
|
|
int main(void)
|
|
{
|
|
setvbuf(stdout, nullptr, _IONBF, 0);
|
|
|
|
Tox *tox_udp = tox_new_log(nullptr, nullptr, nullptr);
|
|
|
|
bootstrap_toxes_live_network(&tox_udp, 1, false);
|
|
|
|
printf("Waiting for connection");
|
|
|
|
do {
|
|
printf(".");
|
|
fflush(stdout);
|
|
|
|
tox_iterate(tox_udp, nullptr);
|
|
c_sleep(ITERATION_INTERVAL);
|
|
} while (tox_self_get_connection_status(tox_udp) == TOX_CONNECTION_NONE);
|
|
|
|
const Tox_Connection status = tox_self_get_connection_status(tox_udp);
|
|
ck_assert_msg(status == TOX_CONNECTION_UDP,
|
|
"expected connection status to be UDP, but got %d", status);
|
|
printf("Connection (UDP): %d\n", tox_self_get_connection_status(tox_udp));
|
|
|
|
tox_kill(tox_udp);
|
|
|
|
(void)run_auto_test;
|
|
|
|
return 0;
|
|
}
|