diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-01-30 01:32:04 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-01-31 01:41:36 +0100 |
| commit | c85d5ae643df5f2fa399398796feaa6f42b114a7 (patch) | |
| tree | 3976bf014b74f167fd696cc1a73ca115be49c7bf /test/test.cc | |
| parent | 744eae9a14f834088289d10d7158ad89857565ad (diff) | |
Fix up for const fix in libcxml.v1.10.9
Diffstat (limited to 'test/test.cc')
| -rw-r--r-- | test/test.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/test.cc b/test/test.cc index 65649efd..0de9c73c 100644 --- a/test/test.cc +++ b/test/test.cc @@ -116,7 +116,7 @@ struct TestConfig void -check_xml (xmlpp::Element* ref, xmlpp::Element* test, vector<string> ignore_tags, bool ignore_whitespace) +check_xml(xmlpp::Element const* ref, xmlpp::Element const* test, vector<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 ()); @@ -125,8 +125,8 @@ check_xml (xmlpp::Element* ref, xmlpp::Element* test, vector<string> ignore_tags return; } - auto whitespace_content = [](xmlpp::Node* node) { - auto content = dynamic_cast<xmlpp::ContentNode*>(node); + auto whitespace_content = [](xmlpp::Node const* node) { + auto content = dynamic_cast<xmlpp::ContentNode const*>(node); return content && content->get_content().find_first_not_of(" \t\r\n") == string::npos; }; @@ -137,12 +137,12 @@ check_xml (xmlpp::Element* ref, xmlpp::Element* test, vector<string> ignore_tags auto l = test_children.begin (); while (k != ref_children.end() && l != test_children.end()) { - if (dynamic_cast<xmlpp::CommentNode*>(*k)) { + if (dynamic_cast<xmlpp::CommentNode const*>(*k)) { ++k; continue; } - if (dynamic_cast<xmlpp::CommentNode*>(*l)) { + if (dynamic_cast<xmlpp::CommentNode const*>(*l)) { ++l; continue; } @@ -159,15 +159,15 @@ check_xml (xmlpp::Element* ref, xmlpp::Element* test, vector<string> ignore_tags /* XXX: should be doing xmlpp::EntityReference, xmlpp::XIncludeEnd, xmlpp::XIncludeStart */ - auto ref_el = dynamic_cast<xmlpp::Element*> (*k); - auto test_el = dynamic_cast<xmlpp::Element*> (*l); + auto ref_el = dynamic_cast<xmlpp::Element const*>(*k); + auto test_el = dynamic_cast<xmlpp::Element const*>(*l); BOOST_CHECK ((ref_el && test_el) || (!ref_el && !test_el)); if (ref_el && test_el) { check_xml (ref_el, test_el, ignore_tags, ignore_whitespace); } - auto ref_cn = dynamic_cast<xmlpp::ContentNode*> (*k); - auto test_cn = dynamic_cast<xmlpp::ContentNode*> (*l); + auto ref_cn = dynamic_cast<xmlpp::ContentNode const*>(*k); + auto test_cn = dynamic_cast<xmlpp::ContentNode const*>(*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()); |
