summaryrefslogtreecommitdiff
path: root/auto_tests/conference_simple_test.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-10-08 21:05:14 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-10-09 17:33:37 +0000
commit605dfe882c52bfad4dee9678a69e4b816d93431d (patch)
tree10432adc5d3716cb28b833c6e156218b67c23494 /auto_tests/conference_simple_test.c
parent77e025fae48a4f9cf6cf19a359b6c423545f3cc7 (diff)
Consistently use camel case enum names.
Including in tests and implementation files.
Diffstat (limited to 'auto_tests/conference_simple_test.c')
-rw-r--r--auto_tests/conference_simple_test.c20
1 files changed, 10 insertions, 10 deletions
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
26static void handle_self_connection_status(Tox *tox, TOX_CONNECTION connection_status, void *user_data) 26static 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
34static void handle_friend_connection_status(Tox *tox, uint32_t friend_number, TOX_CONNECTION connection_status, 34static 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
43static void handle_conference_invite(Tox *tox, uint32_t friend_number, TOX_CONFERENCE_TYPE type, const uint8_t *cookie, 43static 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
61static void handle_conference_message(Tox *tox, uint32_t conference_number, uint32_t peer_number, 61static 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