diff options
Diffstat (limited to 'auto_tests/toxav_many_test.c')
-rw-r--r-- | auto_tests/toxav_many_test.c | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/auto_tests/toxav_many_test.c b/auto_tests/toxav_many_test.c index 5d889032..e3dd5a42 100644 --- a/auto_tests/toxav_many_test.c +++ b/auto_tests/toxav_many_test.c | |||
@@ -6,7 +6,7 @@ | |||
6 | # include <assert.h> | 6 | # include <assert.h> |
7 | 7 | ||
8 | # define ck_assert(X) assert(X); | 8 | # define ck_assert(X) assert(X); |
9 | # define START_TEST(NAME) void NAME () | 9 | # define START_TEST(NAME) static void NAME (void) |
10 | # define END_TEST | 10 | # define END_TEST |
11 | #else | 11 | #else |
12 | # include "helpers.h" | 12 | # include "helpers.h" |
@@ -52,7 +52,7 @@ typedef struct { | |||
52 | /** | 52 | /** |
53 | * Callbacks | 53 | * Callbacks |
54 | */ | 54 | */ |
55 | void t_toxav_call_cb(ToxAV *av, uint32_t friend_number, bool audio_enabled, bool video_enabled, void *user_data) | 55 | static void t_toxav_call_cb(ToxAV *av, uint32_t friend_number, bool audio_enabled, bool video_enabled, void *user_data) |
56 | { | 56 | { |
57 | (void) av; | 57 | (void) av; |
58 | (void) audio_enabled; | 58 | (void) audio_enabled; |
@@ -61,16 +61,16 @@ void t_toxav_call_cb(ToxAV *av, uint32_t friend_number, bool audio_enabled, bool | |||
61 | printf("Handling CALL callback\n"); | 61 | printf("Handling CALL callback\n"); |
62 | ((CallControl *)user_data)[friend_number].incoming = true; | 62 | ((CallControl *)user_data)[friend_number].incoming = true; |
63 | } | 63 | } |
64 | void t_toxav_call_state_cb(ToxAV *av, uint32_t friend_number, uint32_t state, void *user_data) | 64 | static void t_toxav_call_state_cb(ToxAV *av, uint32_t friend_number, uint32_t state, void *user_data) |
65 | { | 65 | { |
66 | printf("Handling CALL STATE callback: %d %p\n", state, (void *)av); | 66 | printf("Handling CALL STATE callback: %d %p\n", state, (void *)av); |
67 | ((CallControl *)user_data)[friend_number].state = state; | 67 | ((CallControl *)user_data)[friend_number].state = state; |
68 | } | 68 | } |
69 | void t_toxav_receive_video_frame_cb(ToxAV *av, uint32_t friend_number, | 69 | static void t_toxav_receive_video_frame_cb(ToxAV *av, uint32_t friend_number, |
70 | uint16_t width, uint16_t height, | 70 | uint16_t width, uint16_t height, |
71 | uint8_t const *y, uint8_t const *u, uint8_t const *v, | 71 | uint8_t const *y, uint8_t const *u, uint8_t const *v, |
72 | int32_t ystride, int32_t ustride, int32_t vstride, | 72 | int32_t ystride, int32_t ustride, int32_t vstride, |
73 | void *user_data) | 73 | void *user_data) |
74 | { | 74 | { |
75 | (void) av; | 75 | (void) av; |
76 | (void) friend_number; | 76 | (void) friend_number; |
@@ -84,12 +84,12 @@ void t_toxav_receive_video_frame_cb(ToxAV *av, uint32_t friend_number, | |||
84 | (void) vstride; | 84 | (void) vstride; |
85 | (void) user_data; | 85 | (void) user_data; |
86 | } | 86 | } |
87 | void t_toxav_receive_audio_frame_cb(ToxAV *av, uint32_t friend_number, | 87 | static void t_toxav_receive_audio_frame_cb(ToxAV *av, uint32_t friend_number, |
88 | int16_t const *pcm, | 88 | int16_t const *pcm, |
89 | size_t sample_count, | 89 | size_t sample_count, |
90 | uint8_t channels, | 90 | uint8_t channels, |
91 | uint32_t sampling_rate, | 91 | uint32_t sampling_rate, |
92 | void *user_data) | 92 | void *user_data) |
93 | { | 93 | { |
94 | (void) av; | 94 | (void) av; |
95 | (void) friend_number; | 95 | (void) friend_number; |
@@ -99,7 +99,8 @@ void t_toxav_receive_audio_frame_cb(ToxAV *av, uint32_t friend_number, | |||
99 | (void) sampling_rate; | 99 | (void) sampling_rate; |
100 | (void) user_data; | 100 | (void) user_data; |
101 | } | 101 | } |
102 | void t_accept_friend_request_cb(Tox *m, const uint8_t *public_key, const uint8_t *data, size_t length, void *userdata) | 102 | static void t_accept_friend_request_cb(Tox *m, const uint8_t *public_key, const uint8_t *data, size_t length, |
103 | void *userdata) | ||
103 | { | 104 | { |
104 | (void) userdata; | 105 | (void) userdata; |
105 | 106 | ||
@@ -112,7 +113,7 @@ void t_accept_friend_request_cb(Tox *m, const uint8_t *public_key, const uint8_t | |||
112 | /** | 113 | /** |
113 | * Iterate helper | 114 | * Iterate helper |
114 | */ | 115 | */ |
115 | ToxAV *setup_av_instance(Tox *tox, CallControl *CC) | 116 | static ToxAV *setup_av_instance(Tox *tox, CallControl *CC) |
116 | { | 117 | { |
117 | TOXAV_ERR_NEW error; | 118 | TOXAV_ERR_NEW error; |
118 | 119 | ||
@@ -126,7 +127,7 @@ ToxAV *setup_av_instance(Tox *tox, CallControl *CC) | |||
126 | 127 | ||
127 | return av; | 128 | return av; |
128 | } | 129 | } |
129 | void *call_thread(void *pd) | 130 | static void *call_thread(void *pd) |
130 | { | 131 | { |
131 | ToxAV *AliceAV = ((thread_data *) pd)->AliceAV; | 132 | ToxAV *AliceAV = ((thread_data *) pd)->AliceAV; |
132 | ToxAV *BobAV = ((thread_data *) pd)->BobAV; | 133 | ToxAV *BobAV = ((thread_data *) pd)->BobAV; |
@@ -241,9 +242,9 @@ START_TEST(test_AV_three_calls) | |||
241 | tox_self_get_address(Alice, address); | 242 | tox_self_get_address(Alice, address); |
242 | 243 | ||
243 | 244 | ||
244 | ck_assert(tox_friend_add(Bobs[0], address, (uint8_t *)"gentoo", 7, NULL) != (uint32_t) ~0); | 245 | ck_assert(tox_friend_add(Bobs[0], address, (const uint8_t *)"gentoo", 7, NULL) != (uint32_t) ~0); |
245 | ck_assert(tox_friend_add(Bobs[1], address, (uint8_t *)"gentoo", 7, NULL) != (uint32_t) ~0); | 246 | ck_assert(tox_friend_add(Bobs[1], address, (const uint8_t *)"gentoo", 7, NULL) != (uint32_t) ~0); |
246 | ck_assert(tox_friend_add(Bobs[2], address, (uint8_t *)"gentoo", 7, NULL) != (uint32_t) ~0); | 247 | ck_assert(tox_friend_add(Bobs[2], address, (const uint8_t *)"gentoo", 7, NULL) != (uint32_t) ~0); |
247 | 248 | ||
248 | uint8_t off = 1; | 249 | uint8_t off = 1; |
249 | 250 | ||
@@ -351,7 +352,7 @@ int main(int argc, char *argv[]) | |||
351 | return 0; | 352 | return 0; |
352 | } | 353 | } |
353 | #else | 354 | #else |
354 | Suite *tox_suite(void) | 355 | static Suite *tox_suite(void) |
355 | { | 356 | { |
356 | Suite *s = suite_create("ToxAV"); | 357 | Suite *s = suite_create("ToxAV"); |
357 | 358 | ||