Skip to content

Commit

Permalink
test: call - complete test for auconv
Browse files Browse the repository at this point in the history
  • Loading branch information
cspiel1 committed May 27, 2024
1 parent 47d0f08 commit 9a8504d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 30 deletions.
45 changes: 17 additions & 28 deletions test/call.c
Original file line number Diff line number Diff line change
Expand Up @@ -1799,7 +1799,7 @@ int test_call_progress(void)
}


static int test_media_base(enum audio_mode txmode)
static int test_media_base(enum audio_mode txmode, enum aufmt fmt)
{
struct fixture fix, *f = &fix;
struct cancel_rule *cr;
Expand All @@ -1813,8 +1813,8 @@ static int test_media_base(enum audio_mode txmode)
TEST_ERR(err);

conf_config()->audio.txmode = txmode;
conf_config()->audio.src_fmt = AUFMT_S16LE;
conf_config()->audio.play_fmt = AUFMT_S16LE;
conf_config()->audio.src_fmt = fmt;
conf_config()->audio.play_fmt = fmt;
conf_config()->avt.rtp_stats = true;

cancel_rule_new(UA_EVENT_CUSTOM, f->a.ua, 0, 0, 1);
Expand Down Expand Up @@ -1875,15 +1875,24 @@ int test_call_format_float(void)
{
int err;

err = test_media_base(AUDIO_MODE_POLL);
ASSERT_EQ(0, err);
err = module_load(".", "auconv");
TEST_ERR(err);

err = test_media_base(AUDIO_MODE_THREAD);
ASSERT_EQ(0, err);
err = test_media_base(AUDIO_MODE_POLL, AUFMT_S16LE);
TEST_ERR(err);

conf_config()->audio.txmode = AUDIO_MODE_POLL;
err = test_media_base(AUDIO_MODE_THREAD, AUFMT_S16LE);
TEST_ERR(err);

err = test_media_base(AUDIO_MODE_POLL, AUFMT_FLOAT);
TEST_ERR(err);

err = test_media_base(AUDIO_MODE_THREAD, AUFMT_FLOAT);
TEST_ERR(err);

out:
module_unload("auconv");

return err;
}

Expand Down Expand Up @@ -2421,26 +2430,6 @@ int test_call_rtcp(void)
}


int test_call_aufilt(void)
{
int err;

err = module_load(".", "auconv");
TEST_ERR(err);

err = test_media_base(AUDIO_MODE_POLL);
TEST_ERR(err);

err = test_media_base(AUDIO_MODE_THREAD);
TEST_ERR(err);

out:
module_unload("auconv");

return err;
}


/*
* Simulate a complete WebRTC testcase
*/
Expand Down
1 change: 0 additions & 1 deletion test/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ static const struct test tests[] = {
TEST(test_call_answer),
TEST(test_call_answer_hangup_a),
TEST(test_call_answer_hangup_b),
TEST(test_call_aufilt),
TEST(test_call_aulevel),
TEST(test_call_custom_headers),
TEST(test_call_dtmf),
Expand Down
1 change: 0 additions & 1 deletion test/test.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ int test_aulevel(void);
int test_call_answer(void);
int test_call_answer_hangup_a(void);
int test_call_answer_hangup_b(void);
int test_call_aufilt(void);
int test_call_aulevel(void);
int test_call_custom_headers(void);
int test_call_dtmf(void);
Expand Down

0 comments on commit 9a8504d

Please sign in to comment.