Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56e335e7 authored by Jooyung Han's avatar Jooyung Han Committed by Automerger Merge Worker
Browse files

Fix binder log tests am: cbb09d0d am: aa9a274c am: 1a1f5b93 am: 84321135

Original change: https://android-review.googlesource.com/c/platform/packages/modules/DnsResolver/+/1607434

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Idce99b8a4973b843277f363862be2d75a3c18286
parents 5a6cd34a 84321135
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -132,7 +132,6 @@ class DnsResolverBinderTest : public ::testing::Test {
        // For each element of testdata, check that the expected output appears in the dump output.
        // If not, fail the test and use hintRegex to print similar lines to assist in debugging.
        for (const auto& td : mExpectedLogData) {
            const std::string toErase = "(null)";
            const bool found =
                    std::any_of(lines.begin(), lines.end(), [&](const std::string& line) {
                        std::smatch match;
@@ -144,11 +143,8 @@ class DnsResolverBinderTest : public ::testing::Test {
                        // have this format in log. So to make register null listener tests are
                        // compatible from all version, just remove the "(null)" argument from
                        // output logs if existed.
                        std::string output = match[1].str();
                        const auto pos = output.find(toErase);
                        if (pos != std::string::npos && pos < output.length()) {
                            output.erase(pos, toErase.length());
                        }
                        const std::string output = android::base::StringReplace(
                                match[1].str(), "(null)", "", /*all=*/true);
                        return output == td.output;
                    });
            EXPECT_TRUE(found) << "Didn't find line '" << td.output << "' in dumpsys output.";