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/conference_test.c | |
parent | 77e025fae48a4f9cf6cf19a359b6c423545f3cc7 (diff) |
Consistently use camel case enum names.
Including in tests and implementation files.
Diffstat (limited to 'auto_tests/conference_test.c')
-rw-r--r-- | auto_tests/conference_test.c | 16 |
1 files changed, 8 insertions, 8 deletions
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) { |