From 9b42b4e861497d04de8b379d4a88b0b00147158c Mon Sep 17 00:00:00 2001 From: sudden6 Date: Tue, 4 Jan 2022 20:07:36 +0100 Subject: [PATCH 1/2] fix: use correct sample size in toxav_basic_test --- auto_tests/toxav_basic_test.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/auto_tests/toxav_basic_test.c b/auto_tests/toxav_basic_test.c index 5522cc52e4..ce4ec6f1a5 100644 --- a/auto_tests/toxav_basic_test.c +++ b/auto_tests/toxav_basic_test.c @@ -100,6 +100,12 @@ static void iterate_tox(Tox *bootstrap, Tox *Alice, Tox *Bob) tox_iterate(Bob, nullptr); } +static bool toxav_audio_send_frame_helper(ToxAV *av, uint32_t friend_number, Toxav_Err_Send_Frame *error) +{ + const static int16_t PCM[960] = {0}; + return toxav_audio_send_frame(av, 0, PCM, sizeof (PCM), 1, 48000, nullptr); +} + static void regular_call_flow( Tox *Alice, Tox *Bob, Tox *bootstrap, ToxAV *AliceAV, ToxAV *BobAV, @@ -521,12 +527,12 @@ static void test_av_flows(void) iterate_tox(bootstrap, Alice, Bob); ck_assert_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_PAUSE); iterate_tox(bootstrap, Alice, Bob); - ck_assert(!toxav_audio_send_frame(AliceAV, 0, PCM, 960, 1, 48000, nullptr)); - ck_assert(!toxav_audio_send_frame(BobAV, 0, PCM, 960, 1, 48000, nullptr)); + ck_assert(!toxav_audio_send_frame_helper(AliceAV, 0, nullptr)); + ck_assert(!toxav_audio_send_frame_helper(BobAV, 0, nullptr)); ck_assert_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_RESUME); iterate_tox(bootstrap, Alice, Bob); - ck_assert(toxav_audio_send_frame(AliceAV, 0, PCM, 960, 1, 48000, nullptr)); - ck_assert(toxav_audio_send_frame(BobAV, 0, PCM, 960, 1, 48000, nullptr)); + ck_assert(!toxav_audio_send_frame_helper(AliceAV, 0, nullptr)); + ck_assert(!toxav_audio_send_frame_helper(BobAV, 0, nullptr)); iterate_tox(bootstrap, Alice, Bob); { From 210c04b0fa3e33dd7d55d41e586ac046f81d7142 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Tue, 4 Jan 2022 19:09:23 +0000 Subject: [PATCH 2/2] Restyled by astyle --- auto_tests/toxav_basic_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auto_tests/toxav_basic_test.c b/auto_tests/toxav_basic_test.c index ce4ec6f1a5..70ad22794f 100644 --- a/auto_tests/toxav_basic_test.c +++ b/auto_tests/toxav_basic_test.c @@ -103,7 +103,7 @@ static void iterate_tox(Tox *bootstrap, Tox *Alice, Tox *Bob) static bool toxav_audio_send_frame_helper(ToxAV *av, uint32_t friend_number, Toxav_Err_Send_Frame *error) { const static int16_t PCM[960] = {0}; - return toxav_audio_send_frame(av, 0, PCM, sizeof (PCM), 1, 48000, nullptr); + return toxav_audio_send_frame(av, 0, PCM, sizeof(PCM), 1, 48000, nullptr); } static void regular_call_flow(