Skip to content

Commit d2bf724

Browse files
committed
fix: use correct sample size in toxav_basic_test
1 parent 0385315 commit d2bf724

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

auto_tests/toxav_basic_test.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ static void iterate_tox(Tox *bootstrap, Tox *Alice, Tox *Bob)
100100
tox_iterate(Bob, nullptr);
101101
}
102102

103+
static bool toxav_audio_send_frame_helper(ToxAV *av, uint32_t friend_number, Toxav_Err_Send_Frame *error)
104+
{
105+
static const int16_t PCM[960] = {0};
106+
return toxav_audio_send_frame(av, 0, PCM, sizeof(PCM), 1, 48000, nullptr);
107+
}
108+
103109
static void regular_call_flow(
104110
Tox *Alice, Tox *Bob, Tox *bootstrap,
105111
ToxAV *AliceAV, ToxAV *BobAV,
@@ -516,17 +522,15 @@ static void test_av_flows(void)
516522
}
517523
}
518524

519-
int16_t PCM[5670];
520-
521525
iterate_tox(bootstrap, Alice, Bob);
522526
ck_assert_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_PAUSE);
523527
iterate_tox(bootstrap, Alice, Bob);
524-
ck_assert(!toxav_audio_send_frame(AliceAV, 0, PCM, 960, 1, 48000, nullptr));
525-
ck_assert(!toxav_audio_send_frame(BobAV, 0, PCM, 960, 1, 48000, nullptr));
528+
ck_assert(!toxav_audio_send_frame_helper(AliceAV, 0, nullptr));
529+
ck_assert(!toxav_audio_send_frame_helper(BobAV, 0, nullptr));
526530
ck_assert_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_RESUME);
527531
iterate_tox(bootstrap, Alice, Bob);
528-
ck_assert(toxav_audio_send_frame(AliceAV, 0, PCM, 960, 1, 48000, nullptr));
529-
ck_assert(toxav_audio_send_frame(BobAV, 0, PCM, 960, 1, 48000, nullptr));
532+
ck_assert(toxav_audio_send_frame_helper(AliceAV, 0, nullptr));
533+
ck_assert(toxav_audio_send_frame_helper(BobAV, 0, nullptr));
530534
iterate_tox(bootstrap, Alice, Bob);
531535

532536
{

0 commit comments

Comments
 (0)