File: test_deprecated.cpp

package info (click to toggle)
pugixml 1.14-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,052 kB
  • sloc: cpp: 24,068; xml: 2,151; makefile: 80; python: 44; sh: 9
file content (25 lines) | stat: -rw-r--r-- 630 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#define PUGIXML_DEPRECATED // Suppress deprecated declarations to avoid warnings

#include "test.hpp"

using namespace pugi;

TEST(document_deprecated_load)
{
	xml_document doc;
	CHECK(doc.load(STR("<node/>")));
	CHECK_NODE(doc, STR("<node/>"));
}

#ifndef PUGIXML_NO_XPATH
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);
}
#endif