diff options
author | Josh Gao <jmgao@google.com> | 2017-10-18 11:44:51 -0700 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2017-11-15 15:38:13 -0800 |
commit | ef35aa5d40b6404baf702a58527f1cd3a9f42f19 (patch) | |
tree | 99f7797b05c934a10fdcb058b025a0304ca2b6f5 /libunwindstack/tests/MemoryRangeTest.cpp | |
parent | 29c5378e91720b7befabc91fbab0f25d59a23bf1 (diff) |
unwindstack: rename Memory::Read to ReadFully.
Rename Memory::Read to ReadFully to match its semantics with that of
android::base. ReadPartially will be renamed to Read in a follow up
commit, kept intentionally separate so that there aren't any callers
accidentally switched from ReadFully to Read.
Test: treehugger
Change-Id: I7d845ac5244c3025d92c8512e960e5d0d1da05af
Diffstat (limited to 'libunwindstack/tests/MemoryRangeTest.cpp')
-rw-r--r-- | libunwindstack/tests/MemoryRangeTest.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libunwindstack/tests/MemoryRangeTest.cpp b/libunwindstack/tests/MemoryRangeTest.cpp index 4a764f59f..499536c0f 100644 --- a/libunwindstack/tests/MemoryRangeTest.cpp +++ b/libunwindstack/tests/MemoryRangeTest.cpp @@ -38,7 +38,7 @@ TEST(MemoryRangeTest, read) { MemoryRange range(process_memory, 9001, src.size(), 0); std::vector<uint8_t> dst(1024); - ASSERT_TRUE(range.Read(0, dst.data(), src.size())); + ASSERT_TRUE(range.ReadFully(0, dst.data(), src.size())); for (size_t i = 0; i < 1024; i++) { ASSERT_EQ(0x4cU, dst[i]) << "Failed at byte " << i; } @@ -54,18 +54,18 @@ TEST(MemoryRangeTest, read_near_limit) { MemoryRange range(process_memory, 1000, 1024, 0); std::vector<uint8_t> dst(1024); - ASSERT_TRUE(range.Read(1020, dst.data(), 4)); + ASSERT_TRUE(range.ReadFully(1020, dst.data(), 4)); for (size_t i = 0; i < 4; i++) { ASSERT_EQ(0x4cU, dst[i]) << "Failed at byte " << i; } // Verify that reads outside of the range will fail. - ASSERT_FALSE(range.Read(1020, dst.data(), 5)); - ASSERT_FALSE(range.Read(1024, dst.data(), 1)); - ASSERT_FALSE(range.Read(1024, dst.data(), 1024)); + ASSERT_FALSE(range.ReadFully(1020, dst.data(), 5)); + ASSERT_FALSE(range.ReadFully(1024, dst.data(), 1)); + ASSERT_FALSE(range.ReadFully(1024, dst.data(), 1024)); // Verify that reading up to the end works. - ASSERT_TRUE(range.Read(1020, dst.data(), 4)); + ASSERT_TRUE(range.ReadFully(1020, dst.data(), 4)); } TEST(MemoryRangeTest, read_overflow) { @@ -73,7 +73,7 @@ TEST(MemoryRangeTest, read_overflow) { std::shared_ptr<Memory> process_memory(new MemoryFakeAlwaysReadZero); std::unique_ptr<MemoryRange> overflow(new MemoryRange(process_memory, 100, 200, 0)); - ASSERT_FALSE(overflow->Read(UINT64_MAX - 10, buffer.data(), 100)); + ASSERT_FALSE(overflow->ReadFully(UINT64_MAX - 10, buffer.data(), 100)); } TEST(MemoryRangeTest, ReadPartially) { |