diff options
author | Christopher Ferris <cferris@google.com> | 2019-07-17 15:47:32 -0700 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2019-07-17 18:08:32 -0700 |
commit | ea8e7d10d7178004aa8368410618e6f08b90d2fa (patch) | |
tree | 3aa77f10bcf13cad51a0ddd8964b710cee1b8db6 /libunwindstack/tests/MapInfoCreateMemoryTest.cpp | |
parent | 97c06703f6cd899d62b83ba8c7d2b226ad12da95 (diff) |
Move to isolated testing.
Modify the MapInfoCreateMemoryTest to work in the isolated mode.
Test: Ran unit tests on host/target.
Change-Id: I84e01d96e852acd813e0f203b4a207cfaf8ca556
Diffstat (limited to 'libunwindstack/tests/MapInfoCreateMemoryTest.cpp')
-rw-r--r-- | libunwindstack/tests/MapInfoCreateMemoryTest.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/libunwindstack/tests/MapInfoCreateMemoryTest.cpp b/libunwindstack/tests/MapInfoCreateMemoryTest.cpp index 5b4ca7c44..6c1cfa222 100644 --- a/libunwindstack/tests/MapInfoCreateMemoryTest.cpp +++ b/libunwindstack/tests/MapInfoCreateMemoryTest.cpp @@ -58,7 +58,7 @@ class MapInfoCreateMemoryTest : public ::testing::Test { ASSERT_TRUE(android::base::WriteFully(fd, buffer.data(), buffer.size())); } - static void SetUpTestSuite() { + void SetUp() override { std::vector<uint8_t> buffer(12288, 0); memcpy(buffer.data(), ELFMAG, SELFMAG); buffer[EI_CLASS] = ELFCLASS32; @@ -72,9 +72,7 @@ class MapInfoCreateMemoryTest : public ::testing::Test { InitElf<Elf32_Ehdr, Elf32_Shdr>(elf32_at_map_.fd, 0x1000, 0x2000, ELFCLASS32); InitElf<Elf64_Ehdr, Elf64_Shdr>(elf64_at_map_.fd, 0x2000, 0x3000, ELFCLASS64); - } - void SetUp() override { memory_ = new MemoryFake; process_memory_.reset(memory_); } @@ -82,17 +80,13 @@ class MapInfoCreateMemoryTest : public ::testing::Test { MemoryFake* memory_; std::shared_ptr<Memory> process_memory_; - static TemporaryFile elf_; + TemporaryFile elf_; - static TemporaryFile elf_at_1000_; + TemporaryFile elf_at_1000_; - static TemporaryFile elf32_at_map_; - static TemporaryFile elf64_at_map_; + TemporaryFile elf32_at_map_; + TemporaryFile elf64_at_map_; }; -TemporaryFile MapInfoCreateMemoryTest::elf_; -TemporaryFile MapInfoCreateMemoryTest::elf_at_1000_; -TemporaryFile MapInfoCreateMemoryTest::elf32_at_map_; -TemporaryFile MapInfoCreateMemoryTest::elf64_at_map_; TEST_F(MapInfoCreateMemoryTest, end_le_start) { MapInfo info(nullptr, 0x100, 0x100, 0, 0, elf_.path); |