diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-08-04 19:18:31 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-08-13 11:02:32 +0000 |
commit | a509d253240abd96665675fed7513f6cdeec04de (patch) | |
tree | 0f82af1686f6a2f9fd66759d97ac581fd875d29b | |
parent | 97a4b8e6a74584a692aa8e92bd080c2e60ef04de (diff) |
Fix some printf format specifiers.
-rw-r--r-- | auto_tests/conference_simple_test.c | 20 | ||||
-rw-r--r-- | auto_tests/encryptsave_test.c | 30 | ||||
-rw-r--r-- | auto_tests/file_transfer_test.c | 2 | ||||
-rw-r--r-- | auto_tests/friend_request_test.c | 2 | ||||
-rw-r--r-- | auto_tests/network_test.c | 14 | ||||
-rw-r--r-- | auto_tests/save_load_test.c | 2 | ||||
-rw-r--r-- | auto_tests/tox_many_tcp_test.c | 2 | ||||
-rw-r--r-- | testing/av_test.c | 4 |
8 files changed, 38 insertions, 38 deletions
diff --git a/auto_tests/conference_simple_test.c b/auto_tests/conference_simple_test.c index 010ae029..20e4ec8b 100644 --- a/auto_tests/conference_simple_test.c +++ b/auto_tests/conference_simple_test.c | |||
@@ -27,7 +27,7 @@ static void handle_self_connection_status(Tox *tox, TOX_CONNECTION connection_st | |||
27 | { | 27 | { |
28 | State *state = (State *)user_data; | 28 | State *state = (State *)user_data; |
29 | 29 | ||
30 | fprintf(stderr, "self_connection_status(#%d, %d, _)\n", state->id, connection_status); | 30 | fprintf(stderr, "self_connection_status(#%u, %d, _)\n", state->id, connection_status); |
31 | state->self_online = connection_status != TOX_CONNECTION_NONE; | 31 | state->self_online = connection_status != TOX_CONNECTION_NONE; |
32 | } | 32 | } |
33 | 33 | ||
@@ -36,7 +36,7 @@ static void handle_friend_connection_status(Tox *tox, uint32_t friend_number, TO | |||
36 | { | 36 | { |
37 | State *state = (State *)user_data; | 37 | State *state = (State *)user_data; |
38 | 38 | ||
39 | fprintf(stderr, "handle_friend_connection_status(#%d, %d, %d, _)\n", state->id, friend_number, connection_status); | 39 | fprintf(stderr, "handle_friend_connection_status(#%u, %u, %d, _)\n", state->id, friend_number, connection_status); |
40 | state->friend_online = connection_status != TOX_CONNECTION_NONE; | 40 | state->friend_online = connection_status != TOX_CONNECTION_NONE; |
41 | } | 41 | } |
42 | 42 | ||
@@ -45,15 +45,15 @@ static void handle_conference_invite(Tox *tox, uint32_t friend_number, TOX_CONFE | |||
45 | { | 45 | { |
46 | State *state = (State *)user_data; | 46 | State *state = (State *)user_data; |
47 | 47 | ||
48 | fprintf(stderr, "handle_conference_invite(#%d, %d, %d, uint8_t[%u], _)\n", | 48 | fprintf(stderr, "handle_conference_invite(#%u, %u, %d, uint8_t[%u], _)\n", |
49 | state->id, friend_number, type, (unsigned)length); | 49 | state->id, friend_number, type, (unsigned)length); |
50 | fprintf(stderr, "tox%d joining conference\n", state->id); | 50 | fprintf(stderr, "tox%u joining conference\n", state->id); |
51 | 51 | ||
52 | { | 52 | { |
53 | TOX_ERR_CONFERENCE_JOIN err; | 53 | TOX_ERR_CONFERENCE_JOIN err; |
54 | state->conference = tox_conference_join(tox, friend_number, cookie, length, &err); | 54 | state->conference = tox_conference_join(tox, friend_number, cookie, length, &err); |
55 | ck_assert_msg(err == TOX_ERR_CONFERENCE_JOIN_OK, "failed to join a conference: err = %d", err); | 55 | ck_assert_msg(err == TOX_ERR_CONFERENCE_JOIN_OK, "failed to join a conference: err = %d", err); |
56 | fprintf(stderr, "tox%d Joined conference %d\n", state->id, state->conference); | 56 | fprintf(stderr, "tox%u Joined conference %u\n", state->id, state->conference); |
57 | state->joined = true; | 57 | state->joined = true; |
58 | } | 58 | } |
59 | } | 59 | } |
@@ -63,10 +63,10 @@ static void handle_conference_message(Tox *tox, uint32_t conference_number, uint | |||
63 | { | 63 | { |
64 | State *state = (State *)user_data; | 64 | State *state = (State *)user_data; |
65 | 65 | ||
66 | fprintf(stderr, "handle_conference_message(#%d, %d, %d, %d, uint8_t[%u], _)\n", | 66 | fprintf(stderr, "handle_conference_message(#%u, %u, %u, %d, uint8_t[%u], _)\n", |
67 | state->id, conference_number, peer_number, type, (unsigned)length); | 67 | state->id, conference_number, peer_number, type, (unsigned)length); |
68 | 68 | ||
69 | fprintf(stderr, "tox%d got message: %s\n", state->id, (const char *)message); | 69 | fprintf(stderr, "tox%u got message: %s\n", state->id, (const char *)message); |
70 | state->received = true; | 70 | state->received = true; |
71 | } | 71 | } |
72 | 72 | ||
@@ -74,7 +74,7 @@ static void handle_conference_peer_list_changed(Tox *tox, uint32_t conference_nu | |||
74 | { | 74 | { |
75 | State *state = (State *)user_data; | 75 | State *state = (State *)user_data; |
76 | 76 | ||
77 | fprintf(stderr, "handle_conference_peer_list_changed(#%d, %d, _)\n", | 77 | fprintf(stderr, "handle_conference_peer_list_changed(#%u, %u, _)\n", |
78 | state->id, conference_number); | 78 | state->id, conference_number); |
79 | 79 | ||
80 | TOX_ERR_CONFERENCE_PEER_QUERY err; | 80 | TOX_ERR_CONFERENCE_PEER_QUERY err; |
@@ -85,7 +85,7 @@ static void handle_conference_peer_list_changed(Tox *tox, uint32_t conference_nu | |||
85 | exit(EXIT_FAILURE); | 85 | exit(EXIT_FAILURE); |
86 | } | 86 | } |
87 | 87 | ||
88 | fprintf(stderr, "tox%d has %d peers online\n", state->id, count); | 88 | fprintf(stderr, "tox%u has %u peers online\n", state->id, count); |
89 | state->peers = count; | 89 | state->peers = count; |
90 | } | 90 | } |
91 | 91 | ||
@@ -194,7 +194,7 @@ int main(void) | |||
194 | state1.conference = tox_conference_new(tox1, &err); | 194 | state1.conference = tox_conference_new(tox1, &err); |
195 | state1.joined = true; | 195 | state1.joined = true; |
196 | ck_assert_msg(err == TOX_ERR_CONFERENCE_NEW_OK, "failed to create a conference: err = %d", err); | 196 | ck_assert_msg(err == TOX_ERR_CONFERENCE_NEW_OK, "failed to create a conference: err = %d", err); |
197 | fprintf(stderr, "Created conference: id=%d\n", state1.conference); | 197 | fprintf(stderr, "Created conference: id = %u\n", state1.conference); |
198 | } | 198 | } |
199 | 199 | ||
200 | { | 200 | { |
diff --git a/auto_tests/encryptsave_test.c b/auto_tests/encryptsave_test.c index 41a4ed5c..bf7988e2 100644 --- a/auto_tests/encryptsave_test.c +++ b/auto_tests/encryptsave_test.c | |||
@@ -72,7 +72,7 @@ static void test_save_friend(void) | |||
72 | VLA(uint8_t, enc_data, size2); | 72 | VLA(uint8_t, enc_data, size2); |
73 | TOX_ERR_ENCRYPTION error1; | 73 | TOX_ERR_ENCRYPTION error1; |
74 | bool ret = tox_pass_encrypt(data, size, (const uint8_t *)"correcthorsebatterystaple", 25, enc_data, &error1); | 74 | bool ret = tox_pass_encrypt(data, size, (const uint8_t *)"correcthorsebatterystaple", 25, enc_data, &error1); |
75 | ck_assert_msg(ret, "failed to encrypted save: %u", error1); | 75 | ck_assert_msg(ret, "failed to encrypted save: %d", error1); |
76 | ck_assert_msg(tox_is_data_encrypted(enc_data), "magic number missing"); | 76 | ck_assert_msg(tox_is_data_encrypted(enc_data), "magic number missing"); |
77 | 77 | ||
78 | struct Tox_Options *options = tox_options_new(nullptr); | 78 | struct Tox_Options *options = tox_options_new(nullptr); |
@@ -81,16 +81,16 @@ static void test_save_friend(void) | |||
81 | 81 | ||
82 | TOX_ERR_NEW err2; | 82 | TOX_ERR_NEW err2; |
83 | Tox *tox3 = tox_new_log(options, &err2, nullptr); | 83 | Tox *tox3 = tox_new_log(options, &err2, nullptr); |
84 | ck_assert_msg(err2 == TOX_ERR_NEW_LOAD_ENCRYPTED, "wrong error! %u. should fail with %u", err2, | 84 | ck_assert_msg(err2 == TOX_ERR_NEW_LOAD_ENCRYPTED, "wrong error! %d. should fail with %d", err2, |
85 | TOX_ERR_NEW_LOAD_ENCRYPTED); | 85 | TOX_ERR_NEW_LOAD_ENCRYPTED); |
86 | ck_assert_msg(tox3 == nullptr, "tox_new with error should return NULL"); | 86 | ck_assert_msg(tox3 == nullptr, "tox_new with error should return NULL"); |
87 | VLA(uint8_t, dec_data, size); | 87 | VLA(uint8_t, dec_data, size); |
88 | TOX_ERR_DECRYPTION err3; | 88 | TOX_ERR_DECRYPTION err3; |
89 | ret = tox_pass_decrypt(enc_data, size2, (const uint8_t *)"correcthorsebatterystaple", 25, dec_data, &err3); | 89 | ret = tox_pass_decrypt(enc_data, size2, (const uint8_t *)"correcthorsebatterystaple", 25, dec_data, &err3); |
90 | ck_assert_msg(ret, "failed to decrypt save: %u", err3); | 90 | ck_assert_msg(ret, "failed to decrypt save: %d", err3); |
91 | tox_options_set_savedata_data(options, dec_data, size); | 91 | tox_options_set_savedata_data(options, dec_data, size); |
92 | tox3 = tox_new_log(options, &err2, nullptr); | 92 | tox3 = tox_new_log(options, &err2, nullptr); |
93 | ck_assert_msg(err2 == TOX_ERR_NEW_OK, "failed to load from decrypted data: %u", err2); | 93 | ck_assert_msg(err2 == TOX_ERR_NEW_OK, "failed to load from decrypted data: %d", err2); |
94 | uint8_t address2[TOX_PUBLIC_KEY_SIZE]; | 94 | uint8_t address2[TOX_PUBLIC_KEY_SIZE]; |
95 | ret = tox_friend_get_public_key(tox3, 0, address2, nullptr); | 95 | ret = tox_friend_get_public_key(tox3, 0, address2, nullptr); |
96 | ck_assert_msg(ret, "no friends!"); | 96 | ck_assert_msg(ret, "no friends!"); |
@@ -107,15 +107,15 @@ static void test_save_friend(void) | |||
107 | size2 = size + TOX_PASS_ENCRYPTION_EXTRA_LENGTH; | 107 | size2 = size + TOX_PASS_ENCRYPTION_EXTRA_LENGTH; |
108 | VLA(uint8_t, encdata2, size2); | 108 | VLA(uint8_t, encdata2, size2); |
109 | ret = tox_pass_key_encrypt(key, data2, size, encdata2, &error1); | 109 | ret = tox_pass_key_encrypt(key, data2, size, encdata2, &error1); |
110 | ck_assert_msg(ret, "failed to key encrypt %u", error1); | 110 | ck_assert_msg(ret, "failed to key encrypt %d", error1); |
111 | ck_assert_msg(tox_is_data_encrypted(encdata2), "magic number the second missing"); | 111 | ck_assert_msg(tox_is_data_encrypted(encdata2), "magic number the second missing"); |
112 | 112 | ||
113 | VLA(uint8_t, out1, size); | 113 | VLA(uint8_t, out1, size); |
114 | VLA(uint8_t, out2, size); | 114 | VLA(uint8_t, out2, size); |
115 | ret = tox_pass_decrypt(encdata2, size2, (const uint8_t *)pw, pwlen, out1, &err3); | 115 | ret = tox_pass_decrypt(encdata2, size2, (const uint8_t *)pw, pwlen, out1, &err3); |
116 | ck_assert_msg(ret, "failed to pw decrypt %u", err3); | 116 | ck_assert_msg(ret, "failed to pw decrypt %d", err3); |
117 | ret = tox_pass_key_decrypt(key, encdata2, size2, out2, &err3); | 117 | ret = tox_pass_key_decrypt(key, encdata2, size2, out2, &err3); |
118 | ck_assert_msg(ret, "failed to key decrypt %u", err3); | 118 | ck_assert_msg(ret, "failed to key decrypt %d", err3); |
119 | ck_assert_msg(memcmp(out1, out2, size) == 0, "differing output data"); | 119 | ck_assert_msg(memcmp(out1, out2, size) == 0, "differing output data"); |
120 | 120 | ||
121 | // and now with the code in use (I only bothered with manually to debug this, and it seems a waste | 121 | // and now with the code in use (I only bothered with manually to debug this, and it seems a waste |
@@ -143,37 +143,37 @@ static void test_keys(void) | |||
143 | TOX_ERR_DECRYPTION decerr; | 143 | TOX_ERR_DECRYPTION decerr; |
144 | TOX_ERR_KEY_DERIVATION keyerr; | 144 | TOX_ERR_KEY_DERIVATION keyerr; |
145 | Tox_Pass_Key *key = tox_pass_key_derive((const uint8_t *)"123qweasdzxc", 12, &keyerr); | 145 | Tox_Pass_Key *key = tox_pass_key_derive((const uint8_t *)"123qweasdzxc", 12, &keyerr); |
146 | ck_assert_msg(key != nullptr, "generic failure 1: %u", keyerr); | 146 | ck_assert_msg(key != nullptr, "generic failure 1: %d", keyerr); |
147 | const uint8_t *string = (const uint8_t *)"No Patrick, mayonnaise is not an instrument."; // 44 | 147 | const uint8_t *string = (const uint8_t *)"No Patrick, mayonnaise is not an instrument."; // 44 |
148 | 148 | ||
149 | uint8_t encrypted[44 + TOX_PASS_ENCRYPTION_EXTRA_LENGTH]; | 149 | uint8_t encrypted[44 + TOX_PASS_ENCRYPTION_EXTRA_LENGTH]; |
150 | bool ret = tox_pass_key_encrypt(key, string, 44, encrypted, &encerr); | 150 | bool ret = tox_pass_key_encrypt(key, string, 44, encrypted, &encerr); |
151 | ck_assert_msg(ret, "generic failure 2: %u", encerr); | 151 | ck_assert_msg(ret, "generic failure 2: %d", encerr); |
152 | 152 | ||
153 | uint8_t encrypted2[44 + TOX_PASS_ENCRYPTION_EXTRA_LENGTH]; | 153 | uint8_t encrypted2[44 + TOX_PASS_ENCRYPTION_EXTRA_LENGTH]; |
154 | ret = tox_pass_encrypt(string, 44, (const uint8_t *)"123qweasdzxc", 12, encrypted2, &encerr); | 154 | ret = tox_pass_encrypt(string, 44, (const uint8_t *)"123qweasdzxc", 12, encrypted2, &encerr); |
155 | ck_assert_msg(ret, "generic failure 3: %u", encerr); | 155 | ck_assert_msg(ret, "generic failure 3: %d", encerr); |
156 | 156 | ||
157 | uint8_t out1[44 + TOX_PASS_ENCRYPTION_EXTRA_LENGTH]; | 157 | uint8_t out1[44 + TOX_PASS_ENCRYPTION_EXTRA_LENGTH]; |
158 | uint8_t out2[44 + TOX_PASS_ENCRYPTION_EXTRA_LENGTH]; | 158 | uint8_t out2[44 + TOX_PASS_ENCRYPTION_EXTRA_LENGTH]; |
159 | 159 | ||
160 | ret = tox_pass_key_decrypt(key, encrypted, 44 + TOX_PASS_ENCRYPTION_EXTRA_LENGTH, out1, &decerr); | 160 | ret = tox_pass_key_decrypt(key, encrypted, 44 + TOX_PASS_ENCRYPTION_EXTRA_LENGTH, out1, &decerr); |
161 | ck_assert_msg(ret, "generic failure 4: %u", decerr); | 161 | ck_assert_msg(ret, "generic failure 4: %d", decerr); |
162 | ck_assert_msg(memcmp(out1, string, 44) == 0, "decryption 1 failed"); | 162 | ck_assert_msg(memcmp(out1, string, 44) == 0, "decryption 1 failed"); |
163 | 163 | ||
164 | ret = tox_pass_decrypt(encrypted2, 44 + TOX_PASS_ENCRYPTION_EXTRA_LENGTH, (const uint8_t *)"123qweasdzxc", 12, out2, | 164 | ret = tox_pass_decrypt(encrypted2, 44 + TOX_PASS_ENCRYPTION_EXTRA_LENGTH, (const uint8_t *)"123qweasdzxc", 12, out2, |
165 | &decerr); | 165 | &decerr); |
166 | ck_assert_msg(ret, "generic failure 5: %u", decerr); | 166 | ck_assert_msg(ret, "generic failure 5: %d", decerr); |
167 | ck_assert_msg(memcmp(out2, string, 44) == 0, "decryption 2 failed"); | 167 | ck_assert_msg(memcmp(out2, string, 44) == 0, "decryption 2 failed"); |
168 | 168 | ||
169 | ret = tox_pass_decrypt(encrypted2, 44 + TOX_PASS_ENCRYPTION_EXTRA_LENGTH, nullptr, 0, out2, &decerr); | 169 | ret = tox_pass_decrypt(encrypted2, 44 + TOX_PASS_ENCRYPTION_EXTRA_LENGTH, nullptr, 0, out2, &decerr); |
170 | ck_assert_msg(!ret, "Decrypt succeeded with wrong pass"); | 170 | ck_assert_msg(!ret, "Decrypt succeeded with wrong pass"); |
171 | ck_assert_msg(decerr != TOX_ERR_DECRYPTION_FAILED, "Bad error code %u", decerr); | 171 | ck_assert_msg(decerr != TOX_ERR_DECRYPTION_FAILED, "Bad error code %d", decerr); |
172 | 172 | ||
173 | // test that pass_decrypt can decrypt things from pass_key_encrypt | 173 | // test that pass_decrypt can decrypt things from pass_key_encrypt |
174 | ret = tox_pass_decrypt(encrypted, 44 + TOX_PASS_ENCRYPTION_EXTRA_LENGTH, (const uint8_t *)"123qweasdzxc", 12, out1, | 174 | ret = tox_pass_decrypt(encrypted, 44 + TOX_PASS_ENCRYPTION_EXTRA_LENGTH, (const uint8_t *)"123qweasdzxc", 12, out1, |
175 | &decerr); | 175 | &decerr); |
176 | ck_assert_msg(ret, "generic failure 6: %u", decerr); | 176 | ck_assert_msg(ret, "generic failure 6: %d", decerr); |
177 | ck_assert_msg(memcmp(out1, string, 44) == 0, "decryption 3 failed"); | 177 | ck_assert_msg(memcmp(out1, string, 44) == 0, "decryption 3 failed"); |
178 | 178 | ||
179 | uint8_t salt[TOX_PASS_SALT_LENGTH]; | 179 | uint8_t salt[TOX_PASS_SALT_LENGTH]; |
@@ -181,7 +181,7 @@ static void test_keys(void) | |||
181 | ck_assert_msg(tox_get_salt(encrypted, salt, &salt_err), "couldn't get salt"); | 181 | ck_assert_msg(tox_get_salt(encrypted, salt, &salt_err), "couldn't get salt"); |
182 | ck_assert_msg(salt_err == TOX_ERR_GET_SALT_OK, "get_salt returned an error"); | 182 | ck_assert_msg(salt_err == TOX_ERR_GET_SALT_OK, "get_salt returned an error"); |
183 | Tox_Pass_Key *key2 = tox_pass_key_derive_with_salt((const uint8_t *)"123qweasdzxc", 12, salt, &keyerr); | 183 | Tox_Pass_Key *key2 = tox_pass_key_derive_with_salt((const uint8_t *)"123qweasdzxc", 12, salt, &keyerr); |
184 | ck_assert_msg(key2 != nullptr, "generic failure 7: %u", keyerr); | 184 | ck_assert_msg(key2 != nullptr, "generic failure 7: %d", keyerr); |
185 | ck_assert_msg(0 == memcmp(key, key2, TOX_PASS_KEY_LENGTH + TOX_PASS_SALT_LENGTH), "salt comparison failed"); | 185 | ck_assert_msg(0 == memcmp(key, key2, TOX_PASS_KEY_LENGTH + TOX_PASS_SALT_LENGTH), "salt comparison failed"); |
186 | tox_pass_key_free(key2); | 186 | tox_pass_key_free(key2); |
187 | tox_pass_key_free(key); | 187 | tox_pass_key_free(key); |
diff --git a/auto_tests/file_transfer_test.c b/auto_tests/file_transfer_test.c index 9af339e5..63dc3fed 100644 --- a/auto_tests/file_transfer_test.c +++ b/auto_tests/file_transfer_test.c | |||
@@ -173,7 +173,7 @@ static void file_transfer_test(void) | |||
173 | uint8_t address[TOX_ADDRESS_SIZE]; | 173 | uint8_t address[TOX_ADDRESS_SIZE]; |
174 | tox_self_get_address(tox2, address); | 174 | tox_self_get_address(tox2, address); |
175 | uint32_t test = tox_friend_add(tox3, address, (const uint8_t *)"Gentoo", 7, nullptr); | 175 | uint32_t test = tox_friend_add(tox3, address, (const uint8_t *)"Gentoo", 7, nullptr); |
176 | ck_assert_msg(test == 0, "Failed to add friend error code: %i", test); | 176 | ck_assert_msg(test == 0, "Failed to add friend error code: %u", test); |
177 | 177 | ||
178 | uint8_t dhtKey[TOX_PUBLIC_KEY_SIZE]; | 178 | uint8_t dhtKey[TOX_PUBLIC_KEY_SIZE]; |
179 | tox_self_get_dht_id(tox1, dhtKey); | 179 | tox_self_get_dht_id(tox1, dhtKey); |
diff --git a/auto_tests/friend_request_test.c b/auto_tests/friend_request_test.c index 1bcc05a7..73f9248c 100644 --- a/auto_tests/friend_request_test.c +++ b/auto_tests/friend_request_test.c | |||
@@ -61,7 +61,7 @@ static void test_friend_request(void) | |||
61 | tox_self_get_address(tox2, address); | 61 | tox_self_get_address(tox2, address); |
62 | 62 | ||
63 | const uint32_t test = tox_friend_add(tox1, address, (const uint8_t *)FR_MESSAGE, sizeof(FR_MESSAGE), nullptr); | 63 | const uint32_t test = tox_friend_add(tox1, address, (const uint8_t *)FR_MESSAGE, sizeof(FR_MESSAGE), nullptr); |
64 | ck_assert_msg(test == 0, "failed to add friend error code: %i", test); | 64 | ck_assert_msg(test == 0, "failed to add friend error code: %u", test); |
65 | 65 | ||
66 | while (tox_friend_get_connection_status(tox1, 0, nullptr) != TOX_CONNECTION_UDP || | 66 | while (tox_friend_get_connection_status(tox1, 0, nullptr) != TOX_CONNECTION_UDP || |
67 | tox_friend_get_connection_status(tox2, 0, nullptr) != TOX_CONNECTION_UDP) { | 67 | tox_friend_get_connection_status(tox2, 0, nullptr) != TOX_CONNECTION_UDP) { |
diff --git a/auto_tests/network_test.c b/auto_tests/network_test.c index 78f41195..7cfba1c0 100644 --- a/auto_tests/network_test.c +++ b/auto_tests/network_test.c | |||
@@ -104,20 +104,20 @@ START_TEST(test_ip_equal) | |||
104 | ip_reset(&ip2); | 104 | ip_reset(&ip2); |
105 | 105 | ||
106 | res = ip_equal(nullptr, nullptr); | 106 | res = ip_equal(nullptr, nullptr); |
107 | ck_assert_msg(res == 0, "ip_equal(NULL, NULL): expected result 0, got %u.", res); | 107 | ck_assert_msg(res == 0, "ip_equal(NULL, NULL): expected result 0, got %d.", res); |
108 | 108 | ||
109 | res = ip_equal(&ip1, nullptr); | 109 | res = ip_equal(&ip1, nullptr); |
110 | ck_assert_msg(res == 0, "ip_equal(PTR, NULL): expected result 0, got %u.", res); | 110 | ck_assert_msg(res == 0, "ip_equal(PTR, NULL): expected result 0, got %d.", res); |
111 | 111 | ||
112 | res = ip_equal(nullptr, &ip1); | 112 | res = ip_equal(nullptr, &ip1); |
113 | ck_assert_msg(res == 0, "ip_equal(NULL, PTR): expected result 0, got %u.", res); | 113 | ck_assert_msg(res == 0, "ip_equal(NULL, PTR): expected result 0, got %d.", res); |
114 | 114 | ||
115 | ip1.family = net_family_ipv4; | 115 | ip1.family = net_family_ipv4; |
116 | ip1.ip.v4.uint32 = net_htonl(0x7F000001); | 116 | ip1.ip.v4.uint32 = net_htonl(0x7F000001); |
117 | 117 | ||
118 | res = ip_equal(&ip1, &ip2); | 118 | res = ip_equal(&ip1, &ip2); |
119 | ck_assert_msg(res == 0, "ip_equal( {TOX_AF_INET, 127.0.0.1}, {TOX_AF_UNSPEC, 0} ): " | 119 | ck_assert_msg(res == 0, "ip_equal( {TOX_AF_INET, 127.0.0.1}, {TOX_AF_UNSPEC, 0} ): " |
120 | "expected result 0, got %u.", res); | 120 | "expected result 0, got %d.", res); |
121 | 121 | ||
122 | ip2.family = net_family_ipv4; | 122 | ip2.family = net_family_ipv4; |
123 | ip2.ip.v4.uint32 = net_htonl(0x7F000001); | 123 | ip2.ip.v4.uint32 = net_htonl(0x7F000001); |
@@ -130,7 +130,7 @@ START_TEST(test_ip_equal) | |||
130 | 130 | ||
131 | res = ip_equal(&ip1, &ip2); | 131 | res = ip_equal(&ip1, &ip2); |
132 | ck_assert_msg(res == 0, "ip_equal( {TOX_AF_INET, 127.0.0.1}, {TOX_AF_INET, 127.0.0.2} ): " | 132 | ck_assert_msg(res == 0, "ip_equal( {TOX_AF_INET, 127.0.0.1}, {TOX_AF_INET, 127.0.0.2} ): " |
133 | "expected result 0, got %u.", res); | 133 | "expected result 0, got %d.", res); |
134 | 134 | ||
135 | ip2.family = net_family_ipv6; | 135 | ip2.family = net_family_ipv6; |
136 | ip2.ip.v6.uint32[0] = 0; | 136 | ip2.ip.v6.uint32[0] = 0; |
@@ -148,7 +148,7 @@ START_TEST(test_ip_equal) | |||
148 | IP6 ip6_loopback = get_ip6_loopback(); | 148 | IP6 ip6_loopback = get_ip6_loopback(); |
149 | memcpy(&ip2.ip.v6, &ip6_loopback, sizeof(IP6)); | 149 | memcpy(&ip2.ip.v6, &ip6_loopback, sizeof(IP6)); |
150 | res = ip_equal(&ip1, &ip2); | 150 | res = ip_equal(&ip1, &ip2); |
151 | ck_assert_msg(res == 0, "ip_equal( {TOX_AF_INET, 127.0.0.1}, {TOX_AF_INET6, ::1} ): expected result 0, got %u.", res); | 151 | ck_assert_msg(res == 0, "ip_equal( {TOX_AF_INET, 127.0.0.1}, {TOX_AF_INET6, ::1} ): expected result 0, got %d.", res); |
152 | 152 | ||
153 | memcpy(&ip1, &ip2, sizeof(IP)); | 153 | memcpy(&ip1, &ip2, sizeof(IP)); |
154 | res = ip_equal(&ip1, &ip2); | 154 | res = ip_equal(&ip1, &ip2); |
@@ -156,7 +156,7 @@ START_TEST(test_ip_equal) | |||
156 | 156 | ||
157 | ip2.ip.v6.uint8[15]++; | 157 | ip2.ip.v6.uint8[15]++; |
158 | res = ip_equal(&ip1, &ip2); | 158 | res = ip_equal(&ip1, &ip2); |
159 | ck_assert_msg(res == 0, "ip_equal( {TOX_AF_INET6, ::1}, {TOX_AF_INET6, ::2} ): expected result 0, got %u.", res); | 159 | ck_assert_msg(res == 0, "ip_equal( {TOX_AF_INET6, ::1}, {TOX_AF_INET6, ::2} ): expected result 0, got %d.", res); |
160 | } | 160 | } |
161 | END_TEST | 161 | END_TEST |
162 | 162 | ||
diff --git a/auto_tests/save_load_test.c b/auto_tests/save_load_test.c index 90d0263f..7d5672c7 100644 --- a/auto_tests/save_load_test.c +++ b/auto_tests/save_load_test.c | |||
@@ -30,7 +30,7 @@ static void tox_connection_status(Tox *tox, TOX_CONNECTION connection_status, vo | |||
30 | ck_abort_msg("Tox went offline"); | 30 | ck_abort_msg("Tox went offline"); |
31 | } | 31 | } |
32 | 32 | ||
33 | ck_assert_msg(connection_status == TOX_CONNECTION_UDP, "wrong status %u", connection_status); | 33 | ck_assert_msg(connection_status == TOX_CONNECTION_UDP, "wrong status %d", connection_status); |
34 | 34 | ||
35 | connected_t1 = connection_status; | 35 | connected_t1 = connection_status; |
36 | } | 36 | } |
diff --git a/auto_tests/tox_many_tcp_test.c b/auto_tests/tox_many_tcp_test.c index 7ce2c9a5..b8343f74 100644 --- a/auto_tests/tox_many_tcp_test.c +++ b/auto_tests/tox_many_tcp_test.c | |||
@@ -63,7 +63,7 @@ START_TEST(test_many_clients_tcp) | |||
63 | uint8_t dpk[TOX_PUBLIC_KEY_SIZE]; | 63 | uint8_t dpk[TOX_PUBLIC_KEY_SIZE]; |
64 | tox_self_get_dht_id(toxes[0], dpk); | 64 | tox_self_get_dht_id(toxes[0], dpk); |
65 | TOX_ERR_BOOTSTRAP error = TOX_ERR_BOOTSTRAP_OK; | 65 | TOX_ERR_BOOTSTRAP error = TOX_ERR_BOOTSTRAP_OK; |
66 | ck_assert_msg(tox_add_tcp_relay(toxes[i], TOX_LOCALHOST, TCP_RELAY_PORT, dpk, &error), "add relay error, %i, %i", i, | 66 | ck_assert_msg(tox_add_tcp_relay(toxes[i], TOX_LOCALHOST, TCP_RELAY_PORT, dpk, &error), "add relay error, %u, %d", i, |
67 | error); | 67 | error); |
68 | uint16_t first_port = tox_self_get_udp_port(toxes[0], nullptr); | 68 | uint16_t first_port = tox_self_get_udp_port(toxes[0], nullptr); |
69 | ck_assert_msg(tox_bootstrap(toxes[i], TOX_LOCALHOST, first_port, dpk, nullptr), "Bootstrap error"); | 69 | ck_assert_msg(tox_bootstrap(toxes[i], TOX_LOCALHOST, first_port, dpk, nullptr), "Bootstrap error"); |
diff --git a/testing/av_test.c b/testing/av_test.c index 87a01871..a36d0a00 100644 --- a/testing/av_test.c +++ b/testing/av_test.c | |||
@@ -212,12 +212,12 @@ static void t_toxav_receive_audio_frame_cb(ToxAV *av, uint32_t friend_number, | |||
212 | static void t_toxav_audio_bit_rate_cb(ToxAV *av, uint32_t friend_number, | 212 | static void t_toxav_audio_bit_rate_cb(ToxAV *av, uint32_t friend_number, |
213 | uint32_t audio_bit_rate, void *user_data) | 213 | uint32_t audio_bit_rate, void *user_data) |
214 | { | 214 | { |
215 | printf("Suggested bit rate: audio: %d\n", audio_bit_rate); | 215 | printf("Suggested bit rate: audio: %u\n", audio_bit_rate); |
216 | } | 216 | } |
217 | static void t_toxav_video_bit_rate_cb(ToxAV *av, uint32_t friend_number, | 217 | static void t_toxav_video_bit_rate_cb(ToxAV *av, uint32_t friend_number, |
218 | uint32_t video_bit_rate, void *user_data) | 218 | uint32_t video_bit_rate, void *user_data) |
219 | { | 219 | { |
220 | printf("Suggested bit rate: video: %d\n", video_bit_rate); | 220 | printf("Suggested bit rate: video: %u\n", video_bit_rate); |
221 | } | 221 | } |
222 | static void t_accept_friend_request_cb(Tox *m, const uint8_t *public_key, const uint8_t *data, size_t length, | 222 | static void t_accept_friend_request_cb(Tox *m, const uint8_t *public_key, const uint8_t *data, size_t length, |
223 | void *userdata) | 223 | void *userdata) |