|
8 | 8 | #include "../toxcore/TCP_server.h" |
9 | 9 | #include "../toxcore/crypto_core.h" |
10 | 10 | #include "../toxcore/mono_time.h" |
| 11 | +#include "../toxcore/os_random.h" |
| 12 | +#include "../toxcore/os_network.h" |
| 13 | +#include "../toxcore/os_memory.h" |
11 | 14 | #include "../toxcore/util.h" |
12 | 15 | #include "auto_test_support.h" |
13 | 16 |
|
@@ -45,14 +48,14 @@ static uint16_t ports[NUM_PORTS] = {13215, 33445, 25643}; |
45 | 48 |
|
46 | 49 | static void test_basic(void) |
47 | 50 | { |
48 | | - const Random *rng = system_random(); |
| 51 | + const Random *rng = os_random(); |
49 | 52 | ck_assert(rng != nullptr); |
50 | | - const Network *ns = system_network(); |
| 53 | + const Network *ns = os_network(); |
51 | 54 | ck_assert(ns != nullptr); |
52 | | - const Memory *mem = system_memory(); |
| 55 | + const Memory *mem = os_memory(); |
53 | 56 | ck_assert(mem != nullptr); |
54 | 57 |
|
55 | | - Mono_Time *mono_time = mono_time_new(mem, nullptr, nullptr); |
| 58 | + Mono_Time *mono_time = mono_time_new(mem, nullptr); |
56 | 59 | Logger *logger = logger_new(); |
57 | 60 | logger_callback_log(logger, print_debug_logger, nullptr, nullptr); |
58 | 61 |
|
@@ -303,14 +306,14 @@ static int read_packet_sec_TCP(const Logger *logger, struct sec_TCP_con *con, ui |
303 | 306 |
|
304 | 307 | static void test_some(void) |
305 | 308 | { |
306 | | - const Random *rng = system_random(); |
| 309 | + const Random *rng = os_random(); |
307 | 310 | ck_assert(rng != nullptr); |
308 | | - const Network *ns = system_network(); |
| 311 | + const Network *ns = os_network(); |
309 | 312 | ck_assert(ns != nullptr); |
310 | | - const Memory *mem = system_memory(); |
| 313 | + const Memory *mem = os_memory(); |
311 | 314 | ck_assert(mem != nullptr); |
312 | 315 |
|
313 | | - Mono_Time *mono_time = mono_time_new(mem, nullptr, nullptr); |
| 316 | + Mono_Time *mono_time = mono_time_new(mem, nullptr); |
314 | 317 | Logger *logger = logger_new(); |
315 | 318 |
|
316 | 319 | uint8_t self_public_key[CRYPTO_PUBLIC_KEY_SIZE]; |
@@ -498,15 +501,15 @@ static int oob_data_callback(void *object, const uint8_t *public_key, const uint |
498 | 501 |
|
499 | 502 | static void test_client(void) |
500 | 503 | { |
501 | | - const Random *rng = system_random(); |
| 504 | + const Random *rng = os_random(); |
502 | 505 | ck_assert(rng != nullptr); |
503 | | - const Network *ns = system_network(); |
| 506 | + const Network *ns = os_network(); |
504 | 507 | ck_assert(ns != nullptr); |
505 | | - const Memory *mem = system_memory(); |
| 508 | + const Memory *mem = os_memory(); |
506 | 509 | ck_assert(mem != nullptr); |
507 | 510 |
|
508 | 511 | Logger *logger = logger_new(); |
509 | | - Mono_Time *mono_time = mono_time_new(mem, nullptr, nullptr); |
| 512 | + Mono_Time *mono_time = mono_time_new(mem, nullptr); |
510 | 513 |
|
511 | 514 | uint8_t self_public_key[CRYPTO_PUBLIC_KEY_SIZE]; |
512 | 515 | uint8_t self_secret_key[CRYPTO_SECRET_KEY_SIZE]; |
@@ -632,14 +635,14 @@ static void test_client(void) |
632 | 635 | // Test how the client handles servers that don't respond. |
633 | 636 | static void test_client_invalid(void) |
634 | 637 | { |
635 | | - const Random *rng = system_random(); |
| 638 | + const Random *rng = os_random(); |
636 | 639 | ck_assert(rng != nullptr); |
637 | | - const Network *ns = system_network(); |
| 640 | + const Network *ns = os_network(); |
638 | 641 | ck_assert(ns != nullptr); |
639 | | - const Memory *mem = system_memory(); |
| 642 | + const Memory *mem = os_memory(); |
640 | 643 | ck_assert(mem != nullptr); |
641 | 644 |
|
642 | | - Mono_Time *mono_time = mono_time_new(mem, nullptr, nullptr); |
| 645 | + Mono_Time *mono_time = mono_time_new(mem, nullptr); |
643 | 646 | Logger *logger = logger_new(); |
644 | 647 |
|
645 | 648 | uint8_t self_public_key[CRYPTO_PUBLIC_KEY_SIZE]; |
@@ -711,14 +714,14 @@ static int tcp_data_callback(void *object, int id, const uint8_t *data, uint16_t |
711 | 714 |
|
712 | 715 | static void test_tcp_connection(void) |
713 | 716 | { |
714 | | - const Random *rng = system_random(); |
| 717 | + const Random *rng = os_random(); |
715 | 718 | ck_assert(rng != nullptr); |
716 | | - const Network *ns = system_network(); |
| 719 | + const Network *ns = os_network(); |
717 | 720 | ck_assert(ns != nullptr); |
718 | | - const Memory *mem = system_memory(); |
| 721 | + const Memory *mem = os_memory(); |
719 | 722 | ck_assert(mem != nullptr); |
720 | 723 |
|
721 | | - Mono_Time *mono_time = mono_time_new(mem, nullptr, nullptr); |
| 724 | + Mono_Time *mono_time = mono_time_new(mem, nullptr); |
722 | 725 | Logger *logger = logger_new(); |
723 | 726 |
|
724 | 727 | tcp_data_callback_called = 0; |
@@ -824,14 +827,14 @@ static int tcp_oobdata_callback(void *object, const uint8_t *public_key, unsigne |
824 | 827 |
|
825 | 828 | static void test_tcp_connection2(void) |
826 | 829 | { |
827 | | - const Random *rng = system_random(); |
| 830 | + const Random *rng = os_random(); |
828 | 831 | ck_assert(rng != nullptr); |
829 | | - const Network *ns = system_network(); |
| 832 | + const Network *ns = os_network(); |
830 | 833 | ck_assert(ns != nullptr); |
831 | | - const Memory *mem = system_memory(); |
| 834 | + const Memory *mem = os_memory(); |
832 | 835 | ck_assert(mem != nullptr); |
833 | 836 |
|
834 | | - Mono_Time *mono_time = mono_time_new(mem, nullptr, nullptr); |
| 837 | + Mono_Time *mono_time = mono_time_new(mem, nullptr); |
835 | 838 | Logger *logger = logger_new(); |
836 | 839 |
|
837 | 840 | tcp_oobdata_callback_called = 0; |
|
0 commit comments