diff options
Diffstat (limited to 'tools/aapt2/cmd/Link_test.cpp')
-rw-r--r-- | tools/aapt2/cmd/Link_test.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/aapt2/cmd/Link_test.cpp b/tools/aapt2/cmd/Link_test.cpp index 3c8b72d3cb2c..9ea93f638aff 100644 --- a/tools/aapt2/cmd/Link_test.cpp +++ b/tools/aapt2/cmd/Link_test.cpp @@ -43,7 +43,11 @@ TEST_F(LinkTest, RemoveRawXmlStrings) { // Load the binary xml tree android::ResXMLTree tree; std::unique_ptr<LoadedApk> apk = LoadedApk::LoadApkFromPath(out_apk, &diag); - AssertLoadXml(apk.get(), "res/xml/test.xml", &tree); + + std::unique_ptr<io::IData> data = OpenFileAsData(apk.get(), "res/xml/test.xml"); + ASSERT_THAT(data, Ne(nullptr)); + + AssertLoadXml(apk.get(), data.get(), &tree); // Check that the raw string index has not been assigned EXPECT_THAT(tree.getAttributeValueStringID(0), Eq(-1)); @@ -67,7 +71,11 @@ TEST_F(LinkTest, KeepRawXmlStrings) { // Load the binary xml tree android::ResXMLTree tree; std::unique_ptr<LoadedApk> apk = LoadedApk::LoadApkFromPath(out_apk, &diag); - AssertLoadXml(apk.get(), "res/xml/test.xml", &tree); + + std::unique_ptr<io::IData> data = OpenFileAsData(apk.get(), "res/xml/test.xml"); + ASSERT_THAT(data, Ne(nullptr)); + + AssertLoadXml(apk.get(), data.get(), &tree); // Check that the raw string index has been set to the correct string pool entry int32_t raw_index = tree.getAttributeValueStringID(0); |