summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jackal Guo <jackalguo@google.com> 2021-10-19 15:24:59 +0800
committer Jackal Guo <jackalguo@google.com> 2021-10-19 07:28:15 +0000
commit4385785b74dc42064926f932679de431052d2bbd (patch)
treee3b2e00e61e62a8bc610143c4dc510aeff7e1210
parent93ef99202a844f68cdecff77f85c3099d7d3a5e4 (diff)
Fix broken tests in libandroidfw_tests
Due to the output format changes, revise the PosixUtils_test to fix the failures. Fix: 203494455 Test: atest libandroidfw_tests Change-Id: I6e84f8011031162f9e46aa89ddf8d3f3b9863251
-rw-r--r--libs/androidfw/tests/PosixUtils_test.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/androidfw/tests/PosixUtils_test.cpp b/libs/androidfw/tests/PosixUtils_test.cpp
index c7b3eba1451f..8c49350796ec 100644
--- a/libs/androidfw/tests/PosixUtils_test.cpp
+++ b/libs/androidfw/tests/PosixUtils_test.cpp
@@ -30,14 +30,14 @@ TEST(PosixUtilsTest, AbsolutePathToBinary) {
const auto result = ExecuteBinary({"/bin/date", "--help"});
ASSERT_THAT(result, NotNull());
ASSERT_EQ(result->status, 0);
- ASSERT_EQ(result->stdout_str.find("usage: date "), 0);
+ ASSERT_GE(result->stdout_str.find("usage: date "), 0);
}
TEST(PosixUtilsTest, RelativePathToBinary) {
const auto result = ExecuteBinary({"date", "--help"});
ASSERT_THAT(result, NotNull());
ASSERT_EQ(result->status, 0);
- ASSERT_EQ(result->stdout_str.find("usage: date "), 0);
+ ASSERT_GE(result->stdout_str.find("usage: date "), 0);
}
TEST(PosixUtilsTest, BadParameters) {