summaryrefslogtreecommitdiff
path: root/simpleperf/read_elf_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'simpleperf/read_elf_test.cpp')
-rw-r--r--simpleperf/read_elf_test.cpp9
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));