| 759 | } |
| 760 | |
| 761 | void MakeExample(int64_t buffer_size, |
| 762 | std::optional<int64_t> read_bound = std::nullopt) { |
| 763 | test_data_ = kExample1; |
| 764 | MemoryPool* pool = default_memory_pool(); |
| 765 | |
| 766 | ASSERT_OK_AND_ASSIGN(auto file_out, FileOutputStream::Open(path_)); |
| 767 | ASSERT_OK(file_out->Write(test_data_)); |
| 768 | ASSERT_OK(file_out->Close()); |
| 769 | |
| 770 | ASSERT_OK_AND_ASSIGN(auto file_in, ReadableFile::Open(path_)); |
| 771 | raw_ = file_in; |
| 772 | tracked_ = TrackedRandomAccessFile::Make(dynamic_cast<RandomAccessFile*>(raw_.get())); |
| 773 | ASSERT_OK_AND_ASSIGN(buffered_, |
| 774 | BufferedInputStream::Create(buffer_size, pool, tracked_, |
| 775 | read_bound.value_or(-1))); |
| 776 | } |
| 777 | |
| 778 | protected: |
| 779 | std::shared_ptr<TrackedRandomAccessFile> tracked_; |
nothing calls this directly
no test coverage detected