diff options
author | Christopher Ferris <cferris@google.com> | 2019-03-12 15:17:36 -0700 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2019-03-12 16:00:55 -0700 |
commit | 86f2d9d943aa61efea1193682f35d5daccf78681 (patch) | |
tree | 10d2467a3fbbeeb4cabec06ba06fd1e67db94b3f /libunwindstack/tests/MapInfoCreateMemoryTest.cpp | |
parent | 1922a501bf70eb6fa0caa7571f18e92482f30ff9 (diff) |
Fix missing offset for apk.
The elf_start_offset field in a map_info was not set in one path.
Added new offline test for this, and update a few unit tests.
Bug: 128442792
Test: New unit tests pass.
Change-Id: I2c6ac1b5271a99aa0e8c4b6342a5970199185112
Diffstat (limited to 'libunwindstack/tests/MapInfoCreateMemoryTest.cpp')
-rw-r--r-- | libunwindstack/tests/MapInfoCreateMemoryTest.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libunwindstack/tests/MapInfoCreateMemoryTest.cpp b/libunwindstack/tests/MapInfoCreateMemoryTest.cpp index a66685a26..2ddadef37 100644 --- a/libunwindstack/tests/MapInfoCreateMemoryTest.cpp +++ b/libunwindstack/tests/MapInfoCreateMemoryTest.cpp @@ -178,7 +178,7 @@ TEST_F(MapInfoCreateMemoryTest, file_backed_non_zero_offset_partial_file) { std::unique_ptr<Memory> memory(info.CreateMemory(process_memory_)); ASSERT_TRUE(memory.get() != nullptr); ASSERT_EQ(0U, info.elf_offset); - EXPECT_EQ(0U, info.elf_start_offset); + EXPECT_EQ(0x1000U, info.elf_start_offset); // Read the valid part of the file. std::vector<uint8_t> buffer(0x100); @@ -202,7 +202,7 @@ TEST_F(MapInfoCreateMemoryTest, file_backed_non_zero_offset_partial_file_whole_e std::unique_ptr<Memory> memory(info.CreateMemory(process_memory_)); ASSERT_TRUE(memory.get() != nullptr); ASSERT_EQ(0U, info.elf_offset); - EXPECT_EQ(0U, info.elf_start_offset); + EXPECT_EQ(0x1000U, info.elf_start_offset); // Verify the memory is a valid elf. uint8_t e_ident[SELFMAG + 1]; @@ -219,7 +219,7 @@ TEST_F(MapInfoCreateMemoryTest, file_backed_non_zero_offset_partial_file_whole_e std::unique_ptr<Memory> memory(info.CreateMemory(process_memory_)); ASSERT_TRUE(memory.get() != nullptr); ASSERT_EQ(0U, info.elf_offset); - EXPECT_EQ(0U, info.elf_start_offset); + EXPECT_EQ(0x2000U, info.elf_start_offset); // Verify the memory is a valid elf. uint8_t e_ident[SELFMAG + 1]; |