From 4385785b74dc42064926f932679de431052d2bbd Mon Sep 17 00:00:00 2001 From: Jackal Guo Date: Tue, 19 Oct 2021 15:24:59 +0800 Subject: [PATCH] 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 --- libs/androidfw/tests/PosixUtils_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/androidfw/tests/PosixUtils_test.cpp b/libs/androidfw/tests/PosixUtils_test.cpp index c7b3eba1451ff..8c49350796ec6 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) {