summaryrefslogtreecommitdiff
path: root/tests/test_document.cpp
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2014-11-17 19:52:23 -0800
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2014-11-17 19:52:23 -0800
commite9956ae3a6593efc6f8cb344a00432ece51d1574 (patch)
tree7a26d5c9e7faf32a5119bcc10040aa959b4b8686 /tests/test_document.cpp
parent79ed320f894c406dd3548e7d34cadd07fa82fb53 (diff)
Rename xml_document::load to load_string
This should completely eliminate the confusion between load and load_file. Of course, for compatibility reasons we have to preserve the old variant - it will be deprecated in a future version and subsequently removed.
Diffstat (limited to 'tests/test_document.cpp')
-rw-r--r--tests/test_document.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/tests/test_document.cpp b/tests/test_document.cpp
index 2cc39a6..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 />"));
}
@@ -308,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);
@@ -590,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")));
}
@@ -1079,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");
}
@@ -1114,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 />"));
@@ -1268,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();
@@ -1308,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 />"));
+}