Lines Matching refs:MB
115 ErrorOr<OwningBuffer> MB = MemoryBuffer::getOpenFile(*File, TestPath, 6); in TEST_F() local
116 ASSERT_NO_ERROR(MB.getError()); in TEST_F()
117 EXPECT_EQ("123456", MB.get()->getBuffer()); in TEST_F()
143 ErrorOr<OwningBuffer> MB = MemoryBuffer::getFile(TestPath.c_str()); in TEST_F() local
144 std::error_code EC = MB.getError(); in TEST_F()
147 const char *BufData = MB.get()->getBufferStart(); in TEST_F()
189 ErrorOr<OwningBuffer> MB = in TEST_F() local
192 ASSERT_NO_ERROR(MB.getError()); in TEST_F()
193 EXPECT_EQ(MB.get()->getBuffer(), "foofoofoofoofoo"); in TEST_F()
287 ErrorOr<OwningBuffer> MB = MemoryBuffer::getFileSlice(TestPath.str(), in TEST_F() local
289 std::error_code EC = MB.getError(); in TEST_F()
291 EXPECT_EQ(0x4000UL, MB.get()->getBufferSize()); in TEST_F()
293 StringRef BufData = MB.get()->getBuffer(); in TEST_F()
333 WritableMemoryBuffer &MB = **MBOrError; in TEST_F() local
334 ASSERT_EQ(0x6000u, MB.getBufferSize()); in TEST_F()
335 char *Start = MB.getBufferStart(); in TEST_F()
336 ASSERT_EQ(MB.getBufferEnd(), MB.getBufferStart() + MB.getBufferSize()); in TEST_F()
337 ::memset(Start, 'x', MB.getBufferSize()); in TEST_F()
342 auto &MB = **MBOrError; in TEST_F() local
343 ASSERT_EQ(0x10000u, MB.getBufferSize()); in TEST_F()
344 for (size_t i = 0; i < MB.getBufferSize(); i += 0x10) in TEST_F()
345 EXPECT_EQ("0123456789abcdef", MB.getBuffer().substr(i, 0x10)) << "i: " << i; in TEST_F()
363 WriteThroughMemoryBuffer &MB = **MBOrError; in TEST_F() local
364 ASSERT_EQ(16u, MB.getBufferSize()); in TEST_F()
365 char *Start = MB.getBufferStart(); in TEST_F()
366 ASSERT_EQ(MB.getBufferEnd(), MB.getBufferStart() + MB.getBufferSize()); in TEST_F()
367 ::memset(Start, 'x', MB.getBufferSize()); in TEST_F()
372 auto &MB = **MBOrError; in TEST_F() local
373 ASSERT_EQ(16u, MB.getBufferSize()); in TEST_F()
374 EXPECT_EQ("xxxxxxxxxxxxxxxx", MB.getBuffer()); in TEST_F()
406 OwningBuffer MB = std::move(*MBOrError); in TEST_F()
407 EXPECT_EQ(MB->getBufferKind(), MemoryBuffer::MemoryBuffer_MMap); in TEST_F()
408 EXPECT_EQ(MB->getBufferSize(), std::size_t(FileWrites * 8)); in TEST_F()
409 EXPECT_TRUE(MB->getBuffer().startswith("01234567")); in TEST_F()