summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_deprecated.cpp21
-rw-r--r--tests/test_document.cpp7
-rw-r--r--tests/test_xpath_api.cpp11
3 files changed, 21 insertions, 18 deletions
diff --git a/tests/test_deprecated.cpp b/tests/test_deprecated.cpp
new file mode 100644
index 0000000..55f8937
--- /dev/null
+++ b/tests/test_deprecated.cpp
@@ -0,0 +1,21 @@
+#define PUGIXML_DEPRECATED // Suppress deprecated declarations to avoid warnings
+
+#include "common.hpp"
+
+TEST(document_deprecated_load)
+{
+ xml_document doc;
+ CHECK(doc.load(STR("<node/>")));
+ CHECK_NODE(doc, STR("<node/>"));
+}
+
+TEST_XML(xpath_api_deprecated_select_single_node, "<node><head/><foo id='1'/><foo/><tail/></node>")
+{
+ xpath_node n1 = doc.select_single_node(STR("node/foo"));
+
+ xpath_query q(STR("node/foo"));
+ xpath_node n2 = doc.select_single_node(q);
+
+ CHECK(n1.node().attribute(STR("id")).as_int() == 1);
+ CHECK(n2.node().attribute(STR("id")).as_int() == 1);
+}
diff --git a/tests/test_document.cpp b/tests/test_document.cpp
index b702a07..fd376bb 100644
--- a/tests/test_document.cpp
+++ b/tests/test_document.cpp
@@ -1479,10 +1479,3 @@ TEST(document_convert_out_of_memory)
delete[] files[j].data;
}
}
-
-TEST(document_deprecated_load)
-{
- xml_document doc;
- CHECK(doc.load(STR("<node/>")));
- CHECK_NODE(doc, STR("<node/>"));
-}
diff --git a/tests/test_xpath_api.cpp b/tests/test_xpath_api.cpp
index 3f05e13..f933fb8 100644
--- a/tests/test_xpath_api.cpp
+++ b/tests/test_xpath_api.cpp
@@ -399,17 +399,6 @@ TEST_XML(xpath_api_node_set_assign_out_of_memory_preserve, "<node><a/><b/></node
CHECK(ns[0] == doc.child(STR("node")).child(STR("a")) && ns[1] == doc.child(STR("node")).child(STR("b")));
}
-TEST_XML(xpath_api_deprecated_select_single_node, "<node><head/><foo id='1'/><foo/><tail/></node>")
-{
- xpath_node n1 = doc.select_single_node(STR("node/foo"));
-
- xpath_query q(STR("node/foo"));
- xpath_node n2 = doc.select_single_node(q);
-
- CHECK(n1.node().attribute(STR("id")).as_int() == 1);
- CHECK(n2.node().attribute(STR("id")).as_int() == 1);
-}
-
TEST(xpath_api_empty)
{
xml_node c;