From e9956ae3a6593efc6f8cb344a00432ece51d1574 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Mon, 17 Nov 2014 19:52:23 -0800 Subject: 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. --- tests/test_document.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'tests/test_document.cpp') 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(""))); + CHECK(doc.load_string(STR(""))); 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(""))); + CHECK(doc.load_string(STR(""))); CHECK(doc.first_child()); std::basic_ifstream fs1("filedoesnotexist"); @@ -261,7 +261,7 @@ TEST(document_load_string) { pugi::xml_document doc; - CHECK(doc.load(STR(""))); + CHECK(doc.load_string(STR(""))); CHECK_NODE(doc, STR("")); } @@ -308,7 +308,7 @@ TEST(document_load_file_error) TEST(document_load_file_error_previous) { pugi::xml_document doc; - CHECK(doc.load(STR(""))); + CHECK(doc.load_string(STR(""))); 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(""))); + CHECK(!doc.load_string(STR(""))); 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("") CHECK(!doc.first_child()); CHECK_NODE(doc, STR("")); - CHECK(doc.load(STR(""))); + CHECK(doc.load_string(STR(""))); CHECK(doc.first_child()); CHECK_NODE(doc, STR("")); @@ -1268,7 +1268,7 @@ TEST(document_alignment) { xml_document* doc = new (buf + offset) xml_document; - CHECK(doc->load(STR(""))); + CHECK(doc->load_string(STR(""))); CHECK_NODE(*doc, STR("")); 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(""))); + CHECK_NODE(doc, STR("")); +} -- cgit v1.2.3