summaryrefslogtreecommitdiffhomepage
path: root/test-webserver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test-webserver.cpp')
-rw-r--r--test-webserver.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/test-webserver.cpp b/test-webserver.cpp
index 1b2c043..f7020af 100644
--- a/test-webserver.cpp
+++ b/test-webserver.cpp
@@ -13,24 +13,25 @@ namespace pt = boost::property_tree;
TEST(property_tree, put)
{
pt::ptree p;
+ pt::ptree list;
pt::ptree entry;
+
entry.put_value("name1.txt");
entry.put("<xmlattr>.type", "file1");
- p.push_back(pt::ptree::value_type("listentry", entry));
+ list.push_back(pt::ptree::value_type("listentry", entry));
entry.put_value("name2.txt");
entry.put("<xmlattr>.type", "file2");
- p.push_back(pt::ptree::value_type("listentry", entry));
+ list.push_back(pt::ptree::value_type("listentry", entry));
- pt::ptree list;
- list.push_back(pt::ptree::value_type("list", p));
+ p.push_back(pt::ptree::value_type("list", list));
std::stringstream ss;
- pt::xml_parser::write_xml(ss, list /*, pt::xml_parser::xml_writer_make_settings<std::string>(' ', 1)*/);
+ pt::xml_parser::write_xml(ss, p /*, pt::xml_parser::xml_writer_make_settings<std::string>(' ', 1)*/);
EXPECT_EQ(ss.str(), "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<list><listentry type=\"file1\">name1.txt</listentry><listentry type=\"file2\">name2.txt</listentry></list>");
}