• Home
  • Raw
  • Download

Lines Matching refs:memory_

32     memory_.reset(new MemoryBuffer);  in SetUp()
34 std::unique_ptr<MemoryBuffer> memory_; member in unwindstack::MemoryBufferTest
38 ASSERT_EQ(0U, memory_->Size()); in TEST_F()
40 ASSERT_FALSE(memory_->ReadFully(0, buffer.data(), 1)); in TEST_F()
41 ASSERT_EQ(nullptr, memory_->GetPtr(0)); in TEST_F()
42 ASSERT_EQ(nullptr, memory_->GetPtr(1)); in TEST_F()
46 ASSERT_TRUE(memory_->Resize(256)); in TEST_F()
47 ASSERT_EQ(256U, memory_->Size()); in TEST_F()
48 ASSERT_TRUE(memory_->GetPtr(0) != nullptr); in TEST_F()
49 ASSERT_TRUE(memory_->GetPtr(1) != nullptr); in TEST_F()
50 ASSERT_TRUE(memory_->GetPtr(255) != nullptr); in TEST_F()
51 ASSERT_TRUE(memory_->GetPtr(256) == nullptr); in TEST_F()
53 uint8_t* data = memory_->GetPtr(0); in TEST_F()
54 for (size_t i = 0; i < memory_->Size(); i++) { in TEST_F()
58 std::vector<uint8_t> buffer(memory_->Size()); in TEST_F()
59 ASSERT_TRUE(memory_->ReadFully(0, buffer.data(), buffer.size())); in TEST_F()
66 ASSERT_TRUE(memory_->Resize(100)); in TEST_F()
68 ASSERT_FALSE(memory_->ReadFully(0, buffer.data(), 101)); in TEST_F()
69 ASSERT_FALSE(memory_->ReadFully(100, buffer.data(), 1)); in TEST_F()
70 ASSERT_FALSE(memory_->ReadFully(101, buffer.data(), 2)); in TEST_F()
71 ASSERT_FALSE(memory_->ReadFully(99, buffer.data(), 2)); in TEST_F()
72 ASSERT_TRUE(memory_->ReadFully(99, buffer.data(), 1)); in TEST_F()
76 ASSERT_TRUE(memory_->Resize(100)); in TEST_F()
79 ASSERT_FALSE(memory_->ReadFully(UINT64_MAX - 100, buffer.data(), 200)); in TEST_F()
83 ASSERT_TRUE(memory_->Resize(256)); in TEST_F()
84 ASSERT_EQ(256U, memory_->Size()); in TEST_F()
85 ASSERT_TRUE(memory_->GetPtr(0) != nullptr); in TEST_F()
86 ASSERT_TRUE(memory_->GetPtr(1) != nullptr); in TEST_F()
87 ASSERT_TRUE(memory_->GetPtr(255) != nullptr); in TEST_F()
88 ASSERT_TRUE(memory_->GetPtr(256) == nullptr); in TEST_F()
90 uint8_t* data = memory_->GetPtr(0); in TEST_F()
91 for (size_t i = 0; i < memory_->Size(); i++) { in TEST_F()
95 std::vector<uint8_t> buffer(memory_->Size()); in TEST_F()
96 ASSERT_EQ(128U, memory_->Read(128, buffer.data(), buffer.size())); in TEST_F()
103 ASSERT_TRUE(memory_->Resize(256)); in TEST_F()
105 ASSERT_TRUE(memory_->Resize(1024)); in TEST_F()
107 ASSERT_FALSE(memory_->Resize(SIZE_MAX)); in TEST_F()