From 00130651dac758f90bf98306a9d1e569ed4155ca Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 8 May 2015 21:22:39 +0200 Subject: audio: simplify further Drop mp_chmap_diff() (which is unused too now), and implement mp_chmap_diffn() in a slightly simpler way. (Too bad there is no standard function for counting set bits.) --- test/chmap.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'test') diff --git a/test/chmap.c b/test/chmap.c index 4bd4ba7b58..365c15be52 100644 --- a/test/chmap.c +++ b/test/chmap.c @@ -4,24 +4,15 @@ static void test_mp_chmap_diff(void **state) { struct mp_chmap a; struct mp_chmap b; - struct mp_chmap diff; mp_chmap_from_str(&a, bstr0("3.1")); mp_chmap_from_str(&b, bstr0("2.1")); - mp_chmap_diff(&a, &b, &diff); - assert_int_equal(diff.num, 1); - assert_int_equal(diff.speaker[0], MP_SPEAKER_ID_FC); + assert_int_equal(mp_chmap_diffn(&a, &b), 1); mp_chmap_from_str(&b, bstr0("6.1(back)")); - mp_chmap_diff(&a, &b, &diff); - assert_int_equal(diff.num, 0); - - mp_chmap_diff(&b, &a, &diff); - assert_int_equal(diff.num, 3); - assert_int_equal(diff.speaker[0], MP_SPEAKER_ID_BL); - assert_int_equal(diff.speaker[1], MP_SPEAKER_ID_BR); - assert_int_equal(diff.speaker[2], MP_SPEAKER_ID_BC); + assert_int_equal(mp_chmap_diffn(&a, &b), 0); + assert_int_equal(mp_chmap_diffn(&b, &a), 3); } int main(void) { -- cgit v1.2.3