if (find (ignore.begin(), ignore.end(), ref->get_name()) != ignore.end ()) {
return;
}
-
+
xmlpp::Element::NodeList ref_children = ref->get_children ();
xmlpp::Element::NodeList test_children = test->get_children ();
BOOST_CHECK_EQUAL (ref_children.size (), test_children.size ());
xmlpp::Element::NodeList::iterator k = ref_children.begin ();
xmlpp::Element::NodeList::iterator l = test_children.begin ();
- while (k != ref_children.end () && l != test_children.end ()) {
-
+ while (k != ref_children.end ()) {
+
/* XXX: should be doing xmlpp::EntityReference, xmlpp::XIncludeEnd, xmlpp::XIncludeStart */
xmlpp::Element* ref_el = dynamic_cast<xmlpp::Element*> (*k);
BOOST_CHECK_EQUAL (ref_cn->get_content(), test_cn->get_content ());
}
- xmlpp::Attribute* ref_at = dynamic_cast<xmlpp::Attribute*> (*k);
- xmlpp::Attribute* test_at = dynamic_cast<xmlpp::Attribute*> (*l);
- BOOST_CHECK ((ref_at && test_at) || (!ref_at && !test_at));
- if (ref_at && test_at) {
- BOOST_CHECK_EQUAL (ref_at->get_name(), test_at->get_name ());
- BOOST_CHECK_EQUAL (ref_at->get_value(), test_at->get_value ());
- }
-
++k;
++l;
}
- BOOST_CHECK (k == ref_children.end ());
- BOOST_CHECK (l == test_children.end ());
+ xmlpp::Element::AttributeList ref_attributes = ref->get_attributes ();
+ xmlpp::Element::AttributeList test_attributes = test->get_attributes ();
+ BOOST_CHECK_EQUAL (ref_attributes.size(), test_attributes.size ());
+
+ xmlpp::Element::AttributeList::const_iterator m = ref_attributes.begin();
+ xmlpp::Element::AttributeList::const_iterator n = test_attributes.begin();
+ while (m != ref_attributes.end ()) {
+ BOOST_CHECK_EQUAL ((*m)->get_name(), (*n)->get_name());
+ BOOST_CHECK_EQUAL ((*m)->get_value(), (*n)->get_value());
+
+ ++m;
+ ++n;
+ }
}
void