summaryrefslogtreecommitdiff
path: root/libunwindstack/tests/DwarfEhFrameWithHdrTest.cpp
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2017-11-08 21:55:17 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-11-08 21:55:17 +0000
commit1a57a08bb5fb18355e519ffb0445f2129dca05e0 (patch)
treea2b3d243389c355ce4b3d14ea3958f029c29e882 /libunwindstack/tests/DwarfEhFrameWithHdrTest.cpp
parent9b45da952c5c689b0f73e73ed6b49784698ead81 (diff)
parent5ead5f7df9c9cba28c37617929e4a278271bc096 (diff)
Merge "Fix another nullptr dereference." am: 331d8e9b1a
am: 5ead5f7df9 Change-Id: I8911bbc38a09b7222d67736a9271bfc31c1beba4
Diffstat (limited to 'libunwindstack/tests/DwarfEhFrameWithHdrTest.cpp')
-rw-r--r--libunwindstack/tests/DwarfEhFrameWithHdrTest.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/libunwindstack/tests/DwarfEhFrameWithHdrTest.cpp b/libunwindstack/tests/DwarfEhFrameWithHdrTest.cpp
index 7c8fc6cc4..1028ab9fe 100644
--- a/libunwindstack/tests/DwarfEhFrameWithHdrTest.cpp
+++ b/libunwindstack/tests/DwarfEhFrameWithHdrTest.cpp
@@ -205,6 +205,14 @@ TYPED_TEST_P(DwarfEhFrameWithHdrTest, GetFdeOffsetBinary_verify) {
}
}
+TYPED_TEST_P(DwarfEhFrameWithHdrTest, GetFdeOffsetBinary_index_fail) {
+ this->eh_frame_->TestSetTableEntrySize(0x10);
+ this->eh_frame_->TestSetFdeCount(10);
+
+ uint64_t fde_offset;
+ EXPECT_FALSE(this->eh_frame_->GetFdeOffsetBinary(0x1000, &fde_offset, 10));
+}
+
TYPED_TEST_P(DwarfEhFrameWithHdrTest, GetFdeOffsetSequential) {
this->eh_frame_->TestSetFdeCount(10);
this->eh_frame_->TestSetEntriesDataOffset(0x100);
@@ -414,10 +422,11 @@ TYPED_TEST_P(DwarfEhFrameWithHdrTest, GetFdeFromPc_fde_not_found) {
REGISTER_TYPED_TEST_CASE_P(DwarfEhFrameWithHdrTest, Init, GetFdeInfoFromIndex_expect_cache_fail,
GetFdeInfoFromIndex_read_pcrel, GetFdeInfoFromIndex_read_datarel,
GetFdeInfoFromIndex_cached, GetFdeOffsetBinary_verify,
- GetFdeOffsetSequential, GetFdeOffsetSequential_last_element,
- GetFdeOffsetSequential_end_check, GetFdeOffsetFromPc_fail_fde_count,
- GetFdeOffsetFromPc_binary_search, GetFdeOffsetFromPc_sequential_search,
- GetCieFde32, GetCieFde64, GetFdeFromPc_fde_not_found);
+ GetFdeOffsetBinary_index_fail, GetFdeOffsetSequential,
+ GetFdeOffsetSequential_last_element, GetFdeOffsetSequential_end_check,
+ GetFdeOffsetFromPc_fail_fde_count, GetFdeOffsetFromPc_binary_search,
+ GetFdeOffsetFromPc_sequential_search, GetCieFde32, GetCieFde64,
+ GetFdeFromPc_fde_not_found);
typedef ::testing::Types<uint32_t, uint64_t> DwarfEhFrameWithHdrTestTypes;
INSTANTIATE_TYPED_TEST_CASE_P(, DwarfEhFrameWithHdrTest, DwarfEhFrameWithHdrTestTypes);