summaryrefslogtreecommitdiff
path: root/libunwindstack/tests/MemoryLocalTest.cpp
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2017-10-18 11:52:53 -0700
committerJosh Gao <jmgao@google.com>2017-11-15 15:38:13 -0800
commitb837763b494e59f8532e98d2b57a5f28ed15c5a7 (patch)
tree6d9d0c4b2d72ee5a0aec42b5686926202989863b /libunwindstack/tests/MemoryLocalTest.cpp
parentef35aa5d40b6404baf702a58527f1cd3a9f42f19 (diff)
unwindstack: rename Memory::ReadPartially to Read.
Test: mma Test: treehugger Change-Id: I53c2c5600fb44620b629c01db85a67789594595f
Diffstat (limited to 'libunwindstack/tests/MemoryLocalTest.cpp')
-rw-r--r--libunwindstack/tests/MemoryLocalTest.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libunwindstack/tests/MemoryLocalTest.cpp b/libunwindstack/tests/MemoryLocalTest.cpp
index c483b74dc..5a389d0a9 100644
--- a/libunwindstack/tests/MemoryLocalTest.cpp
+++ b/libunwindstack/tests/MemoryLocalTest.cpp
@@ -68,7 +68,7 @@ TEST(MemoryLocalTest, read_overflow) {
ASSERT_FALSE(local.ReadFully(reinterpret_cast<uint64_t>(&value), dst.data(), SIZE_MAX));
}
-TEST(MemoryLocalTest, ReadPartially) {
+TEST(MemoryLocalTest, Read) {
char* mapping = static_cast<char*>(
mmap(nullptr, 2 * getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0));
@@ -80,8 +80,8 @@ TEST(MemoryLocalTest, ReadPartially) {
MemoryLocal local;
std::vector<uint8_t> dst(4096);
- ASSERT_EQ(1024U, local.ReadPartially(reinterpret_cast<uint64_t>(mapping + getpagesize() - 1024),
- dst.data(), 4096));
+ ASSERT_EQ(1024U, local.Read(reinterpret_cast<uint64_t>(mapping + getpagesize() - 1024),
+ dst.data(), 4096));
for (size_t i = 0; i < 1024; i++) {
ASSERT_EQ(0x4cU, dst[i]) << "Failed at byte " << i;
}
@@ -98,7 +98,7 @@ TEST(MemoryLocalTest, read_hole) {
MemoryLocal local;
std::vector<uint8_t> dst(4096 * 3, 0xCC);
- ASSERT_EQ(4096U, local.ReadPartially(reinterpret_cast<uintptr_t>(mapping), dst.data(), 4096 * 3));
+ ASSERT_EQ(4096U, local.Read(reinterpret_cast<uintptr_t>(mapping), dst.data(), 4096 * 3));
for (size_t i = 0; i < 4096; ++i) {
ASSERT_EQ(0xFF, dst[i]);
}