summaryrefslogtreecommitdiff
path: root/auto_tests/toxav_basic_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'auto_tests/toxav_basic_test.c')
-rw-r--r--auto_tests/toxav_basic_test.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/auto_tests/toxav_basic_test.c b/auto_tests/toxav_basic_test.c
index 41fb6787..5821a6d4 100644
--- a/auto_tests/toxav_basic_test.c
+++ b/auto_tests/toxav_basic_test.c
@@ -2,11 +2,20 @@
2#include "config.h" 2#include "config.h"
3#endif 3#endif
4 4
5#ifndef HAVE_LIBCHECK
6# include <assert.h>
7
8# define ck_assert(X) assert(X);
9# define START_TEST(NAME) void NAME ()
10# define END_TEST
11#else
12# include "helpers.h"
13#endif
14
5#include <sys/types.h> 15#include <sys/types.h>
6#include <stdint.h> 16#include <stdint.h>
7#include <string.h> 17#include <string.h>
8#include <stdio.h> 18#include <stdio.h>
9#include <check.h>
10#include <stdlib.h> 19#include <stdlib.h>
11#include <time.h> 20#include <time.h>
12 21
@@ -18,7 +27,6 @@
18#include "../toxcore/crypto_core.h" 27#include "../toxcore/crypto_core.h"
19#include "../toxav/toxav.h" 28#include "../toxav/toxav.h"
20 29
21#include "helpers.h"
22 30
23#if defined(_WIN32) || defined(__WIN32__) || defined (WIN32) 31#if defined(_WIN32) || defined(__WIN32__) || defined (WIN32)
24#define c_sleep(x) Sleep(1*x) 32#define c_sleep(x) Sleep(1*x)
@@ -462,19 +470,19 @@ START_TEST(test_AV_flows)
462 470
463 printf("Call started as audio only\n"); 471 printf("Call started as audio only\n");
464 printf("Turning on video for Alice...\n"); 472 printf("Turning on video for Alice...\n");
465 ck_assert(toxav_video_bit_rate_set(AliceAV, 0, 1000, false, NULL)); 473 ck_assert(toxav_bit_rate_set(AliceAV, 0, -1, 1000, NULL));
466 474
467 iterate_tox(bootstrap, Alice, Bob); 475 iterate_tox(bootstrap, Alice, Bob);
468 ck_assert(BobCC.state & TOXAV_FRIEND_CALL_STATE_SENDING_V); 476 ck_assert(BobCC.state & TOXAV_FRIEND_CALL_STATE_SENDING_V);
469 477
470 printf("Turning off video for Alice...\n"); 478 printf("Turning off video for Alice...\n");
471 ck_assert(toxav_video_bit_rate_set(AliceAV, 0, 0, false, NULL)); 479 ck_assert(toxav_bit_rate_set(AliceAV, 0, -1, 0, NULL));
472 480
473 iterate_tox(bootstrap, Alice, Bob); 481 iterate_tox(bootstrap, Alice, Bob);
474 ck_assert(!(BobCC.state & TOXAV_FRIEND_CALL_STATE_SENDING_V)); 482 ck_assert(!(BobCC.state & TOXAV_FRIEND_CALL_STATE_SENDING_V));
475 483
476 printf("Turning off audio for Alice...\n"); 484 printf("Turning off audio for Alice...\n");
477 ck_assert(toxav_audio_bit_rate_set(AliceAV, 0, 0, false, NULL)); 485 ck_assert(toxav_bit_rate_set(AliceAV, 0, 0, -1, NULL));
478 486
479 iterate_tox(bootstrap, Alice, Bob); 487 iterate_tox(bootstrap, Alice, Bob);
480 ck_assert(!(BobCC.state & TOXAV_FRIEND_CALL_STATE_SENDING_A)); 488 ck_assert(!(BobCC.state & TOXAV_FRIEND_CALL_STATE_SENDING_A));
@@ -564,7 +572,16 @@ START_TEST(test_AV_flows)
564} 572}
565END_TEST 573END_TEST
566 574
567 575#ifndef HAVE_LIBCHECK
576int main(int argc, char *argv[])
577{
578 (void) argc;
579 (void) argv;
580
581 test_AV_flows();
582 return 0;
583}
584#else
568Suite *tox_suite(void) 585Suite *tox_suite(void)
569{ 586{
570 Suite *s = suite_create("ToxAV"); 587 Suite *s = suite_create("ToxAV");
@@ -589,3 +606,4 @@ int main(int argc, char *argv[])
589 606
590 return number_failed; 607 return number_failed;
591} 608}
609#endif