2014-12-28 08:38:22 +00:00
|
|
|
#include "test_helpers.h"
|
|
|
|
#include "audio/chmap.h"
|
|
|
|
|
|
|
|
static void test_mp_chmap_diff(void **state) {
|
|
|
|
struct mp_chmap a;
|
|
|
|
struct mp_chmap b;
|
|
|
|
|
|
|
|
mp_chmap_from_str(&a, bstr0("3.1"));
|
|
|
|
mp_chmap_from_str(&b, bstr0("2.1"));
|
|
|
|
|
2015-05-08 19:22:39 +00:00
|
|
|
assert_int_equal(mp_chmap_diffn(&a, &b), 1);
|
2014-12-28 08:38:22 +00:00
|
|
|
|
|
|
|
mp_chmap_from_str(&b, bstr0("6.1(back)"));
|
2015-05-08 19:22:39 +00:00
|
|
|
assert_int_equal(mp_chmap_diffn(&a, &b), 0);
|
|
|
|
assert_int_equal(mp_chmap_diffn(&b, &a), 3);
|
2014-12-28 08:38:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int main(void) {
|
2015-06-12 17:31:55 +00:00
|
|
|
const struct CMUnitTest tests[] = {
|
|
|
|
cmocka_unit_test(test_mp_chmap_diff),
|
2014-12-28 08:38:22 +00:00
|
|
|
};
|
2015-06-12 17:31:55 +00:00
|
|
|
return cmocka_run_group_tests(tests, NULL, NULL);
|
2014-12-28 08:38:22 +00:00
|
|
|
}
|