summaryrefslogtreecommitdiff
path: root/auto_tests/toxav_many_test.c
diff options
context:
space:
mode:
authornotsecure <notsecure@marek.ca>2014-07-07 17:37:05 -0400
committernotsecure <notsecure@marek.ca>2014-07-07 17:37:05 -0400
commitc527979daa5b65ec9a838c1b3fe998af6375953a (patch)
treefef2bc08faf0caaffaf1a8afcc603ec7b631a9dc /auto_tests/toxav_many_test.c
parent3d4de767fe8fefb5eb2456674be9930388564ee8 (diff)
make autotests compile
Diffstat (limited to 'auto_tests/toxav_many_test.c')
-rw-r--r--auto_tests/toxav_many_test.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/auto_tests/toxav_many_test.c b/auto_tests/toxav_many_test.c
index 2a931cb0..106d2f32 100644
--- a/auto_tests/toxav_many_test.c
+++ b/auto_tests/toxav_many_test.c
@@ -124,6 +124,14 @@ void callback_requ_timeout ( int32_t call_index, void *_arg )
124{ 124{
125 ck_assert_msg(0, "No answer!"); 125 ck_assert_msg(0, "No answer!");
126} 126}
127
128static void callback_audio(ToxAv *av, int32_t call_index, int16_t *data, int length)
129{
130}
131
132static void callback_video(ToxAv *av, int32_t call_index, vpx_image_t *img)
133{
134}
127/*************************************************************************************************/ 135/*************************************************************************************************/
128 136
129 137
@@ -142,6 +150,11 @@ void *in_thread_call (void *arg)
142 150
143 uint8_t prepared_payload[RTP_PAYLOAD_SIZE]; 151 uint8_t prepared_payload[RTP_PAYLOAD_SIZE];
144 152
153 toxav_register_audio_recv_callback(this_call->Caller.av, callback_audio);
154 toxav_register_video_recv_callback(this_call->Caller.av, callback_video);
155 toxav_register_audio_recv_callback(this_call->Callee.av, callback_audio);
156 toxav_register_video_recv_callback(this_call->Callee.av, callback_video);
157
145 158
146 /* NOTE: CALLEE WILL ALWAHYS NEED CALL_IDX == 0 */ 159 /* NOTE: CALLEE WILL ALWAHYS NEED CALL_IDX == 0 */
147 while (running) { 160 while (running) {
@@ -192,18 +205,18 @@ void *in_thread_call (void *arg)
192 int recved; 205 int recved;
193 206
194 /* Payload from CALLER */ 207 /* Payload from CALLER */
195 recved = toxav_recv_audio(this_call->Callee.av, 0, frame_size, storage); 208 /*recved = toxav_recv_audio(this_call->Callee.av, 0, frame_size, storage);
196 209
197 if ( recved ) { 210 if ( recved ) {
198 /*ck_assert_msg(recved == 10 && memcmp(storage, sample_payload, 10) == 0, "Payload from CALLER is invalid");*/ 211 //ck_assert_msg(recved == 10 && memcmp(storage, sample_payload, 10) == 0, "Payload from CALLER is invalid");
199 } 212 }*/
200 213
201 /* Payload from CALLEE */ 214 /* Payload from CALLEE */
202 recved = toxav_recv_audio(this_call->Caller.av, call_idx, frame_size, storage); 215 /*recved = toxav_recv_audio(this_call->Caller.av, call_idx, frame_size, storage);
203 216
204 if ( recved ) { 217 if ( recved ) {
205 /*ck_assert_msg(recved == 10 && memcmp(storage, sample_payload, 10) == 0, "Payload from CALLEE is invalid");*/ 218 //ck_assert_msg(recved == 10 && memcmp(storage, sample_payload, 10) == 0, "Payload from CALLEE is invalid");
206 } 219 }*/
207 220
208 c_sleep(20); 221 c_sleep(20);
209 } 222 }
@@ -335,7 +348,6 @@ START_TEST(test_AV_three_calls)
335 toxav_register_callstate_callback(callback_requ_timeout, av_OnRequestTimeout, &status_control); 348 toxav_register_callstate_callback(callback_requ_timeout, av_OnRequestTimeout, &status_control);
336 349
337 350
338
339 for ( i = 0; i < 3; i++ ) 351 for ( i = 0; i < 3; i++ )
340 pthread_create(&status_control.calls[i].tid, NULL, in_thread_call, &status_control.calls[i]); 352 pthread_create(&status_control.calls[i].tid, NULL, in_thread_call, &status_control.calls[i]);
341 353
@@ -403,4 +415,4 @@ int main(int argc, char *argv[])
403// test_AV_three_calls(); 415// test_AV_three_calls();
404// 416//
405// return 0; 417// return 0;
406} \ No newline at end of file 418}