diff options
Diffstat (limited to 'tools/aapt2/xml/XmlPullParser_test.cpp')
-rw-r--r-- | tools/aapt2/xml/XmlPullParser_test.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/aapt2/xml/XmlPullParser_test.cpp b/tools/aapt2/xml/XmlPullParser_test.cpp index 1cce4850cac5..681d9d48173f 100644 --- a/tools/aapt2/xml/XmlPullParser_test.cpp +++ b/tools/aapt2/xml/XmlPullParser_test.cpp @@ -16,21 +16,22 @@ #include "xml/XmlPullParser.h" -#include <sstream> - #include "androidfw/StringPiece.h" +#include "io/StringInputStream.h" #include "test/Test.h" -using android::StringPiece; +using ::aapt::io::StringInputStream; +using ::android::StringPiece; namespace aapt { TEST(XmlPullParserTest, NextChildNodeTraversesCorrectly) { - std::stringstream str; - str << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" - "<a><b><c xmlns:a=\"http://schema.org\"><d/></c><e/></b></a>"; - xml::XmlPullParser parser(str); + std::string str = + R"(<?xml version="1.0" encoding="utf-8"?> + <a><b><c xmlns:a="http://schema.org"><d/></c><e/></b></a>)"; + StringInputStream input(str); + xml::XmlPullParser parser(&input); const size_t depth_outer = parser.depth(); ASSERT_TRUE(xml::XmlPullParser::NextChildNode(&parser, depth_outer)); |