diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-09-06 20:10:13 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-09-21 21:57:18 +0200 |
| commit | cdc8bc6a7da0b4f8c3dbfcf560fea61473cf1ca3 (patch) | |
| tree | 6f6fc0c6b7897e6d3bd48fcc27e0e5eb08fc92b9 /test/test.cc | |
| parent | 445f2495fbb0885132d3a6c8e7a1e135cbac3cce (diff) | |
Support MCA sound channel tags in MXF/CPL.
Diffstat (limited to 'test/test.cc')
| -rw-r--r-- | test/test.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/test/test.cc b/test/test.cc index dd143264..62013687 100644 --- a/test/test.cc +++ b/test/test.cc @@ -95,12 +95,12 @@ struct TestConfig }; void -check_xml (xmlpp::Element* ref, xmlpp::Element* test, list<string> ignore) +check_xml (xmlpp::Element* ref, xmlpp::Element* test, list<string> ignore_tags, bool ignore_whitespace) { BOOST_CHECK_EQUAL (ref->get_name (), test->get_name ()); BOOST_CHECK_EQUAL (ref->get_namespace_prefix (), test->get_namespace_prefix ()); - if (find (ignore.begin(), ignore.end(), ref->get_name()) != ignore.end ()) { + if (find(ignore_tags.begin(), ignore_tags.end(), ref->get_name()) != ignore_tags.end()) { return; } @@ -121,14 +121,20 @@ check_xml (xmlpp::Element* ref, xmlpp::Element* test, list<string> ignore) xmlpp::Element* test_el = dynamic_cast<xmlpp::Element*> (*l); BOOST_CHECK ((ref_el && test_el) || (!ref_el && !test_el)); if (ref_el && test_el) { - check_xml (ref_el, test_el, ignore); + check_xml (ref_el, test_el, ignore_tags, ignore_whitespace); } xmlpp::ContentNode* ref_cn = dynamic_cast<xmlpp::ContentNode*> (*k); xmlpp::ContentNode* test_cn = dynamic_cast<xmlpp::ContentNode*> (*l); BOOST_CHECK ((ref_cn && test_cn) || (!ref_cn && !test_cn)); if (ref_cn && test_cn) { - BOOST_CHECK_EQUAL (ref_cn->get_content(), test_cn->get_content ()); + if ( + !ignore_whitespace || + ref_cn->get_content().find_first_not_of(" \t\r\n") != string::npos || + test_cn->get_content().find_first_not_of(" \t\r\n") != string::npos) { + + BOOST_CHECK_EQUAL (ref_cn->get_content(), test_cn->get_content ()); + } } ++k; |
