summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_header_only_1.cpp (renamed from tests/test_header_only.cpp)2
-rw-r--r--tests/test_header_only_2.cpp19
2 files changed, 20 insertions, 1 deletions
diff --git a/tests/test_header_only.cpp b/tests/test_header_only_1.cpp
index 17cafca..e33fd78 100644
--- a/tests/test_header_only.cpp
+++ b/tests/test_header_only_1.cpp
@@ -7,7 +7,7 @@
#include "../src/pugixml.hpp"
#include "../src/pugixml.hpp"
-TEST(header_only)
+TEST(header_only_1)
{
xml_document doc;
CHECK(doc.load_string(STR("<node/>")));
diff --git a/tests/test_header_only_2.cpp b/tests/test_header_only_2.cpp
new file mode 100644
index 0000000..220c807
--- /dev/null
+++ b/tests/test_header_only_2.cpp
@@ -0,0 +1,19 @@
+#define PUGIXML_HEADER_ONLY
+#define pugi pugih
+
+#include "common.hpp"
+
+// Check header guards
+#include "../src/pugixml.hpp"
+#include "../src/pugixml.hpp"
+
+TEST(header_only_2)
+{
+ xml_document doc;
+ CHECK(doc.load_string(STR("<node/>")));
+ CHECK_STRING(doc.first_child().name(), STR("node"));
+
+#ifndef PUGIXML_NO_XPATH
+ CHECK(doc.first_child() == doc.select_node(STR("//*")).node());
+#endif
+}