Skip to content

Commit 959219b

Browse files
iphydfzoff99
authored andcommitted
refactor: Rename system_{memory,...} to os_{memory,...}.
This rename happens in the system PR, so I'm pulling it out to reduce the size of that PR.
1 parent 4f4220a commit 959219b

35 files changed

+98
-94
lines changed

auto_tests/TCP_test.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ static uint16_t ports[NUM_PORTS] = {13215, 33445, 25643};
4545

4646
static void test_basic(void)
4747
{
48-
const Random *rng = system_random();
48+
const Random *rng = os_random();
4949
ck_assert(rng != nullptr);
50-
const Network *ns = system_network();
50+
const Network *ns = os_network();
5151
ck_assert(ns != nullptr);
52-
const Memory *mem = system_memory();
52+
const Memory *mem = os_memory();
5353
ck_assert(mem != nullptr);
5454

5555
Mono_Time *mono_time = mono_time_new(mem, nullptr, nullptr);
@@ -304,11 +304,11 @@ static int read_packet_sec_tcp(const Logger *logger, struct sec_TCP_con *con, ui
304304

305305
static void test_some(void)
306306
{
307-
const Random *rng = system_random();
307+
const Random *rng = os_random();
308308
ck_assert(rng != nullptr);
309-
const Network *ns = system_network();
309+
const Network *ns = os_network();
310310
ck_assert(ns != nullptr);
311-
const Memory *mem = system_memory();
311+
const Memory *mem = os_memory();
312312
ck_assert(mem != nullptr);
313313

314314
Mono_Time *mono_time = mono_time_new(mem, nullptr, nullptr);
@@ -499,11 +499,11 @@ static int oob_data_callback(void *object, const uint8_t *public_key, const uint
499499

500500
static void test_client(void)
501501
{
502-
const Random *rng = system_random();
502+
const Random *rng = os_random();
503503
ck_assert(rng != nullptr);
504-
const Network *ns = system_network();
504+
const Network *ns = os_network();
505505
ck_assert(ns != nullptr);
506-
const Memory *mem = system_memory();
506+
const Memory *mem = os_memory();
507507
ck_assert(mem != nullptr);
508508

509509
Logger *logger = logger_new();
@@ -633,11 +633,11 @@ static void test_client(void)
633633
// Test how the client handles servers that don't respond.
634634
static void test_client_invalid(void)
635635
{
636-
const Random *rng = system_random();
636+
const Random *rng = os_random();
637637
ck_assert(rng != nullptr);
638-
const Network *ns = system_network();
638+
const Network *ns = os_network();
639639
ck_assert(ns != nullptr);
640-
const Memory *mem = system_memory();
640+
const Memory *mem = os_memory();
641641
ck_assert(mem != nullptr);
642642

643643
Mono_Time *mono_time = mono_time_new(mem, nullptr, nullptr);
@@ -712,11 +712,11 @@ static int tcp_data_callback(void *object, int id, const uint8_t *data, uint16_t
712712

713713
static void test_tcp_connection(void)
714714
{
715-
const Random *rng = system_random();
715+
const Random *rng = os_random();
716716
ck_assert(rng != nullptr);
717-
const Network *ns = system_network();
717+
const Network *ns = os_network();
718718
ck_assert(ns != nullptr);
719-
const Memory *mem = system_memory();
719+
const Memory *mem = os_memory();
720720
ck_assert(mem != nullptr);
721721

722722
Mono_Time *mono_time = mono_time_new(mem, nullptr, nullptr);
@@ -825,11 +825,11 @@ static int tcp_oobdata_callback(void *object, const uint8_t *public_key, unsigne
825825

826826
static void test_tcp_connection2(void)
827827
{
828-
const Random *rng = system_random();
828+
const Random *rng = os_random();
829829
ck_assert(rng != nullptr);
830-
const Network *ns = system_network();
830+
const Network *ns = os_network();
831831
ck_assert(ns != nullptr);
832-
const Memory *mem = system_memory();
832+
const Memory *mem = os_memory();
833833
ck_assert(mem != nullptr);
834834

835835
Mono_Time *mono_time = mono_time_new(mem, nullptr, nullptr);

auto_tests/announce_test.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
static void test_bucketnum(void)
1515
{
16-
const Random *rng = system_random();
16+
const Random *rng = os_random();
1717
ck_assert(rng != nullptr);
1818
uint8_t key1[CRYPTO_PUBLIC_KEY_SIZE], key2[CRYPTO_PUBLIC_KEY_SIZE];
1919
random_bytes(rng, key1, sizeof(key1));
@@ -50,11 +50,11 @@ static void test_announce_data(void *object, const uint8_t *data, uint16_t lengt
5050

5151
static void test_store_data(void)
5252
{
53-
const Random *rng = system_random();
53+
const Random *rng = os_random();
5454
ck_assert(rng != nullptr);
55-
const Network *ns = system_network();
55+
const Network *ns = os_network();
5656
ck_assert(ns != nullptr);
57-
const Memory *mem = system_memory();
57+
const Memory *mem = os_memory();
5858
ck_assert(mem != nullptr);
5959

6060
Logger *log = logger_new();

auto_tests/conference_av_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ static void do_audio(AutoTox *autotoxes, uint32_t iterations)
303303

304304
static void run_conference_tests(AutoTox *autotoxes)
305305
{
306-
const Random *rng = system_random();
306+
const Random *rng = os_random();
307307
ck_assert(rng != nullptr);
308308
bool disabled[NUM_AV_GROUP_TOX] = {0};
309309

auto_tests/conference_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ static uint32_t random_false_index(const Random *rng, bool *list, const uint32_t
192192

193193
static void run_conference_tests(AutoTox *autotoxes)
194194
{
195-
const Random *rng = system_random();
195+
const Random *rng = os_random();
196196
ck_assert(rng != nullptr);
197197
/* disabling name change propagation check for now, as it occasionally
198198
* fails due to disconnections too short to trigger freezing */

auto_tests/crypto_test.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static void test_fast_known(void)
125125

126126
static void test_endtoend(void)
127127
{
128-
const Random *rng = system_random();
128+
const Random *rng = os_random();
129129
ck_assert(rng != nullptr);
130130

131131
// Test 100 random messages and keypairs
@@ -192,7 +192,7 @@ static void test_endtoend(void)
192192

193193
static void test_large_data(void)
194194
{
195-
const Random *rng = system_random();
195+
const Random *rng = os_random();
196196
ck_assert(rng != nullptr);
197197
uint8_t k[CRYPTO_SHARED_KEY_SIZE];
198198
uint8_t n[CRYPTO_NONCE_SIZE];
@@ -236,7 +236,7 @@ static void test_large_data(void)
236236

237237
static void test_large_data_symmetric(void)
238238
{
239-
const Random *rng = system_random();
239+
const Random *rng = os_random();
240240
ck_assert(rng != nullptr);
241241
uint8_t k[CRYPTO_SYMMETRIC_KEY_SIZE];
242242

@@ -271,7 +271,7 @@ static void test_large_data_symmetric(void)
271271

272272
static void test_very_large_data(void)
273273
{
274-
const Random *rng = system_random();
274+
const Random *rng = os_random();
275275
ck_assert(rng != nullptr);
276276

277277
uint8_t nonce[CRYPTO_NONCE_SIZE] = {0};
@@ -316,7 +316,7 @@ static void increment_nonce_number_cmp(uint8_t *nonce, uint32_t num)
316316

317317
static void test_increment_nonce(void)
318318
{
319-
const Random *rng = system_random();
319+
const Random *rng = os_random();
320320
ck_assert(rng != nullptr);
321321

322322
uint8_t n[CRYPTO_NONCE_SIZE];

auto_tests/encryptsave_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ static void test_keys(void)
168168
ck_assert(encrypted2a != nullptr);
169169
uint8_t *in_plaintext2a = (uint8_t *)malloc(plaintext_length2a);
170170
ck_assert(in_plaintext2a != nullptr);
171-
const Random *rng = system_random();
171+
const Random *rng = os_random();
172172
ck_assert(rng != nullptr);
173173
random_bytes(rng, in_plaintext2a, plaintext_length2a);
174174
ret = tox_pass_encrypt(in_plaintext2a, plaintext_length2a, key_char, 12, encrypted2a, &encerr);

auto_tests/forwarding_test.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ typedef struct Forwarding_Subtox {
104104

105105
static Forwarding_Subtox *new_forwarding_subtox(const Memory *mem, bool no_udp, uint32_t *index, uint16_t port)
106106
{
107-
const Random *rng = system_random();
107+
const Random *rng = os_random();
108108
ck_assert(rng != nullptr);
109-
const Network *ns = system_network();
109+
const Network *ns = os_network();
110110
ck_assert(ns != nullptr);
111111

112112
Forwarding_Subtox *subtox = (Forwarding_Subtox *)calloc(1, sizeof(Forwarding_Subtox));
@@ -152,11 +152,11 @@ static void kill_forwarding_subtox(const Memory *mem, Forwarding_Subtox *subtox)
152152

153153
static void test_forwarding(void)
154154
{
155-
const Memory *mem = system_memory();
155+
const Memory *mem = os_memory();
156156
ck_assert(mem != nullptr);
157-
const Random *rng = system_random();
157+
const Random *rng = os_random();
158158
ck_assert(rng != nullptr);
159-
const Network *ns = system_network();
159+
const Network *ns = os_network();
160160
ck_assert(ns != nullptr);
161161

162162
uint32_t index[NUM_FORWARDER];

auto_tests/group_message_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ static void group_message_test(AutoTox *autotoxes)
381381
{
382382
ck_assert_msg(NUM_GROUP_TOXES >= 2, "NUM_GROUP_TOXES is too small: %d", NUM_GROUP_TOXES);
383383

384-
const Random *rng = system_random();
384+
const Random *rng = os_random();
385385
ck_assert(rng != nullptr);
386386

387387
Tox *tox0 = autotoxes[0].tox;

auto_tests/group_sync_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ static void topic_spam(const Random *rng, AutoTox *autotoxes, uint32_t num_peers
335335
static void group_sync_test(AutoTox *autotoxes)
336336
{
337337
ck_assert(NUM_GROUP_TOXES >= 5);
338-
const Random *rng = system_random();
338+
const Random *rng = os_random();
339339
ck_assert(rng != nullptr);
340340

341341
for (size_t i = 0; i < NUM_GROUP_TOXES; ++i) {

auto_tests/group_topic_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ static void group_topic_test(AutoTox *autotoxes)
215215
{
216216
ck_assert_msg(NUM_GROUP_TOXES >= 3, "NUM_GROUP_TOXES is too small: %d", NUM_GROUP_TOXES);
217217

218-
const Random *rng = system_random();
218+
const Random *rng = os_random();
219219
ck_assert(rng != nullptr);
220220

221221
Tox *tox0 = autotoxes[0].tox;

0 commit comments

Comments
 (0)