MCPcopy Create free account
hub / github.com/apache/arrow / CreateExample

Method CreateExample

cpp/src/arrow/io/buffered_test.cc:554–567  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

552 void SetUp() { CreateExample(/*bounded=*/true); }
553
554 void CreateExample(bool bounded = true) {
555 // Create a buffer larger than source size, to check that the
556 // stream end is respected
557 ASSERT_OK_AND_ASSIGN(auto buf, AllocateResizableBuffer(source_size_ + 10));
558 ASSERT_LT(source_size_, buf->size());
559 for (int i = 0; i < source_size_; i++) {
560 buf->mutable_data()[i] = static_cast<uint8_t>(i);
561 }
562 source_ = std::make_shared<BufferReader>(std::move(buf));
563 ASSERT_OK(source_->Advance(stream_offset_));
564 ASSERT_OK_AND_ASSIGN(
565 stream_, BufferedInputStream::Create(chunk_size_, default_memory_pool(), source_,
566 bounded ? stream_size_ : -1));
567 }
568
569 protected:
570 int64_t source_size_ = 256;

Callers

nothing calls this directly

Calls 5

default_memory_poolFunction · 0.85
ASSERT_OK_AND_ASSIGNFunction · 0.50
sizeMethod · 0.45
mutable_dataMethod · 0.45
AdvanceMethod · 0.45

Tested by

no test coverage detected