Skip to content

Commit

Permalink
Fix linting issues
Browse files Browse the repository at this point in the history
Signed-off-by: Dom Del Nano <[email protected]>
  • Loading branch information
ddelnano committed Aug 13, 2024
1 parent 4a8ad5c commit c456c26
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/stirling/obj_tools/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 4 additions & 2 deletions src/stirling/obj_tools/elf_reader_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ using ::testing::UnorderedElementsAre;

using ::px::operator<<;

StatusOr<int64_t> NmSymbolNameToAddr(const std::string& nm_output_path, const std::string& symbol_name) {
StatusOr<int64_t> 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));
Expand Down Expand Up @@ -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";
Expand Down
4 changes: 2 additions & 2 deletions src/stirling/obj_tools/testdata/cc/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
)
Expand Down
6 changes: 4 additions & 2 deletions src/stirling/obj_tools/testdata/cc/test_exe_fixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_; }
Expand All @@ -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
Expand Down

0 comments on commit c456c26

Please sign in to comment.