diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2020-04-24 01:13:15 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-04-24 01:13:15 +0000 |
commit | 5ec94e65d90e7e46b65bb2ea31893efafae21008 (patch) | |
tree | f7ee8f39dfb19f5286e82cc66021b79cebeb32d4 /simpleperf/read_elf_test.cpp | |
parent | db46fea2dd7683dc9969769de77be8cd966ffa25 (diff) | |
parent | 901a08a73484b0989530fb9fc7de0829d13d6757 (diff) | |
download | extras-5ec94e65d90e7e46b65bb2ea31893efafae21008.tar.gz |
Snap for 6424828 from 901a08a73484b0989530fb9fc7de0829d13d6757 to rvc-release
Change-Id: I3bbfe4f5d361406b4fd073014ca47a25eb2a931f
Diffstat (limited to 'simpleperf/read_elf_test.cpp')
-rw-r--r-- | simpleperf/read_elf_test.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/simpleperf/read_elf_test.cpp b/simpleperf/read_elf_test.cpp index 9f74366c..cc5aa52b 100644 --- a/simpleperf/read_elf_test.cpp +++ b/simpleperf/read_elf_test.cpp @@ -29,6 +29,8 @@ #define ELF_NOTE_GNU "GNU" #define NT_GNU_BUILD_ID 3 +using namespace simpleperf; + TEST(read_elf, GetBuildIdFromNoteSection) { BuildId build_id; std::vector<char> data; @@ -137,7 +139,12 @@ TEST(read_elf, arm_mapping_symbol) { ASSERT_FALSE(IsArmMappingSymbol("$a_no_dot")); } -TEST(read_elf, IsValidElfPath) { +TEST(read_elf, ElfFile_Open) { + auto IsValidElfPath = [](const std::string& path) { + ElfStatus status; + ElfFile::Open(path, &status); + return status; + }; ASSERT_NE(ElfStatus::NO_ERROR, IsValidElfPath("/dev/zero")); TemporaryFile tmp_file; ASSERT_EQ(ElfStatus::READ_FAILED, IsValidElfPath(tmp_file.path)); |