Skip to content

Commit d1ffe2d

Browse files
author
weisu
committed
Follow symlinks in reading data file
PatchUtilsTest.GatherDumpMetadata and PatchUtilsTest.GatherMetadata failed when data file is under Bazel's runfile dir. Reading file would fail if we don't follow symlink since the data file is a symlink to the real file in $ANDROID_HOST_OUT dir. See https://docs.bazel.build/versions/2.0.0/output_directories.html for more information. Bug: 211806329 Test: atest --bazel-mode fastdeploy_test_host Test: atest fastdeploy_test Change-Id: I3d4f6e08aa36bebc012a5970f55babc5d8d75e59
1 parent de7776a commit d1ffe2d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fastdeploy/deploypatchgenerator/patch_utils_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ TEST(PatchUtilsTest, GatherMetadata) {
9393

9494
std::string expectedMetadata;
9595
android::base::ReadFileToString(GetTestFile("rotating_cube-metadata-release.data"),
96-
&expectedMetadata);
96+
&expectedMetadata, true);
9797
APKMetaData expected;
9898
EXPECT_TRUE(expected.ParseFromString(expectedMetadata));
9999

@@ -123,7 +123,7 @@ TEST(PatchUtilsTest, GatherDumpMetadata) {
123123

124124
{
125125
std::string cd;
126-
android::base::ReadFileToString(GetTestFile("sample.cd"), &cd);
126+
android::base::ReadFileToString(GetTestFile("sample.cd"), &cd, true);
127127

128128
APKDump dump;
129129
dump.set_cd(std::move(cd));

0 commit comments

Comments
 (0)