From c456c26c3be801182054fb2fc399700eb1f6b05a Mon Sep 17 00:00:00 2001 From: Dom Del Nano Date: Tue, 13 Aug 2024 14:44:22 +0000 Subject: [PATCH] Fix linting issues Signed-off-by: Dom Del Nano --- src/stirling/obj_tools/BUILD.bazel | 2 +- src/stirling/obj_tools/elf_reader_test.cc | 6 ++++-- src/stirling/obj_tools/testdata/cc/BUILD.bazel | 4 ++-- src/stirling/obj_tools/testdata/cc/test_exe_fixture.h | 6 ++++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/stirling/obj_tools/BUILD.bazel b/src/stirling/obj_tools/BUILD.bazel index 63511ba1b47..5ce263f4ad6 100644 --- a/src/stirling/obj_tools/BUILD.bazel +++ b/src/stirling/obj_tools/BUILD.bazel @@ -53,7 +53,7 @@ pl_cc_test( "//src/stirling/obj_tools/testdata/cc:test_exe_debug_target", "//src/stirling/obj_tools/testdata/cc:test_exe_debuglink_target", "//src/stirling/obj_tools/testdata/go:test_go_1_19_binary", - "//src/stirling/obj_tools/testdata/go:test_go_1_19_nm_output" + "//src/stirling/obj_tools/testdata/go:test_go_1_19_nm_output", ], deps = [ ":cc_library", diff --git a/src/stirling/obj_tools/elf_reader_test.cc b/src/stirling/obj_tools/elf_reader_test.cc index c16533d98ad..29d3d99a74d 100644 --- a/src/stirling/obj_tools/elf_reader_test.cc +++ b/src/stirling/obj_tools/elf_reader_test.cc @@ -40,7 +40,8 @@ using ::testing::UnorderedElementsAre; using ::px::operator<<; -StatusOr NmSymbolNameToAddr(const std::string& nm_output_path, const std::string& symbol_name) { +StatusOr NmSymbolNameToAddr(const std::string& nm_output_path, + const std::string& symbol_name) { // Extract the address from nm as the gold standard. int64_t symbol_addr = -1; PX_ASSIGN_OR_RETURN(auto nm_out, px::ReadFileToString(nm_output_path)); @@ -250,7 +251,8 @@ TEST(ElfReaderTest, GolangAppRuntimeBuildVersion) { elf_reader->SearchTheOnlySymbol("runtime.buildVersion")); // Coverage build might alter the resultant binary. #ifndef PL_COVERAGE - ASSERT_OK_AND_ASSIGN(auto expected_addr, NmSymbolNameToAddr(kGoBinNmOutput, "runtime.buildVersion")); + ASSERT_OK_AND_ASSIGN(auto expected_addr, + NmSymbolNameToAddr(kGoBinNmOutput, "runtime.buildVersion")); EXPECT_EQ(symbol.address, expected_addr); #endif EXPECT_EQ(symbol.size, 16) << "Symbol table entry size should be 16"; diff --git a/src/stirling/obj_tools/testdata/cc/BUILD.bazel b/src/stirling/obj_tools/testdata/cc/BUILD.bazel index 0aafd66750d..9ec254cef81 100644 --- a/src/stirling/obj_tools/testdata/cc/BUILD.bazel +++ b/src/stirling/obj_tools/testdata/cc/BUILD.bazel @@ -53,8 +53,8 @@ cc_library( name = "test_exe_fixture", hdrs = ["test_exe_fixture.h"], data = [ - ":test_exe", - ":test_exe_nm_output", + ":test_exe", + ":test_exe_nm_output", ], deps = ["//src/common/exec:cc_library"], ) diff --git a/src/stirling/obj_tools/testdata/cc/test_exe_fixture.h b/src/stirling/obj_tools/testdata/cc/test_exe_fixture.h index adc91a413f6..d5098715862 100644 --- a/src/stirling/obj_tools/testdata/cc/test_exe_fixture.h +++ b/src/stirling/obj_tools/testdata/cc/test_exe_fixture.h @@ -31,7 +31,8 @@ namespace obj_tools { class TestExeFixture { public: static constexpr char kTestExePath[] = "src/stirling/obj_tools/testdata/cc/test_exe_/test_exe"; - static constexpr char kTestExeNmOutputPath[] = "src/stirling/obj_tools/testdata/cc/test_exe_nm_output"; + static constexpr char kTestExeNmOutputPath[] = + "src/stirling/obj_tools/testdata/cc/test_exe_nm_output"; const std::filesystem::path& Path() const { return test_exe_path_; } const std::filesystem::path& NmOutputPath() const { return test_exe_nm_output_path_; } @@ -43,7 +44,8 @@ class TestExeFixture { private: const std::filesystem::path test_exe_path_ = testing::BazelRunfilePath(kTestExePath); - const std::filesystem::path test_exe_nm_output_path_ = testing::BazelRunfilePath(kTestExeNmOutputPath); + const std::filesystem::path test_exe_nm_output_path_ = + testing::BazelRunfilePath(kTestExeNmOutputPath); }; } // namespace obj_tools