Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71992 - in branches/release/libs/property_tree: . test
From: sebastian.redl_at_[hidden]
Date: 2011-05-16 14:34:42


Author: cornedbee
Date: 2011-05-16 14:34:41 EDT (Mon, 16 May 2011)
New Revision: 71992
URL: http://svn.boost.org/trac/boost/changeset/71992

Log:
Merge r68990-68993, several fixes to PTree. Fixes bug 1678. Fixes bug 4387. Forgot to commit these together with the header part.
Properties modified:
   branches/release/libs/property_tree/ (props changed)
Text files modified:
   branches/release/libs/property_tree/test/test_json_parser.cpp | 9 +++++++++
   branches/release/libs/property_tree/test/test_xml_parser_common.hpp | 6 ++++++
   branches/release/libs/property_tree/test/xml_parser_test_data.hpp | 6 +++++-
   3 files changed, 20 insertions(+), 1 deletions(-)

Modified: branches/release/libs/property_tree/test/test_json_parser.cpp
==============================================================================
--- branches/release/libs/property_tree/test/test_json_parser.cpp (original)
+++ branches/release/libs/property_tree/test/test_json_parser.cpp 2011-05-16 14:34:41 EDT (Mon, 16 May 2011)
@@ -249,6 +249,9 @@
 const char *error_data_4 =
     "{\n\"a\"\n}"; // No object
 
+const char *bug_data_pr4387 =
+ "[1, 2, 3]"; // Root array
+
 struct ReadFunc
 {
     template<class Ptree>
@@ -369,6 +372,12 @@
         "testerr4.json", NULL, "testerr4out.json", 3
     );
 
+ generic_parser_test_ok<Ptree, ReadFunc, WriteFunc>
+ (
+ ReadFunc(), WriteFunc(), bug_data_pr4387, NULL,
+ "testpr4387.json", NULL, "testpr4387out.json", 4, 3, 0
+ );
+
 }
 
 int test_main(int argc, char *argv[])

Modified: branches/release/libs/property_tree/test/test_xml_parser_common.hpp
==============================================================================
--- branches/release/libs/property_tree/test/test_xml_parser_common.hpp (original)
+++ branches/release/libs/property_tree/test/test_xml_parser_common.hpp 2011-05-16 14:34:41 EDT (Mon, 16 May 2011)
@@ -124,6 +124,12 @@
         ReadFuncWS(), WriteFuncWS(), bug_data_pr2855, NULL,
         "testpr2855.xml", NULL, "testpr2855out.xml", 3, 7, 14
     );
+
+ generic_parser_test_ok<Ptree, ReadFuncWS, WriteFuncWS>
+ (
+ ReadFuncWS(), WriteFuncWS(), bug_data_pr1678, NULL,
+ "testpr1678.xml", NULL, "testpr1678out.xml", 2, 0, 4
+ );
 
 }
 

Modified: branches/release/libs/property_tree/test/xml_parser_test_data.hpp
==============================================================================
--- branches/release/libs/property_tree/test/xml_parser_test_data.hpp (original)
+++ branches/release/libs/property_tree/test/xml_parser_test_data.hpp 2011-05-16 14:34:41 EDT (Mon, 16 May 2011)
@@ -761,7 +761,11 @@
     "<start>"; // XML tag not closed
 
 const char *bug_data_pr2855 =
- "<?xml version=\"1.0\" encoding\"utf-8\"?>\n"
+ "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
     "<start> notrim</start>";
 
+// byte order mark
+const char *bug_data_pr1678 =
+ "\xEF\xBB\xBF<?xml version=\"1.0\" encoding=\"utf-8\"?><root/>";
+
 #endif


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk