summaryrefslogtreecommitdiff
path: root/tests/test_document.cpp
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2014-11-20 23:47:00 -0800
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2014-11-20 23:47:16 -0800
commitdb8df4a5665cfb24c1c18be438d10b2e310a234e (patch)
tree16d251ba91d88fd99343e9628348f912e0170f1a /tests/test_document.cpp
parentcca23e636354dc73429a19e14e32cc9a5e632735 (diff)
parent125aa55061ccde4ae7351a9a6c7270a15c9e0204 (diff)
Merge branch 'master' into compact
Diffstat (limited to 'tests/test_document.cpp')
-rw-r--r--tests/test_document.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/tests/test_document.cpp b/tests/test_document.cpp
index 2774a07..4228602 100644
--- a/tests/test_document.cpp
+++ b/tests/test_document.cpp
@@ -158,7 +158,7 @@ TEST(document_load_stream_exceptions)
TEST(document_load_stream_error_previous)
{
pugi::xml_document doc;
- CHECK(doc.load(STR("<node/>")));
+ CHECK(doc.load_string(STR("<node/>")));
CHECK(doc.first_child());
std::ifstream fs1("filedoesnotexist");
@@ -169,7 +169,7 @@ TEST(document_load_stream_error_previous)
TEST(document_load_stream_wide_error_previous)
{
pugi::xml_document doc;
- CHECK(doc.load(STR("<node/>")));
+ CHECK(doc.load_string(STR("<node/>")));
CHECK(doc.first_child());
std::basic_ifstream<wchar_t> fs1("filedoesnotexist");
@@ -261,7 +261,7 @@ TEST(document_load_string)
{
pugi::xml_document doc;
- CHECK(doc.load(STR("<node/>")));
+ CHECK(doc.load_string(STR("<node/>")));
CHECK_NODE(doc, STR("<node />"));
}
@@ -301,10 +301,6 @@ TEST(document_load_file_error)
CHECK(doc.load_file("filedoesnotexist").status == status_file_not_found);
-#ifndef _WIN32
- CHECK(doc.load_file("/dev/tty").status == status_io_error);
-#endif
-
test_runner::_memory_fail_threshold = 1;
CHECK(doc.load_file("tests/data/small.xml").status == status_out_of_memory);
}
@@ -312,7 +308,7 @@ TEST(document_load_file_error)
TEST(document_load_file_error_previous)
{
pugi::xml_document doc;
- CHECK(doc.load(STR("<node/>")));
+ CHECK(doc.load_string(STR("<node/>")));
CHECK(doc.first_child());
CHECK(doc.load_file("filedoesnotexist").status == status_file_not_found);
@@ -594,7 +590,7 @@ TEST(document_parse_result_description)
TEST(document_load_fail)
{
xml_document doc;
- CHECK(!doc.load(STR("<foo><bar/>")));
+ CHECK(!doc.load_string(STR("<foo><bar/>")));
CHECK(doc.child(STR("foo")).child(STR("bar")));
}
@@ -1083,7 +1079,7 @@ TEST(document_load_exceptions)
try
{
pugi::xml_document doc;
- if (!doc.load(STR("<node attribute='value"))) throw std::bad_alloc();
+ if (!doc.load_string(STR("<node attribute='value"))) throw std::bad_alloc();
CHECK_FORCE_FAIL("Expected parsing failure");
}
@@ -1118,7 +1114,7 @@ TEST_XML(document_reset, "<node><child/></node>")
CHECK(!doc.first_child());
CHECK_NODE(doc, STR(""));
- CHECK(doc.load(STR("<node/>")));
+ CHECK(doc.load_string(STR("<node/>")));
CHECK(doc.first_child());
CHECK_NODE(doc, STR("<node />"));
@@ -1272,7 +1268,7 @@ TEST(document_alignment)
{
xml_document* doc = new (buf + offset) xml_document;
- CHECK(doc->load(STR("<node />")));
+ CHECK(doc->load_string(STR("<node />")));
CHECK_NODE(*doc, STR("<node />"));
doc->~xml_document();
@@ -1312,3 +1308,10 @@ 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 />"));
+}