mirror of
https://github.com/zeux/pugixml.git
synced 2024-12-27 13:33:17 +08:00
tests: Add a copy of header-only test
This makes sure we get linking errors whenever a symbol is not marked as inline in header-only mode.
This commit is contained in:
parent
299e0b07c9
commit
6e5163ba3e
@ -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/>")));
|
19
tests/test_header_only_2.cpp
Normal file
19
tests/test_header_only_2.cpp
Normal file
@ -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
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user