diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-10-08 21:05:14 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-10-09 17:33:37 +0000 |
commit | 605dfe882c52bfad4dee9678a69e4b816d93431d (patch) | |
tree | 10432adc5d3716cb28b833c6e156218b67c23494 /auto_tests | |
parent | 77e025fae48a4f9cf6cf19a359b6c423545f3cc7 (diff) |
Consistently use camel case enum names.
Including in tests and implementation files.
Diffstat (limited to 'auto_tests')
25 files changed, 91 insertions, 91 deletions
diff --git a/auto_tests/bootstrap_test.c b/auto_tests/bootstrap_test.c index 86cbf99e..d9de339e 100644 --- a/auto_tests/bootstrap_test.c +++ b/auto_tests/bootstrap_test.c | |||
@@ -32,7 +32,7 @@ int main(void) | |||
32 | c_sleep(ITERATION_INTERVAL); | 32 | c_sleep(ITERATION_INTERVAL); |
33 | } while (tox_self_get_connection_status(tox_udp) == TOX_CONNECTION_NONE); | 33 | } while (tox_self_get_connection_status(tox_udp) == TOX_CONNECTION_NONE); |
34 | 34 | ||
35 | const TOX_CONNECTION status = tox_self_get_connection_status(tox_udp); | 35 | const Tox_Connection status = tox_self_get_connection_status(tox_udp); |
36 | ck_assert_msg(status == TOX_CONNECTION_UDP, | 36 | ck_assert_msg(status == TOX_CONNECTION_UDP, |
37 | "expected connection status to be UDP, but got %d", status); | 37 | "expected connection status to be UDP, but got %d", status); |
38 | printf("Connection (UDP): %d\n", tox_self_get_connection_status(tox_udp)); | 38 | printf("Connection (UDP): %d\n", tox_self_get_connection_status(tox_udp)); |
diff --git a/auto_tests/conference_double_invite_test.c b/auto_tests/conference_double_invite_test.c index ba173a90..17124f1c 100644 --- a/auto_tests/conference_double_invite_test.c +++ b/auto_tests/conference_double_invite_test.c | |||
@@ -19,7 +19,7 @@ typedef struct State { | |||
19 | #include "run_auto_test.h" | 19 | #include "run_auto_test.h" |
20 | 20 | ||
21 | static void handle_conference_invite( | 21 | static void handle_conference_invite( |
22 | Tox *tox, uint32_t friend_number, TOX_CONFERENCE_TYPE type, | 22 | Tox *tox, uint32_t friend_number, Tox_Conference_Type type, |
23 | const uint8_t *cookie, size_t length, void *user_data) | 23 | const uint8_t *cookie, size_t length, void *user_data) |
24 | { | 24 | { |
25 | State *state = (State *)user_data; | 25 | State *state = (State *)user_data; |
@@ -29,7 +29,7 @@ static void handle_conference_invite( | |||
29 | fprintf(stderr, "tox%u joining conference\n", state->index); | 29 | fprintf(stderr, "tox%u joining conference\n", state->index); |
30 | 30 | ||
31 | if (friend_number != -1) { | 31 | if (friend_number != -1) { |
32 | TOX_ERR_CONFERENCE_JOIN err; | 32 | Tox_Err_Conference_Join err; |
33 | state->conference = tox_conference_join(tox, friend_number, cookie, length, &err); | 33 | state->conference = tox_conference_join(tox, friend_number, cookie, length, &err); |
34 | ck_assert_msg(err == TOX_ERR_CONFERENCE_JOIN_OK, | 34 | ck_assert_msg(err == TOX_ERR_CONFERENCE_JOIN_OK, |
35 | "attempting to join the conference returned with an error: %d", err); | 35 | "attempting to join the conference returned with an error: %d", err); |
@@ -46,7 +46,7 @@ static void conference_double_invite_test(Tox **toxes, State *state) | |||
46 | 46 | ||
47 | { | 47 | { |
48 | // Create new conference, tox0 is the founder. | 48 | // Create new conference, tox0 is the founder. |
49 | TOX_ERR_CONFERENCE_NEW err; | 49 | Tox_Err_Conference_New err; |
50 | state[0].conference = tox_conference_new(toxes[0], &err); | 50 | state[0].conference = tox_conference_new(toxes[0], &err); |
51 | state[0].joined = true; | 51 | state[0].joined = true; |
52 | ck_assert_msg(err == TOX_ERR_CONFERENCE_NEW_OK, | 52 | ck_assert_msg(err == TOX_ERR_CONFERENCE_NEW_OK, |
@@ -56,7 +56,7 @@ static void conference_double_invite_test(Tox **toxes, State *state) | |||
56 | 56 | ||
57 | { | 57 | { |
58 | // Invite friend. | 58 | // Invite friend. |
59 | TOX_ERR_CONFERENCE_INVITE err; | 59 | Tox_Err_Conference_Invite err; |
60 | tox_conference_invite(toxes[0], 0, state[0].conference, &err); | 60 | tox_conference_invite(toxes[0], 0, state[0].conference, &err); |
61 | ck_assert_msg(err == TOX_ERR_CONFERENCE_INVITE_OK, | 61 | ck_assert_msg(err == TOX_ERR_CONFERENCE_INVITE_OK, |
62 | "attempting to invite a friend returned with an error: %d", err); | 62 | "attempting to invite a friend returned with an error: %d", err); |
diff --git a/auto_tests/conference_peer_nick_test.c b/auto_tests/conference_peer_nick_test.c index d8d2d64b..9d10a8a9 100644 --- a/auto_tests/conference_peer_nick_test.c +++ b/auto_tests/conference_peer_nick_test.c | |||
@@ -20,7 +20,7 @@ typedef struct State { | |||
20 | #include "run_auto_test.h" | 20 | #include "run_auto_test.h" |
21 | 21 | ||
22 | static void handle_conference_invite( | 22 | static void handle_conference_invite( |
23 | Tox *tox, uint32_t friend_number, TOX_CONFERENCE_TYPE type, | 23 | Tox *tox, uint32_t friend_number, Tox_Conference_Type type, |
24 | const uint8_t *cookie, size_t length, void *user_data) | 24 | const uint8_t *cookie, size_t length, void *user_data) |
25 | { | 25 | { |
26 | State *state = (State *)user_data; | 26 | State *state = (State *)user_data; |
@@ -29,7 +29,7 @@ static void handle_conference_invite( | |||
29 | state->index, friend_number, type, (unsigned)length); | 29 | state->index, friend_number, type, (unsigned)length); |
30 | fprintf(stderr, "tox%u joining conference\n", state->index); | 30 | fprintf(stderr, "tox%u joining conference\n", state->index); |
31 | 31 | ||
32 | TOX_ERR_CONFERENCE_JOIN err; | 32 | Tox_Err_Conference_Join err; |
33 | state->conference = tox_conference_join(tox, friend_number, cookie, length, &err); | 33 | state->conference = tox_conference_join(tox, friend_number, cookie, length, &err); |
34 | ck_assert_msg(err == TOX_ERR_CONFERENCE_JOIN_OK, | 34 | ck_assert_msg(err == TOX_ERR_CONFERENCE_JOIN_OK, |
35 | "attempting to join the conference returned with an error: %d", err); | 35 | "attempting to join the conference returned with an error: %d", err); |
@@ -44,7 +44,7 @@ static void handle_peer_list_changed(Tox *tox, uint32_t conference_number, void | |||
44 | fprintf(stderr, "handle_peer_list_changed(#%u, %u, _)\n", | 44 | fprintf(stderr, "handle_peer_list_changed(#%u, %u, _)\n", |
45 | state->index, conference_number); | 45 | state->index, conference_number); |
46 | 46 | ||
47 | TOX_ERR_CONFERENCE_PEER_QUERY err; | 47 | Tox_Err_Conference_Peer_Query err; |
48 | uint32_t const count = tox_conference_peer_count(tox, conference_number, &err); | 48 | uint32_t const count = tox_conference_peer_count(tox, conference_number, &err); |
49 | ck_assert_msg(err == TOX_ERR_CONFERENCE_PEER_QUERY_OK, | 49 | ck_assert_msg(err == TOX_ERR_CONFERENCE_PEER_QUERY_OK, |
50 | "failed to get conference peer count: err = %d", err); | 50 | "failed to get conference peer count: err = %d", err); |
@@ -57,7 +57,7 @@ static void rebuild_peer_list(Tox *tox) | |||
57 | for (uint32_t conference_number = 0; | 57 | for (uint32_t conference_number = 0; |
58 | conference_number < tox_conference_get_chatlist_size(tox); | 58 | conference_number < tox_conference_get_chatlist_size(tox); |
59 | ++conference_number) { | 59 | ++conference_number) { |
60 | TOX_ERR_CONFERENCE_PEER_QUERY err; | 60 | Tox_Err_Conference_Peer_Query err; |
61 | uint32_t const count = tox_conference_peer_count(tox, conference_number, &err); | 61 | uint32_t const count = tox_conference_peer_count(tox, conference_number, &err); |
62 | ck_assert_msg(err == TOX_ERR_CONFERENCE_PEER_QUERY_OK, | 62 | ck_assert_msg(err == TOX_ERR_CONFERENCE_PEER_QUERY_OK, |
63 | "failed to get conference peer count for conference %u: err = %d", conference_number, err); | 63 | "failed to get conference peer count for conference %u: err = %d", conference_number, err); |
@@ -90,7 +90,7 @@ static void conference_peer_nick_test(Tox **toxes, State *state) | |||
90 | 90 | ||
91 | { | 91 | { |
92 | // Create new conference, tox0 is the founder. | 92 | // Create new conference, tox0 is the founder. |
93 | TOX_ERR_CONFERENCE_NEW err; | 93 | Tox_Err_Conference_New err; |
94 | state[0].conference = tox_conference_new(toxes[0], &err); | 94 | state[0].conference = tox_conference_new(toxes[0], &err); |
95 | state[0].joined = true; | 95 | state[0].joined = true; |
96 | ck_assert_msg(err == TOX_ERR_CONFERENCE_NEW_OK, | 96 | ck_assert_msg(err == TOX_ERR_CONFERENCE_NEW_OK, |
@@ -100,7 +100,7 @@ static void conference_peer_nick_test(Tox **toxes, State *state) | |||
100 | 100 | ||
101 | { | 101 | { |
102 | // Invite friend. | 102 | // Invite friend. |
103 | TOX_ERR_CONFERENCE_INVITE err; | 103 | Tox_Err_Conference_Invite err; |
104 | tox_conference_invite(toxes[0], 0, state[0].conference, &err); | 104 | tox_conference_invite(toxes[0], 0, state[0].conference, &err); |
105 | ck_assert_msg(err == TOX_ERR_CONFERENCE_INVITE_OK, | 105 | ck_assert_msg(err == TOX_ERR_CONFERENCE_INVITE_OK, |
106 | "attempting to invite a friend returned with an error: %d", err); | 106 | "attempting to invite a friend returned with an error: %d", err); |
diff --git a/auto_tests/conference_simple_test.c b/auto_tests/conference_simple_test.c index c9d24dad..dadd7d62 100644 --- a/auto_tests/conference_simple_test.c +++ b/auto_tests/conference_simple_test.c | |||
@@ -23,7 +23,7 @@ typedef struct State { | |||
23 | uint32_t peers; | 23 | uint32_t peers; |
24 | } State; | 24 | } State; |
25 | 25 | ||
26 | static void handle_self_connection_status(Tox *tox, TOX_CONNECTION connection_status, void *user_data) | 26 | static void handle_self_connection_status(Tox *tox, Tox_Connection connection_status, void *user_data) |
27 | { | 27 | { |
28 | State *state = (State *)user_data; | 28 | State *state = (State *)user_data; |
29 | 29 | ||
@@ -31,7 +31,7 @@ static void handle_self_connection_status(Tox *tox, TOX_CONNECTION connection_st | |||
31 | state->self_online = connection_status != TOX_CONNECTION_NONE; | 31 | state->self_online = connection_status != TOX_CONNECTION_NONE; |
32 | } | 32 | } |
33 | 33 | ||
34 | static void handle_friend_connection_status(Tox *tox, uint32_t friend_number, TOX_CONNECTION connection_status, | 34 | static void handle_friend_connection_status(Tox *tox, uint32_t friend_number, Tox_Connection connection_status, |
35 | void *user_data) | 35 | void *user_data) |
36 | { | 36 | { |
37 | State *state = (State *)user_data; | 37 | State *state = (State *)user_data; |
@@ -40,7 +40,7 @@ static void handle_friend_connection_status(Tox *tox, uint32_t friend_number, TO | |||
40 | state->friend_online = connection_status != TOX_CONNECTION_NONE; | 40 | state->friend_online = connection_status != TOX_CONNECTION_NONE; |
41 | } | 41 | } |
42 | 42 | ||
43 | static void handle_conference_invite(Tox *tox, uint32_t friend_number, TOX_CONFERENCE_TYPE type, const uint8_t *cookie, | 43 | static void handle_conference_invite(Tox *tox, uint32_t friend_number, Tox_Conference_Type type, const uint8_t *cookie, |
44 | size_t length, void *user_data) | 44 | size_t length, void *user_data) |
45 | { | 45 | { |
46 | State *state = (State *)user_data; | 46 | State *state = (State *)user_data; |
@@ -50,7 +50,7 @@ static void handle_conference_invite(Tox *tox, uint32_t friend_number, TOX_CONFE | |||
50 | fprintf(stderr, "tox%u 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%u Joined conference %u\n", state->id, state->conference); | 56 | fprintf(stderr, "tox%u Joined conference %u\n", state->id, state->conference); |
@@ -59,7 +59,7 @@ static void handle_conference_invite(Tox *tox, uint32_t friend_number, TOX_CONFE | |||
59 | } | 59 | } |
60 | 60 | ||
61 | static void handle_conference_message(Tox *tox, uint32_t conference_number, uint32_t peer_number, | 61 | static void handle_conference_message(Tox *tox, uint32_t conference_number, uint32_t peer_number, |
62 | TOX_MESSAGE_TYPE type, const uint8_t *message, size_t length, void *user_data) | 62 | Tox_Message_Type type, const uint8_t *message, size_t length, void *user_data) |
63 | { | 63 | { |
64 | State *state = (State *)user_data; | 64 | State *state = (State *)user_data; |
65 | 65 | ||
@@ -77,7 +77,7 @@ static void handle_conference_peer_list_changed(Tox *tox, uint32_t conference_nu | |||
77 | fprintf(stderr, "handle_conference_peer_list_changed(#%u, %u, _)\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; |
81 | uint32_t count = tox_conference_peer_count(tox, conference_number, &err); | 81 | uint32_t count = tox_conference_peer_count(tox, conference_number, &err); |
82 | 82 | ||
83 | if (err != TOX_ERR_CONFERENCE_PEER_QUERY_OK) { | 83 | if (err != TOX_ERR_CONFERENCE_PEER_QUERY_OK) { |
@@ -95,7 +95,7 @@ static void handle_conference_connected(Tox *tox, uint32_t conference_number, vo | |||
95 | 95 | ||
96 | // We're tox2, so now we invite tox3. | 96 | // We're tox2, so now we invite tox3. |
97 | if (state->id == 2 && !state->invited_next) { | 97 | if (state->id == 2 && !state->invited_next) { |
98 | TOX_ERR_CONFERENCE_INVITE err; | 98 | Tox_Err_Conference_Invite err; |
99 | tox_conference_invite(tox, 1, state->conference, &err); | 99 | tox_conference_invite(tox, 1, state->conference, &err); |
100 | ck_assert_msg(err == TOX_ERR_CONFERENCE_INVITE_OK, "tox2 failed to invite tox3: err = %d", err); | 100 | ck_assert_msg(err == TOX_ERR_CONFERENCE_INVITE_OK, "tox2 failed to invite tox3: err = %d", err); |
101 | 101 | ||
@@ -190,7 +190,7 @@ int main(void) | |||
190 | 190 | ||
191 | { | 191 | { |
192 | // Create new conference, tox1 is the founder. | 192 | // Create new conference, tox1 is the founder. |
193 | TOX_ERR_CONFERENCE_NEW err; | 193 | Tox_Err_Conference_New err; |
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); |
@@ -199,7 +199,7 @@ int main(void) | |||
199 | 199 | ||
200 | { | 200 | { |
201 | // Invite friend. | 201 | // Invite friend. |
202 | TOX_ERR_CONFERENCE_INVITE err; | 202 | Tox_Err_Conference_Invite err; |
203 | tox_conference_invite(tox1, 0, state1.conference, &err); | 203 | tox_conference_invite(tox1, 0, state1.conference, &err); |
204 | ck_assert_msg(err == TOX_ERR_CONFERENCE_INVITE_OK, "failed to invite a friend: err = %d", err); | 204 | ck_assert_msg(err == TOX_ERR_CONFERENCE_INVITE_OK, "failed to invite a friend: err = %d", err); |
205 | state1.invited_next = true; | 205 | state1.invited_next = true; |
@@ -232,7 +232,7 @@ int main(void) | |||
232 | 232 | ||
233 | { | 233 | { |
234 | fprintf(stderr, "tox1 sends a message to the group: \"hello!\"\n"); | 234 | fprintf(stderr, "tox1 sends a message to the group: \"hello!\"\n"); |
235 | TOX_ERR_CONFERENCE_SEND_MESSAGE err; | 235 | Tox_Err_Conference_Send_Message err; |
236 | tox_conference_send_message(tox1, state1.conference, TOX_MESSAGE_TYPE_NORMAL, | 236 | tox_conference_send_message(tox1, state1.conference, TOX_MESSAGE_TYPE_NORMAL, |
237 | (const uint8_t *)"hello!", 7, &err); | 237 | (const uint8_t *)"hello!", 7, &err); |
238 | 238 | ||
diff --git a/auto_tests/conference_test.c b/auto_tests/conference_test.c index 824592c6..647b649d 100644 --- a/auto_tests/conference_test.c +++ b/auto_tests/conference_test.c | |||
@@ -33,7 +33,7 @@ typedef struct State { | |||
33 | #include "run_auto_test.h" | 33 | #include "run_auto_test.h" |
34 | 34 | ||
35 | static void handle_self_connection_status( | 35 | static void handle_self_connection_status( |
36 | Tox *tox, TOX_CONNECTION connection_status, void *user_data) | 36 | Tox *tox, Tox_Connection connection_status, void *user_data) |
37 | { | 37 | { |
38 | const State *state = (State *)user_data; | 38 | const State *state = (State *)user_data; |
39 | 39 | ||
@@ -45,7 +45,7 @@ static void handle_self_connection_status( | |||
45 | } | 45 | } |
46 | 46 | ||
47 | static void handle_friend_connection_status( | 47 | static void handle_friend_connection_status( |
48 | Tox *tox, uint32_t friendnumber, TOX_CONNECTION connection_status, void *user_data) | 48 | Tox *tox, uint32_t friendnumber, Tox_Connection connection_status, void *user_data) |
49 | { | 49 | { |
50 | const State *state = (State *)user_data; | 50 | const State *state = (State *)user_data; |
51 | 51 | ||
@@ -57,13 +57,13 @@ static void handle_friend_connection_status( | |||
57 | } | 57 | } |
58 | 58 | ||
59 | static void handle_conference_invite( | 59 | static void handle_conference_invite( |
60 | Tox *tox, uint32_t friendnumber, TOX_CONFERENCE_TYPE type, | 60 | Tox *tox, uint32_t friendnumber, Tox_Conference_Type type, |
61 | const uint8_t *data, size_t length, void *user_data) | 61 | const uint8_t *data, size_t length, void *user_data) |
62 | { | 62 | { |
63 | const State *state = (State *)user_data; | 63 | const State *state = (State *)user_data; |
64 | ck_assert_msg(type == TOX_CONFERENCE_TYPE_TEXT, "tox #%u: wrong conference type: %d", state->index, type); | 64 | ck_assert_msg(type == TOX_CONFERENCE_TYPE_TEXT, "tox #%u: wrong conference type: %d", state->index, type); |
65 | 65 | ||
66 | TOX_ERR_CONFERENCE_JOIN err; | 66 | Tox_Err_Conference_Join err; |
67 | uint32_t g_num = tox_conference_join(tox, friendnumber, data, length, &err); | 67 | uint32_t g_num = tox_conference_join(tox, friendnumber, data, length, &err); |
68 | 68 | ||
69 | ck_assert_msg(err == TOX_ERR_CONFERENCE_JOIN_OK, "tox #%u: error joining group: %d", state->index, err); | 69 | ck_assert_msg(err == TOX_ERR_CONFERENCE_JOIN_OK, "tox #%u: error joining group: %d", state->index, err); |
@@ -84,7 +84,7 @@ static void handle_conference_connected( | |||
84 | return; | 84 | return; |
85 | } | 85 | } |
86 | 86 | ||
87 | TOX_ERR_CONFERENCE_INVITE err; | 87 | Tox_Err_Conference_Invite err; |
88 | tox_conference_invite(tox, 1, 0, &err); | 88 | tox_conference_invite(tox, 1, 0, &err); |
89 | ck_assert_msg(err == TOX_ERR_CONFERENCE_INVITE_OK, "tox #%u failed to invite next friend: err = %d", state->index, err); | 89 | ck_assert_msg(err == TOX_ERR_CONFERENCE_INVITE_OK, "tox #%u failed to invite next friend: err = %d", state->index, err); |
90 | printf("tox #%u: invited next friend\n", state->index); | 90 | printf("tox #%u: invited next friend\n", state->index); |
@@ -94,7 +94,7 @@ static void handle_conference_connected( | |||
94 | static uint16_t num_recv; | 94 | static uint16_t num_recv; |
95 | 95 | ||
96 | static void handle_conference_message( | 96 | static void handle_conference_message( |
97 | Tox *tox, uint32_t groupnumber, uint32_t peernumber, TOX_MESSAGE_TYPE type, | 97 | Tox *tox, uint32_t groupnumber, uint32_t peernumber, Tox_Message_Type type, |
98 | const uint8_t *message, size_t length, void *user_data) | 98 | const uint8_t *message, size_t length, void *user_data) |
99 | { | 99 | { |
100 | if (length == (sizeof(GROUP_MESSAGE) - 1) && memcmp(message, GROUP_MESSAGE, sizeof(GROUP_MESSAGE) - 1) == 0) { | 100 | if (length == (sizeof(GROUP_MESSAGE) - 1) && memcmp(message, GROUP_MESSAGE, sizeof(GROUP_MESSAGE) - 1) == 0) { |
@@ -211,7 +211,7 @@ static void run_conference_tests(Tox **toxes, State *state) | |||
211 | iterate_all_wait(NUM_GROUP_TOX, toxes, state, ITERATION_INTERVAL); | 211 | iterate_all_wait(NUM_GROUP_TOX, toxes, state, ITERATION_INTERVAL); |
212 | } | 212 | } |
213 | 213 | ||
214 | TOX_ERR_CONFERENCE_SEND_MESSAGE err; | 214 | Tox_Err_Conference_Send_Message err; |
215 | ck_assert_msg( | 215 | ck_assert_msg( |
216 | tox_conference_send_message( | 216 | tox_conference_send_message( |
217 | toxes[random_u32() % NUM_GROUP_TOX], 0, TOX_MESSAGE_TYPE_NORMAL, (const uint8_t *)GROUP_MESSAGE, | 217 | toxes[random_u32() % NUM_GROUP_TOX], 0, TOX_MESSAGE_TYPE_NORMAL, (const uint8_t *)GROUP_MESSAGE, |
@@ -301,7 +301,7 @@ static void test_many_group(Tox **toxes, State *state) | |||
301 | iterate_all_wait(NUM_GROUP_TOX, toxes, state, ITERATION_INTERVAL); | 301 | iterate_all_wait(NUM_GROUP_TOX, toxes, state, ITERATION_INTERVAL); |
302 | 302 | ||
303 | for (uint16_t i = 0; i < NUM_GROUP_TOX; ++i) { | 303 | for (uint16_t i = 0; i < NUM_GROUP_TOX; ++i) { |
304 | TOX_ERR_CONFERENCE_PEER_QUERY err; | 304 | Tox_Err_Conference_Peer_Query err; |
305 | uint32_t peer_count = tox_conference_peer_count(toxes[i], 0, &err); | 305 | uint32_t peer_count = tox_conference_peer_count(toxes[i], 0, &err); |
306 | 306 | ||
307 | if (err != TOX_ERR_CONFERENCE_PEER_QUERY_OK) { | 307 | if (err != TOX_ERR_CONFERENCE_PEER_QUERY_OK) { |
diff --git a/auto_tests/conference_two_test.c b/auto_tests/conference_two_test.c index c6c3aa03..00c2d940 100644 --- a/auto_tests/conference_two_test.c +++ b/auto_tests/conference_two_test.c | |||
@@ -18,7 +18,7 @@ int main(void) | |||
18 | Tox *tox1 = tox_new_log(nullptr, nullptr, &id); | 18 | Tox *tox1 = tox_new_log(nullptr, nullptr, &id); |
19 | 19 | ||
20 | // Create two conferences and then exit. | 20 | // Create two conferences and then exit. |
21 | TOX_ERR_CONFERENCE_NEW err; | 21 | Tox_Err_Conference_New err; |
22 | tox_conference_new(tox1, &err); | 22 | tox_conference_new(tox1, &err); |
23 | ck_assert_msg(err == TOX_ERR_CONFERENCE_NEW_OK, "failed to create conference 1: %d", err); | 23 | ck_assert_msg(err == TOX_ERR_CONFERENCE_NEW_OK, "failed to create conference 1: %d", err); |
24 | tox_conference_new(tox1, &err); | 24 | tox_conference_new(tox1, &err); |
diff --git a/auto_tests/encryptsave_test.c b/auto_tests/encryptsave_test.c index bf7988e2..906bf3f8 100644 --- a/auto_tests/encryptsave_test.c +++ b/auto_tests/encryptsave_test.c | |||
@@ -70,7 +70,7 @@ static void test_save_friend(void) | |||
70 | tox_get_savedata(tox1, data); | 70 | tox_get_savedata(tox1, data); |
71 | size_t size2 = size + TOX_PASS_ENCRYPTION_EXTRA_LENGTH; | 71 | size_t size2 = size + TOX_PASS_ENCRYPTION_EXTRA_LENGTH; |
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: %d", 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"); |
@@ -79,13 +79,13 @@ static void test_save_friend(void) | |||
79 | tox_options_set_savedata_type(options, TOX_SAVEDATA_TYPE_TOX_SAVE); | 79 | tox_options_set_savedata_type(options, TOX_SAVEDATA_TYPE_TOX_SAVE); |
80 | tox_options_set_savedata_data(options, enc_data, size2); | 80 | tox_options_set_savedata_data(options, enc_data, size2); |
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! %d. should fail with %d", 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: %d", 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); |
@@ -99,7 +99,7 @@ static void test_save_friend(void) | |||
99 | size = tox_get_savedata_size(tox3); | 99 | size = tox_get_savedata_size(tox3); |
100 | VLA(uint8_t, data2, size); | 100 | VLA(uint8_t, data2, size); |
101 | tox_get_savedata(tox3, data2); | 101 | tox_get_savedata(tox3, data2); |
102 | TOX_ERR_KEY_DERIVATION keyerr; | 102 | Tox_Err_Key_Derivation keyerr; |
103 | Tox_Pass_Key *key = tox_pass_key_derive((const uint8_t *)"123qweasdzxc", 12, &keyerr); | 103 | Tox_Pass_Key *key = tox_pass_key_derive((const uint8_t *)"123qweasdzxc", 12, &keyerr); |
104 | ck_assert_msg(key != nullptr, "pass key allocation failure"); | 104 | ck_assert_msg(key != nullptr, "pass key allocation failure"); |
105 | memcpy((uint8_t *)key, test_salt, TOX_PASS_SALT_LENGTH); | 105 | memcpy((uint8_t *)key, test_salt, TOX_PASS_SALT_LENGTH); |
@@ -139,9 +139,9 @@ static void test_save_friend(void) | |||
139 | 139 | ||
140 | static void test_keys(void) | 140 | static void test_keys(void) |
141 | { | 141 | { |
142 | TOX_ERR_ENCRYPTION encerr; | 142 | Tox_Err_Encryption encerr; |
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: %d", 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 |
@@ -177,7 +177,7 @@ static void test_keys(void) | |||
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]; |
180 | TOX_ERR_GET_SALT salt_err; | 180 | Tox_Err_Get_Salt salt_err; |
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); |
diff --git a/auto_tests/file_saving_test.c b/auto_tests/file_saving_test.c index 1a345b23..19a21dfe 100644 --- a/auto_tests/file_saving_test.c +++ b/auto_tests/file_saving_test.c | |||
@@ -61,7 +61,7 @@ static void save_data_encrypted(void) | |||
61 | size += TOX_PASS_ENCRYPTION_EXTRA_LENGTH; | 61 | size += TOX_PASS_ENCRYPTION_EXTRA_LENGTH; |
62 | uint8_t *cipher = (uint8_t *)malloc(size); | 62 | uint8_t *cipher = (uint8_t *)malloc(size); |
63 | 63 | ||
64 | TOX_ERR_ENCRYPTION eerr; | 64 | Tox_Err_Encryption eerr; |
65 | 65 | ||
66 | ck_assert_msg(tox_pass_encrypt(clear, size - TOX_PASS_ENCRYPTION_EXTRA_LENGTH, (const uint8_t *)pphrase, | 66 | ck_assert_msg(tox_pass_encrypt(clear, size - TOX_PASS_ENCRYPTION_EXTRA_LENGTH, (const uint8_t *)pphrase, |
67 | strlen(pphrase), cipher, | 67 | strlen(pphrase), cipher, |
@@ -90,7 +90,7 @@ static void load_data_decrypted(void) | |||
90 | size_t read_value = fread(cipher, sizeof(*cipher), size, f); | 90 | size_t read_value = fread(cipher, sizeof(*cipher), size, f); |
91 | printf("Read read_value = %u of %u\n", (unsigned)read_value, (unsigned)size); | 91 | printf("Read read_value = %u of %u\n", (unsigned)read_value, (unsigned)size); |
92 | 92 | ||
93 | TOX_ERR_DECRYPTION derr; | 93 | Tox_Err_Decryption derr; |
94 | 94 | ||
95 | ck_assert_msg(tox_pass_decrypt(cipher, size, (const uint8_t *)pphrase, strlen(pphrase), clear, &derr), | 95 | ck_assert_msg(tox_pass_decrypt(cipher, size, (const uint8_t *)pphrase, strlen(pphrase), clear, &derr), |
96 | "Could not decrypt, error code %d.", derr); | 96 | "Could not decrypt, error code %d.", derr); |
@@ -101,7 +101,7 @@ static void load_data_decrypted(void) | |||
101 | 101 | ||
102 | tox_options_set_savedata_data(options, clear, size); | 102 | tox_options_set_savedata_data(options, clear, size); |
103 | 103 | ||
104 | TOX_ERR_NEW err; | 104 | Tox_Err_New err; |
105 | 105 | ||
106 | Tox *t = tox_new_log(options, &err, nullptr); | 106 | Tox *t = tox_new_log(options, &err, nullptr); |
107 | 107 | ||
diff --git a/auto_tests/file_transfer_test.c b/auto_tests/file_transfer_test.c index 2e791662..ac1b046c 100644 --- a/auto_tests/file_transfer_test.c +++ b/auto_tests/file_transfer_test.c | |||
@@ -60,7 +60,7 @@ static void tox_file_receive(Tox *tox, uint32_t friend_number, uint32_t file_num | |||
60 | if (filesize) { | 60 | if (filesize) { |
61 | sending_pos = size_recv = 1337; | 61 | sending_pos = size_recv = 1337; |
62 | 62 | ||
63 | TOX_ERR_FILE_SEEK err_s; | 63 | Tox_Err_File_Seek err_s; |
64 | 64 | ||
65 | ck_assert_msg(tox_file_seek(tox, friend_number, file_number, 1337, &err_s), "tox_file_seek error"); | 65 | ck_assert_msg(tox_file_seek(tox, friend_number, file_number, 1337, &err_s), "tox_file_seek error"); |
66 | 66 | ||
@@ -70,13 +70,13 @@ static void tox_file_receive(Tox *tox, uint32_t friend_number, uint32_t file_num | |||
70 | sending_pos = size_recv = 0; | 70 | sending_pos = size_recv = 0; |
71 | } | 71 | } |
72 | 72 | ||
73 | TOX_ERR_FILE_CONTROL error; | 73 | Tox_Err_File_Control error; |
74 | 74 | ||
75 | ck_assert_msg(tox_file_control(tox, friend_number, file_number, TOX_FILE_CONTROL_RESUME, &error), | 75 | ck_assert_msg(tox_file_control(tox, friend_number, file_number, TOX_FILE_CONTROL_RESUME, &error), |
76 | "tox_file_control failed. %i", error); | 76 | "tox_file_control failed. %i", error); |
77 | ++file_accepted; | 77 | ++file_accepted; |
78 | 78 | ||
79 | TOX_ERR_FILE_SEEK err_s; | 79 | Tox_Err_File_Seek err_s; |
80 | 80 | ||
81 | ck_assert_msg(!tox_file_seek(tox, friend_number, file_number, 1234, &err_s), "tox_file_seek no error"); | 81 | ck_assert_msg(!tox_file_seek(tox, friend_number, file_number, 1234, &err_s), "tox_file_seek no error"); |
82 | 82 | ||
@@ -84,7 +84,7 @@ static void tox_file_receive(Tox *tox, uint32_t friend_number, uint32_t file_num | |||
84 | } | 84 | } |
85 | 85 | ||
86 | static uint32_t sendf_ok; | 86 | static uint32_t sendf_ok; |
87 | static void file_print_control(Tox *tox, uint32_t friend_number, uint32_t file_number, TOX_FILE_CONTROL control, | 87 | static void file_print_control(Tox *tox, uint32_t friend_number, uint32_t file_number, Tox_File_Control control, |
88 | void *userdata) | 88 | void *userdata) |
89 | { | 89 | { |
90 | /* First send file num is 0.*/ | 90 | /* First send file num is 0.*/ |
@@ -121,7 +121,7 @@ static void tox_file_chunk_request(Tox *tox, uint32_t friend_number, uint32_t fi | |||
121 | VLA(uint8_t, f_data, length); | 121 | VLA(uint8_t, f_data, length); |
122 | memset(f_data, sending_num, length); | 122 | memset(f_data, sending_num, length); |
123 | 123 | ||
124 | TOX_ERR_FILE_SEND_CHUNK error; | 124 | Tox_Err_File_Send_Chunk error; |
125 | tox_file_send_chunk(tox, friend_number, file_number, position, f_data, length, &error); | 125 | tox_file_send_chunk(tox, friend_number, file_number, position, f_data, length, &error); |
126 | 126 | ||
127 | 127 | ||
@@ -159,7 +159,7 @@ static void file_transfer_test(void) | |||
159 | printf("Starting test: few_clients\n"); | 159 | printf("Starting test: few_clients\n"); |
160 | uint32_t index[] = { 1, 2, 3 }; | 160 | uint32_t index[] = { 1, 2, 3 }; |
161 | long long unsigned int cur_time = time(nullptr); | 161 | long long unsigned int cur_time = time(nullptr); |
162 | TOX_ERR_NEW t_n_error; | 162 | Tox_Err_New t_n_error; |
163 | Tox *tox1 = tox_new_log(nullptr, &t_n_error, &index[0]); | 163 | Tox *tox1 = tox_new_log(nullptr, &t_n_error, &index[0]); |
164 | ck_assert_msg(t_n_error == TOX_ERR_NEW_OK, "wrong error"); | 164 | ck_assert_msg(t_n_error == TOX_ERR_NEW_OK, "wrong error"); |
165 | Tox *tox2 = tox_new_log(nullptr, &t_n_error, &index[1]); | 165 | Tox *tox2 = tox_new_log(nullptr, &t_n_error, &index[1]); |
@@ -218,7 +218,7 @@ static void file_transfer_test(void) | |||
218 | sizeof("Gentoo.exe"), nullptr); | 218 | sizeof("Gentoo.exe"), nullptr); |
219 | ck_assert_msg(fnum != UINT32_MAX, "tox_new_file_sender fail"); | 219 | ck_assert_msg(fnum != UINT32_MAX, "tox_new_file_sender fail"); |
220 | 220 | ||
221 | TOX_ERR_FILE_GET gfierr; | 221 | Tox_Err_File_Get gfierr; |
222 | ck_assert_msg(!tox_file_get_file_id(tox2, 1, fnum, file_cmp_id, &gfierr), "tox_file_get_file_id didn't fail"); | 222 | ck_assert_msg(!tox_file_get_file_id(tox2, 1, fnum, file_cmp_id, &gfierr), "tox_file_get_file_id didn't fail"); |
223 | ck_assert_msg(gfierr == TOX_ERR_FILE_GET_FRIEND_NOT_FOUND, "wrong error"); | 223 | ck_assert_msg(gfierr == TOX_ERR_FILE_GET_FRIEND_NOT_FOUND, "wrong error"); |
224 | ck_assert_msg(!tox_file_get_file_id(tox2, 0, fnum + 1, file_cmp_id, &gfierr), "tox_file_get_file_id didn't fail"); | 224 | ck_assert_msg(!tox_file_get_file_id(tox2, 0, fnum + 1, file_cmp_id, &gfierr), "tox_file_get_file_id didn't fail"); |
diff --git a/auto_tests/invalid_tcp_proxy_test.c b/auto_tests/invalid_tcp_proxy_test.c index b0d60f2d..45290a43 100644 --- a/auto_tests/invalid_tcp_proxy_test.c +++ b/auto_tests/invalid_tcp_proxy_test.c | |||
@@ -41,7 +41,7 @@ int main(void) | |||
41 | tox_iterate(tox, nullptr); | 41 | tox_iterate(tox, nullptr); |
42 | c_sleep(ITERATION_INTERVAL); | 42 | c_sleep(ITERATION_INTERVAL); |
43 | // None of the iterations should have a connection. | 43 | // None of the iterations should have a connection. |
44 | const TOX_CONNECTION status = tox_self_get_connection_status(tox); | 44 | const Tox_Connection status = tox_self_get_connection_status(tox); |
45 | ck_assert_msg(status == TOX_CONNECTION_NONE, | 45 | ck_assert_msg(status == TOX_CONNECTION_NONE, |
46 | "unexpectedly got a connection (%d)", status); | 46 | "unexpectedly got a connection (%d)", status); |
47 | } | 47 | } |
diff --git a/auto_tests/invalid_udp_proxy_test.c b/auto_tests/invalid_udp_proxy_test.c index 96c8197b..1e84e451 100644 --- a/auto_tests/invalid_udp_proxy_test.c +++ b/auto_tests/invalid_udp_proxy_test.c | |||
@@ -41,7 +41,7 @@ int main(void) | |||
41 | tox_iterate(tox, nullptr); | 41 | tox_iterate(tox, nullptr); |
42 | c_sleep(ITERATION_INTERVAL); | 42 | c_sleep(ITERATION_INTERVAL); |
43 | // None of the iterations should have a connection. | 43 | // None of the iterations should have a connection. |
44 | const TOX_CONNECTION status = tox_self_get_connection_status(tox); | 44 | const Tox_Connection status = tox_self_get_connection_status(tox); |
45 | ck_assert_msg(status == TOX_CONNECTION_NONE, | 45 | ck_assert_msg(status == TOX_CONNECTION_NONE, |
46 | "unexpectedly got a connection (%d)", status); | 46 | "unexpectedly got a connection (%d)", status); |
47 | } | 47 | } |
diff --git a/auto_tests/overflow_recvq_test.c b/auto_tests/overflow_recvq_test.c index 3f7561e1..205dbb11 100644 --- a/auto_tests/overflow_recvq_test.c +++ b/auto_tests/overflow_recvq_test.c | |||
@@ -18,7 +18,7 @@ typedef struct State { | |||
18 | 18 | ||
19 | #define NUM_MSGS 40000 | 19 | #define NUM_MSGS 40000 |
20 | 20 | ||
21 | static void handle_friend_message(Tox *tox, uint32_t friend_number, TOX_MESSAGE_TYPE type, | 21 | static void handle_friend_message(Tox *tox, uint32_t friend_number, Tox_Message_Type type, |
22 | const uint8_t *message, size_t length, void *user_data) | 22 | const uint8_t *message, size_t length, void *user_data) |
23 | { | 23 | { |
24 | State *state = (State *)user_data; | 24 | State *state = (State *)user_data; |
@@ -36,7 +36,7 @@ static void net_crypto_overflow_test(Tox **toxes, State *state) | |||
36 | uint8_t message[128] = {0}; | 36 | uint8_t message[128] = {0}; |
37 | snprintf((char *)message, sizeof(message), "%u-%u", tox_index, i); | 37 | snprintf((char *)message, sizeof(message), "%u-%u", tox_index, i); |
38 | 38 | ||
39 | TOX_ERR_FRIEND_SEND_MESSAGE err; | 39 | Tox_Err_Friend_Send_Message err; |
40 | tox_friend_send_message(toxes[tox_index], 0, TOX_MESSAGE_TYPE_NORMAL, message, sizeof message, &err); | 40 | tox_friend_send_message(toxes[tox_index], 0, TOX_MESSAGE_TYPE_NORMAL, message, sizeof message, &err); |
41 | 41 | ||
42 | if (err == TOX_ERR_FRIEND_SEND_MESSAGE_SENDQ) { | 42 | if (err == TOX_ERR_FRIEND_SEND_MESSAGE_SENDQ) { |
diff --git a/auto_tests/overflow_sendq_test.c b/auto_tests/overflow_sendq_test.c index e67da1cf..9601c876 100644 --- a/auto_tests/overflow_sendq_test.c +++ b/auto_tests/overflow_sendq_test.c | |||
@@ -22,7 +22,7 @@ static void net_crypto_overflow_test(Tox **toxes, State *state) | |||
22 | bool errored = false; | 22 | bool errored = false; |
23 | 23 | ||
24 | for (uint32_t i = 0; i < NUM_MSGS; i++) { | 24 | for (uint32_t i = 0; i < NUM_MSGS; i++) { |
25 | TOX_ERR_FRIEND_SEND_MESSAGE err; | 25 | Tox_Err_Friend_Send_Message err; |
26 | tox_friend_send_message(toxes[0], 0, TOX_MESSAGE_TYPE_NORMAL, message, sizeof message, &err); | 26 | tox_friend_send_message(toxes[0], 0, TOX_MESSAGE_TYPE_NORMAL, message, sizeof message, &err); |
27 | 27 | ||
28 | if (err != TOX_ERR_FRIEND_SEND_MESSAGE_OK) { | 28 | if (err != TOX_ERR_FRIEND_SEND_MESSAGE_OK) { |
diff --git a/auto_tests/save_friend_test.c b/auto_tests/save_friend_test.c index 07753127..210dd2bf 100644 --- a/auto_tests/save_friend_test.c +++ b/auto_tests/save_friend_test.c | |||
@@ -22,7 +22,7 @@ struct test_data { | |||
22 | bool received_status_message; | 22 | bool received_status_message; |
23 | }; | 23 | }; |
24 | 24 | ||
25 | static void set_random(Tox *m, bool (*setter)(Tox *, const uint8_t *, size_t, TOX_ERR_SET_INFO *), size_t length) | 25 | static void set_random(Tox *m, bool (*setter)(Tox *, const uint8_t *, size_t, Tox_Err_Set_Info *), size_t length) |
26 | { | 26 | { |
27 | VLA(uint8_t, text, length); | 27 | VLA(uint8_t, text, length); |
28 | uint32_t i; | 28 | uint32_t i; |
diff --git a/auto_tests/save_load_test.c b/auto_tests/save_load_test.c index 9c171602..cdaf3d3d 100644 --- a/auto_tests/save_load_test.c +++ b/auto_tests/save_load_test.c | |||
@@ -24,7 +24,7 @@ static void accept_friend_request(Tox *m, const uint8_t *public_key, const uint8 | |||
24 | } | 24 | } |
25 | 25 | ||
26 | static unsigned int connected_t1; | 26 | static unsigned int connected_t1; |
27 | static void tox_connection_status(Tox *tox, TOX_CONNECTION connection_status, void *user_data) | 27 | static void tox_connection_status(Tox *tox, Tox_Connection connection_status, void *user_data) |
28 | { | 28 | { |
29 | if (connected_t1 && !connection_status) { | 29 | if (connected_t1 && !connection_status) { |
30 | ck_abort_msg("Tox went offline"); | 30 | ck_abort_msg("Tox went offline"); |
diff --git a/auto_tests/send_message_test.c b/auto_tests/send_message_test.c index 5346dc9e..8e41006b 100644 --- a/auto_tests/send_message_test.c +++ b/auto_tests/send_message_test.c | |||
@@ -21,7 +21,7 @@ typedef struct State { | |||
21 | #define MESSAGE_FILLER 'G' | 21 | #define MESSAGE_FILLER 'G' |
22 | 22 | ||
23 | static void message_callback( | 23 | static void message_callback( |
24 | Tox *m, uint32_t friendnumber, TOX_MESSAGE_TYPE type, | 24 | Tox *m, uint32_t friendnumber, Tox_Message_Type type, |
25 | const uint8_t *string, size_t length, void *userdata) | 25 | const uint8_t *string, size_t length, void *userdata) |
26 | { | 26 | { |
27 | State *state = (State *)userdata; | 27 | State *state = (State *)userdata; |
@@ -45,7 +45,7 @@ static void send_message_test(Tox **toxes, State *state) | |||
45 | uint8_t msgs[TOX_MAX_MESSAGE_LENGTH + 1]; | 45 | uint8_t msgs[TOX_MAX_MESSAGE_LENGTH + 1]; |
46 | memset(msgs, MESSAGE_FILLER, sizeof(msgs)); | 46 | memset(msgs, MESSAGE_FILLER, sizeof(msgs)); |
47 | 47 | ||
48 | TOX_ERR_FRIEND_SEND_MESSAGE errm; | 48 | Tox_Err_Friend_Send_Message errm; |
49 | tox_friend_send_message(toxes[0], 0, TOX_MESSAGE_TYPE_NORMAL, msgs, TOX_MAX_MESSAGE_LENGTH + 1, &errm); | 49 | tox_friend_send_message(toxes[0], 0, TOX_MESSAGE_TYPE_NORMAL, msgs, TOX_MAX_MESSAGE_LENGTH + 1, &errm); |
50 | ck_assert_msg(errm == TOX_ERR_FRIEND_SEND_MESSAGE_TOO_LONG, "TOX_MAX_MESSAGE_LENGTH is too small? error=%d", errm); | 50 | ck_assert_msg(errm == TOX_ERR_FRIEND_SEND_MESSAGE_TOO_LONG, "TOX_MAX_MESSAGE_LENGTH is too small? error=%d", errm); |
51 | 51 | ||
diff --git a/auto_tests/set_name_test.c b/auto_tests/set_name_test.c index 1e35aa30..4f046e90 100644 --- a/auto_tests/set_name_test.c +++ b/auto_tests/set_name_test.c | |||
@@ -69,7 +69,7 @@ static void test_set_name(void) | |||
69 | printf("tox clients connected took %lu seconds\n", (unsigned long)(time(nullptr) - con_time)); | 69 | printf("tox clients connected took %lu seconds\n", (unsigned long)(time(nullptr) - con_time)); |
70 | 70 | ||
71 | tox_callback_friend_name(tox2, nickchange_callback); | 71 | tox_callback_friend_name(tox2, nickchange_callback); |
72 | TOX_ERR_SET_INFO err_n; | 72 | Tox_Err_Set_Info err_n; |
73 | bool ret = tox_self_set_name(tox1, (const uint8_t *)NICKNAME, sizeof(NICKNAME), &err_n); | 73 | bool ret = tox_self_set_name(tox1, (const uint8_t *)NICKNAME, sizeof(NICKNAME), &err_n); |
74 | ck_assert_msg(ret && err_n == TOX_ERR_SET_INFO_OK, "tox_self_set_name failed because %u\n", err_n); | 74 | ck_assert_msg(ret && err_n == TOX_ERR_SET_INFO_OK, "tox_self_set_name failed because %u\n", err_n); |
75 | 75 | ||
diff --git a/auto_tests/set_status_message_test.c b/auto_tests/set_status_message_test.c index 1ef8ae56..9cf26754 100644 --- a/auto_tests/set_status_message_test.c +++ b/auto_tests/set_status_message_test.c | |||
@@ -72,7 +72,7 @@ static void test_set_status_message(void) | |||
72 | 72 | ||
73 | printf("tox clients connected took %lu seconds\n", (unsigned long)(time(nullptr) - con_time)); | 73 | printf("tox clients connected took %lu seconds\n", (unsigned long)(time(nullptr) - con_time)); |
74 | 74 | ||
75 | TOX_ERR_SET_INFO err_n; | 75 | Tox_Err_Set_Info err_n; |
76 | tox_callback_friend_status_message(tox2, status_callback); | 76 | tox_callback_friend_status_message(tox2, status_callback); |
77 | bool ret = tox_self_set_status_message(tox1, (const uint8_t *)STATUS_MESSAGE, sizeof(STATUS_MESSAGE), | 77 | bool ret = tox_self_set_status_message(tox1, (const uint8_t *)STATUS_MESSAGE, sizeof(STATUS_MESSAGE), |
78 | &err_n); | 78 | &err_n); |
diff --git a/auto_tests/tcp_relay_test.c b/auto_tests/tcp_relay_test.c index f2035f35..79387291 100644 --- a/auto_tests/tcp_relay_test.c +++ b/auto_tests/tcp_relay_test.c | |||
@@ -36,7 +36,7 @@ int main(void) | |||
36 | c_sleep(ITERATION_INTERVAL); | 36 | c_sleep(ITERATION_INTERVAL); |
37 | } while (tox_self_get_connection_status(tox_tcp) == TOX_CONNECTION_NONE); | 37 | } while (tox_self_get_connection_status(tox_tcp) == TOX_CONNECTION_NONE); |
38 | 38 | ||
39 | const TOX_CONNECTION status = tox_self_get_connection_status(tox_tcp); | 39 | const Tox_Connection status = tox_self_get_connection_status(tox_tcp); |
40 | ck_assert_msg(status == TOX_CONNECTION_TCP, | 40 | ck_assert_msg(status == TOX_CONNECTION_TCP, |
41 | "expected TCP connection, but got %d", status); | 41 | "expected TCP connection, but got %d", status); |
42 | printf("Connection (TCP): %d\n", status); | 42 | printf("Connection (TCP): %d\n", status); |
diff --git a/auto_tests/tox_many_tcp_test.c b/auto_tests/tox_many_tcp_test.c index e09ed8fb..77eef929 100644 --- a/auto_tests/tox_many_tcp_test.c +++ b/auto_tests/tox_many_tcp_test.c | |||
@@ -62,7 +62,7 @@ START_TEST(test_many_clients_tcp) | |||
62 | tox_callback_friend_request(toxes[i], accept_friend_request); | 62 | tox_callback_friend_request(toxes[i], accept_friend_request); |
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, %u, %d", 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); |
@@ -91,7 +91,7 @@ loop_top: | |||
91 | 91 | ||
92 | tox_self_get_address(toxes[pairs[i].tox1], address); | 92 | tox_self_get_address(toxes[pairs[i].tox1], address); |
93 | 93 | ||
94 | TOX_ERR_FRIEND_ADD test; | 94 | Tox_Err_Friend_Add test; |
95 | uint32_t num = tox_friend_add(toxes[pairs[i].tox2], address, (const uint8_t *)"Gentoo", 7, &test); | 95 | uint32_t num = tox_friend_add(toxes[pairs[i].tox2], address, (const uint8_t *)"Gentoo", 7, &test); |
96 | 96 | ||
97 | if (test == TOX_ERR_FRIEND_ADD_ALREADY_SENT) { | 97 | if (test == TOX_ERR_FRIEND_ADD_ALREADY_SENT) { |
@@ -185,7 +185,7 @@ loop_top: | |||
185 | 185 | ||
186 | tox_self_get_address(toxes[pairs[i].tox1], address); | 186 | tox_self_get_address(toxes[pairs[i].tox1], address); |
187 | 187 | ||
188 | TOX_ERR_FRIEND_ADD test; | 188 | Tox_Err_Friend_Add test; |
189 | uint32_t num = tox_friend_add(toxes[pairs[i].tox2], address, (const uint8_t *)"Gentoo", 7, &test); | 189 | uint32_t num = tox_friend_add(toxes[pairs[i].tox2], address, (const uint8_t *)"Gentoo", 7, &test); |
190 | 190 | ||
191 | if (test == TOX_ERR_FRIEND_ADD_ALREADY_SENT) { | 191 | if (test == TOX_ERR_FRIEND_ADD_ALREADY_SENT) { |
diff --git a/auto_tests/tox_many_test.c b/auto_tests/tox_many_test.c index 6a2f5485..59ade859 100644 --- a/auto_tests/tox_many_test.c +++ b/auto_tests/tox_many_test.c | |||
@@ -68,7 +68,7 @@ loop_top: | |||
68 | 68 | ||
69 | tox_self_get_address(toxes[pairs[i].tox1], address); | 69 | tox_self_get_address(toxes[pairs[i].tox1], address); |
70 | 70 | ||
71 | TOX_ERR_FRIEND_ADD test; | 71 | Tox_Err_Friend_Add test; |
72 | uint32_t num = tox_friend_add(toxes[pairs[i].tox2], address, (const uint8_t *)"Gentoo", 7, &test); | 72 | uint32_t num = tox_friend_add(toxes[pairs[i].tox2], address, (const uint8_t *)"Gentoo", 7, &test); |
73 | 73 | ||
74 | if (test == TOX_ERR_FRIEND_ADD_ALREADY_SENT) { | 74 | if (test == TOX_ERR_FRIEND_ADD_ALREADY_SENT) { |
diff --git a/auto_tests/tox_one_test.c b/auto_tests/tox_one_test.c index 28f18c29..62486acb 100644 --- a/auto_tests/tox_one_test.c +++ b/auto_tests/tox_one_test.c | |||
@@ -44,7 +44,7 @@ static void test_one(void) | |||
44 | 44 | ||
45 | uint8_t address[TOX_ADDRESS_SIZE]; | 45 | uint8_t address[TOX_ADDRESS_SIZE]; |
46 | tox_self_get_address(tox1, address); | 46 | tox_self_get_address(tox1, address); |
47 | TOX_ERR_FRIEND_ADD error; | 47 | Tox_Err_Friend_Add error; |
48 | uint32_t ret = tox_friend_add(tox1, address, (const uint8_t *)"m", 1, &error); | 48 | uint32_t ret = tox_friend_add(tox1, address, (const uint8_t *)"m", 1, &error); |
49 | ck_assert_msg(ret == UINT32_MAX && error == TOX_ERR_FRIEND_ADD_OWN_KEY, "Adding own address worked."); | 49 | ck_assert_msg(ret == UINT32_MAX && error == TOX_ERR_FRIEND_ADD_OWN_KEY, "Adding own address worked."); |
50 | 50 | ||
@@ -82,7 +82,7 @@ static void test_one(void) | |||
82 | tox_get_savedata(tox1, data); | 82 | tox_get_savedata(tox1, data); |
83 | 83 | ||
84 | tox_kill(tox2); | 84 | tox_kill(tox2); |
85 | TOX_ERR_NEW err_n; | 85 | Tox_Err_New err_n; |
86 | 86 | ||
87 | struct Tox_Options *options = tox_options_new(nullptr); | 87 | struct Tox_Options *options = tox_options_new(nullptr); |
88 | tox_options_set_savedata_type(options, TOX_SAVEDATA_TYPE_TOX_SAVE); | 88 | tox_options_set_savedata_type(options, TOX_SAVEDATA_TYPE_TOX_SAVE); |
diff --git a/auto_tests/toxav_basic_test.c b/auto_tests/toxav_basic_test.c index 048b54a5..5c6daefa 100644 --- a/auto_tests/toxav_basic_test.c +++ b/auto_tests/toxav_basic_test.c | |||
@@ -28,7 +28,7 @@ | |||
28 | 28 | ||
29 | 29 | ||
30 | #define ck_assert_call_control(a, b, c) do { \ | 30 | #define ck_assert_call_control(a, b, c) do { \ |
31 | TOXAV_ERR_CALL_CONTROL cc_err; \ | 31 | Toxav_Err_Call_Control cc_err; \ |
32 | bool ok = toxav_call_control(a, b, c, &cc_err); \ | 32 | bool ok = toxav_call_control(a, b, c, &cc_err); \ |
33 | if (!ok) { \ | 33 | if (!ok) { \ |
34 | printf("toxav_call_control returned error %d\n", cc_err); \ | 34 | printf("toxav_call_control returned error %d\n", cc_err); \ |
@@ -113,7 +113,7 @@ static void regular_call_flow( | |||
113 | clear_call_control(AliceCC); | 113 | clear_call_control(AliceCC); |
114 | clear_call_control(BobCC); | 114 | clear_call_control(BobCC); |
115 | 115 | ||
116 | TOXAV_ERR_CALL call_err; | 116 | Toxav_Err_Call call_err; |
117 | toxav_call(AliceAV, 0, a_br, v_br, &call_err); | 117 | toxav_call(AliceAV, 0, a_br, v_br, &call_err); |
118 | 118 | ||
119 | if (call_err != TOXAV_ERR_CALL_OK) { | 119 | if (call_err != TOXAV_ERR_CALL_OK) { |
@@ -125,7 +125,7 @@ static void regular_call_flow( | |||
125 | 125 | ||
126 | do { | 126 | do { |
127 | if (BobCC->incoming) { | 127 | if (BobCC->incoming) { |
128 | TOXAV_ERR_ANSWER answer_err; | 128 | Toxav_Err_Answer answer_err; |
129 | toxav_answer(BobAV, 0, a_br, v_br, &answer_err); | 129 | toxav_answer(BobAV, 0, a_br, v_br, &answer_err); |
130 | 130 | ||
131 | if (answer_err != TOXAV_ERR_ANSWER_OK) { | 131 | if (answer_err != TOXAV_ERR_ANSWER_OK) { |
@@ -137,7 +137,7 @@ static void regular_call_flow( | |||
137 | } else { /* TODO(mannol): rtp */ | 137 | } else { /* TODO(mannol): rtp */ |
138 | if (time(nullptr) - start_time >= 1) { | 138 | if (time(nullptr) - start_time >= 1) { |
139 | 139 | ||
140 | TOXAV_ERR_CALL_CONTROL cc_err; | 140 | Toxav_Err_Call_Control cc_err; |
141 | toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_CANCEL, &cc_err); | 141 | toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_CANCEL, &cc_err); |
142 | 142 | ||
143 | if (cc_err != TOXAV_ERR_CALL_CONTROL_OK) { | 143 | if (cc_err != TOXAV_ERR_CALL_CONTROL_OK) { |
@@ -162,7 +162,7 @@ static void test_av_flows(void) | |||
162 | CallControl AliceCC, BobCC; | 162 | CallControl AliceCC, BobCC; |
163 | 163 | ||
164 | { | 164 | { |
165 | TOX_ERR_NEW error; | 165 | Tox_Err_New error; |
166 | 166 | ||
167 | bootstrap = tox_new_log(nullptr, &error, &index[0]); | 167 | bootstrap = tox_new_log(nullptr, &error, &index[0]); |
168 | ck_assert(error == TOX_ERR_NEW_OK); | 168 | ck_assert(error == TOX_ERR_NEW_OK); |
@@ -215,7 +215,7 @@ static void test_av_flows(void) | |||
215 | 215 | ||
216 | 216 | ||
217 | { | 217 | { |
218 | TOXAV_ERR_NEW error; | 218 | Toxav_Err_New error; |
219 | AliceAV = toxav_new(Alice, &error); | 219 | AliceAV = toxav_new(Alice, &error); |
220 | ck_assert(error == TOXAV_ERR_NEW_OK); | 220 | ck_assert(error == TOXAV_ERR_NEW_OK); |
221 | 221 | ||
@@ -261,7 +261,7 @@ static void test_av_flows(void) | |||
261 | clear_call_control(&BobCC); | 261 | clear_call_control(&BobCC); |
262 | 262 | ||
263 | { | 263 | { |
264 | TOXAV_ERR_CALL rc; | 264 | Toxav_Err_Call rc; |
265 | toxav_call(AliceAV, 0, 48, 0, &rc); | 265 | toxav_call(AliceAV, 0, 48, 0, &rc); |
266 | 266 | ||
267 | if (rc != TOXAV_ERR_CALL_OK) { | 267 | if (rc != TOXAV_ERR_CALL_OK) { |
@@ -276,7 +276,7 @@ static void test_av_flows(void) | |||
276 | 276 | ||
277 | /* Reject */ | 277 | /* Reject */ |
278 | { | 278 | { |
279 | TOXAV_ERR_CALL_CONTROL rc; | 279 | Toxav_Err_Call_Control rc; |
280 | toxav_call_control(BobAV, 0, TOXAV_CALL_CONTROL_CANCEL, &rc); | 280 | toxav_call_control(BobAV, 0, TOXAV_CALL_CONTROL_CANCEL, &rc); |
281 | 281 | ||
282 | if (rc != TOXAV_ERR_CALL_CONTROL_OK) { | 282 | if (rc != TOXAV_ERR_CALL_CONTROL_OK) { |
@@ -299,7 +299,7 @@ static void test_av_flows(void) | |||
299 | clear_call_control(&BobCC); | 299 | clear_call_control(&BobCC); |
300 | 300 | ||
301 | { | 301 | { |
302 | TOXAV_ERR_CALL rc; | 302 | Toxav_Err_Call rc; |
303 | toxav_call(AliceAV, 0, 48, 0, &rc); | 303 | toxav_call(AliceAV, 0, 48, 0, &rc); |
304 | 304 | ||
305 | if (rc != TOXAV_ERR_CALL_OK) { | 305 | if (rc != TOXAV_ERR_CALL_OK) { |
@@ -314,7 +314,7 @@ static void test_av_flows(void) | |||
314 | 314 | ||
315 | /* Cancel */ | 315 | /* Cancel */ |
316 | { | 316 | { |
317 | TOXAV_ERR_CALL_CONTROL rc; | 317 | Toxav_Err_Call_Control rc; |
318 | toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_CANCEL, &rc); | 318 | toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_CANCEL, &rc); |
319 | 319 | ||
320 | if (rc != TOXAV_ERR_CALL_CONTROL_OK) { | 320 | if (rc != TOXAV_ERR_CALL_CONTROL_OK) { |
@@ -339,7 +339,7 @@ static void test_av_flows(void) | |||
339 | 339 | ||
340 | /* Assume sending audio and video */ | 340 | /* Assume sending audio and video */ |
341 | { | 341 | { |
342 | TOXAV_ERR_CALL rc; | 342 | Toxav_Err_Call rc; |
343 | toxav_call(AliceAV, 0, 48, 1000, &rc); | 343 | toxav_call(AliceAV, 0, 48, 1000, &rc); |
344 | 344 | ||
345 | if (rc != TOXAV_ERR_CALL_OK) { | 345 | if (rc != TOXAV_ERR_CALL_OK) { |
@@ -361,7 +361,7 @@ static void test_av_flows(void) | |||
361 | ck_assert(!toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_SHOW_VIDEO, nullptr)); | 361 | ck_assert(!toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_SHOW_VIDEO, nullptr)); |
362 | 362 | ||
363 | { | 363 | { |
364 | TOXAV_ERR_ANSWER rc; | 364 | Toxav_Err_Answer rc; |
365 | toxav_answer(BobAV, 0, 48, 4000, &rc); | 365 | toxav_answer(BobAV, 0, 48, 4000, &rc); |
366 | 366 | ||
367 | if (rc != TOXAV_ERR_ANSWER_OK) { | 367 | if (rc != TOXAV_ERR_ANSWER_OK) { |
@@ -406,7 +406,7 @@ static void test_av_flows(void) | |||
406 | ck_assert(BobCC.state & TOXAV_FRIEND_CALL_STATE_ACCEPTING_V); | 406 | ck_assert(BobCC.state & TOXAV_FRIEND_CALL_STATE_ACCEPTING_V); |
407 | 407 | ||
408 | { | 408 | { |
409 | TOXAV_ERR_CALL_CONTROL rc; | 409 | Toxav_Err_Call_Control rc; |
410 | toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_CANCEL, &rc); | 410 | toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_CANCEL, &rc); |
411 | 411 | ||
412 | if (rc != TOXAV_ERR_CALL_CONTROL_OK) { | 412 | if (rc != TOXAV_ERR_CALL_CONTROL_OK) { |
@@ -429,7 +429,7 @@ static void test_av_flows(void) | |||
429 | 429 | ||
430 | /* Assume sending audio and video */ | 430 | /* Assume sending audio and video */ |
431 | { | 431 | { |
432 | TOXAV_ERR_CALL rc; | 432 | Toxav_Err_Call rc; |
433 | toxav_call(AliceAV, 0, 48, 0, &rc); | 433 | toxav_call(AliceAV, 0, 48, 0, &rc); |
434 | 434 | ||
435 | if (rc != TOXAV_ERR_CALL_OK) { | 435 | if (rc != TOXAV_ERR_CALL_OK) { |
@@ -443,7 +443,7 @@ static void test_av_flows(void) | |||
443 | } while (!BobCC.incoming); | 443 | } while (!BobCC.incoming); |
444 | 444 | ||
445 | { | 445 | { |
446 | TOXAV_ERR_ANSWER rc; | 446 | Toxav_Err_Answer rc; |
447 | toxav_answer(BobAV, 0, 48, 0, &rc); | 447 | toxav_answer(BobAV, 0, 48, 0, &rc); |
448 | 448 | ||
449 | if (rc != TOXAV_ERR_ANSWER_OK) { | 449 | if (rc != TOXAV_ERR_ANSWER_OK) { |
@@ -474,7 +474,7 @@ static void test_av_flows(void) | |||
474 | ck_assert(!(BobCC.state & TOXAV_FRIEND_CALL_STATE_SENDING_A)); | 474 | ck_assert(!(BobCC.state & TOXAV_FRIEND_CALL_STATE_SENDING_A)); |
475 | 475 | ||
476 | { | 476 | { |
477 | TOXAV_ERR_CALL_CONTROL rc; | 477 | Toxav_Err_Call_Control rc; |
478 | toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_CANCEL, &rc); | 478 | toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_CANCEL, &rc); |
479 | 479 | ||
480 | if (rc != TOXAV_ERR_CALL_CONTROL_OK) { | 480 | if (rc != TOXAV_ERR_CALL_CONTROL_OK) { |
@@ -497,7 +497,7 @@ static void test_av_flows(void) | |||
497 | 497 | ||
498 | /* Assume sending audio and video */ | 498 | /* Assume sending audio and video */ |
499 | { | 499 | { |
500 | TOXAV_ERR_CALL rc; | 500 | Toxav_Err_Call rc; |
501 | toxav_call(AliceAV, 0, 48, 0, &rc); | 501 | toxav_call(AliceAV, 0, 48, 0, &rc); |
502 | 502 | ||
503 | if (rc != TOXAV_ERR_CALL_OK) { | 503 | if (rc != TOXAV_ERR_CALL_OK) { |
@@ -511,7 +511,7 @@ static void test_av_flows(void) | |||
511 | } while (!BobCC.incoming); | 511 | } while (!BobCC.incoming); |
512 | 512 | ||
513 | { | 513 | { |
514 | TOXAV_ERR_ANSWER rc; | 514 | Toxav_Err_Answer rc; |
515 | toxav_answer(BobAV, 0, 48, 0, &rc); | 515 | toxav_answer(BobAV, 0, 48, 0, &rc); |
516 | 516 | ||
517 | if (rc != TOXAV_ERR_ANSWER_OK) { | 517 | if (rc != TOXAV_ERR_ANSWER_OK) { |
@@ -534,7 +534,7 @@ static void test_av_flows(void) | |||
534 | iterate_tox(bootstrap, Alice, Bob); | 534 | iterate_tox(bootstrap, Alice, Bob); |
535 | 535 | ||
536 | { | 536 | { |
537 | TOXAV_ERR_CALL_CONTROL rc; | 537 | Toxav_Err_Call_Control rc; |
538 | toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_CANCEL, &rc); | 538 | toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_CANCEL, &rc); |
539 | 539 | ||
540 | if (rc != TOXAV_ERR_CALL_CONTROL_OK) { | 540 | if (rc != TOXAV_ERR_CALL_CONTROL_OK) { |
diff --git a/auto_tests/toxav_many_test.c b/auto_tests/toxav_many_test.c index 1cdc0733..1573bac9 100644 --- a/auto_tests/toxav_many_test.c +++ b/auto_tests/toxav_many_test.c | |||
@@ -82,7 +82,7 @@ static void t_accept_friend_request_cb(Tox *m, const uint8_t *public_key, const | |||
82 | */ | 82 | */ |
83 | static ToxAV *setup_av_instance(Tox *tox, CallControl *CC) | 83 | static ToxAV *setup_av_instance(Tox *tox, CallControl *CC) |
84 | { | 84 | { |
85 | TOXAV_ERR_NEW error; | 85 | Toxav_Err_New error; |
86 | 86 | ||
87 | ToxAV *av = toxav_new(tox, &error); | 87 | ToxAV *av = toxav_new(tox, &error); |
88 | ck_assert(error == TOXAV_ERR_NEW_OK); | 88 | ck_assert(error == TOXAV_ERR_NEW_OK); |
@@ -107,7 +107,7 @@ static void *call_thread(void *pd) | |||
107 | memset(BobCC, 0, sizeof(CallControl)); | 107 | memset(BobCC, 0, sizeof(CallControl)); |
108 | 108 | ||
109 | { /* Call */ | 109 | { /* Call */ |
110 | TOXAV_ERR_CALL rc; | 110 | Toxav_Err_Call rc; |
111 | toxav_call(AliceAV, friend_number, 48, 3000, &rc); | 111 | toxav_call(AliceAV, friend_number, 48, 3000, &rc); |
112 | 112 | ||
113 | if (rc != TOXAV_ERR_CALL_OK) { | 113 | if (rc != TOXAV_ERR_CALL_OK) { |
@@ -121,7 +121,7 @@ static void *call_thread(void *pd) | |||
121 | } while (!BobCC->incoming); | 121 | } while (!BobCC->incoming); |
122 | 122 | ||
123 | { /* Answer */ | 123 | { /* Answer */ |
124 | TOXAV_ERR_ANSWER rc; | 124 | Toxav_Err_Answer rc; |
125 | toxav_answer(BobAV, 0, 8, 500, &rc); | 125 | toxav_answer(BobAV, 0, 8, 500, &rc); |
126 | 126 | ||
127 | if (rc != TOXAV_ERR_ANSWER_OK) { | 127 | if (rc != TOXAV_ERR_ANSWER_OK) { |
@@ -153,7 +153,7 @@ static void *call_thread(void *pd) | |||
153 | } while (time(nullptr) - start_time < 4); | 153 | } while (time(nullptr) - start_time < 4); |
154 | 154 | ||
155 | { /* Hangup */ | 155 | { /* Hangup */ |
156 | TOXAV_ERR_CALL_CONTROL rc; | 156 | Toxav_Err_Call_Control rc; |
157 | toxav_call_control(AliceAV, friend_number, TOXAV_CALL_CONTROL_CANCEL, &rc); | 157 | toxav_call_control(AliceAV, friend_number, TOXAV_CALL_CONTROL_CANCEL, &rc); |
158 | 158 | ||
159 | if (rc != TOXAV_ERR_CALL_CONTROL_OK) { | 159 | if (rc != TOXAV_ERR_CALL_CONTROL_OK) { |
@@ -184,7 +184,7 @@ static void test_av_three_calls(void) | |||
184 | CallControl AliceCC[3], BobsCC[3]; | 184 | CallControl AliceCC[3], BobsCC[3]; |
185 | 185 | ||
186 | { | 186 | { |
187 | TOX_ERR_NEW error; | 187 | Tox_Err_New error; |
188 | 188 | ||
189 | bootstrap = tox_new_log(nullptr, &error, &index[0]); | 189 | bootstrap = tox_new_log(nullptr, &error, &index[0]); |
190 | ck_assert(error == TOX_ERR_NEW_OK); | 190 | ck_assert(error == TOX_ERR_NEW_OK); |
diff --git a/auto_tests/typing_test.c b/auto_tests/typing_test.c index 60968876..54577420 100644 --- a/auto_tests/typing_test.c +++ b/auto_tests/typing_test.c | |||
@@ -48,7 +48,7 @@ static void test_typing(Tox **toxes, State *state) | |||
48 | iterate_all_wait(2, toxes, state, 200); | 48 | iterate_all_wait(2, toxes, state, 200); |
49 | } while (state[1].friend_is_typing); | 49 | } while (state[1].friend_is_typing); |
50 | 50 | ||
51 | TOX_ERR_FRIEND_QUERY err_t; | 51 | Tox_Err_Friend_Query err_t; |
52 | ck_assert_msg(tox_friend_get_typing(toxes[1], 0, &err_t) == 0, | 52 | ck_assert_msg(tox_friend_get_typing(toxes[1], 0, &err_t) == 0, |
53 | "tox_friend_get_typing should have returned false, but it didn't"); | 53 | "tox_friend_get_typing should have returned false, but it didn't"); |
54 | ck_assert_msg(err_t == TOX_ERR_FRIEND_QUERY_OK, "tox_friend_get_typing call did not return correct error"); | 54 | ck_assert_msg(err_t == TOX_ERR_FRIEND_QUERY_OK, "tox_friend_get_typing call did not return correct error"); |