Lines Matching refs:bufferedStream

16 static void test_read(skiatest::Reporter* reporter, SkStream* bufferedStream,  in test_read()  argument
21 const size_t bytesRead = bufferedStream->read(storage.get(), bytesToRead); in test_read()
22 REPORTER_ASSERT(reporter, bytesRead == bytesToRead || bufferedStream->isAtEnd()); in test_read()
27 SkStream* bufferedStream, bool shouldSucceed) { in test_rewind() argument
28 const bool success = bufferedStream->rewind(); in test_rewind()
37 const SkStream& bufferedStream, in test_hasLength() argument
40 REPORTER_ASSERT(reporter, bufferedStream.hasLength()); in test_hasLength()
42 REPORTER_ASSERT(reporter, !bufferedStream.hasLength()); in test_hasLength()
59 std::unique_ptr<SkStream> bufferedStream(SkFrontBufferedStream::Create(memStream, bufferSize)); in test_incremental_buffering() local
60 test_hasLength(reporter, *bufferedStream, *memStream); in test_incremental_buffering()
63 test_read(reporter, bufferedStream.get(), gAbcs, bufferSize / 2); in test_incremental_buffering()
67 test_rewind(reporter, bufferedStream.get(), true); in test_incremental_buffering()
68 test_read(reporter, bufferedStream.get(), gAbcs, bufferSize / 4); in test_incremental_buffering()
71 test_read(reporter, bufferedStream.get(), gAbcs + bufferSize / 4, bufferSize / 2); in test_incremental_buffering()
75 test_rewind(reporter, bufferedStream.get(), true); in test_incremental_buffering()
76 test_read(reporter, bufferedStream.get(), gAbcs, bufferSize << 1); in test_incremental_buffering()
81 test_rewind(reporter, bufferedStream.get(), false); in test_incremental_buffering()
86 std::unique_ptr<SkStream> bufferedStream(SkFrontBufferedStream::Create(memStream, bufferSize)); in test_perfectly_sized_buffer() local
87 test_hasLength(reporter, *bufferedStream, *memStream); in test_perfectly_sized_buffer()
90 test_read(reporter, bufferedStream.get(), gAbcs, bufferSize); in test_perfectly_sized_buffer()
93 test_rewind(reporter, bufferedStream.get(), true); in test_perfectly_sized_buffer()
96 test_read(reporter, bufferedStream.get(), gAbcs, bufferSize); in test_perfectly_sized_buffer()
99 test_read(reporter, bufferedStream.get(), gAbcs + memStream->getPosition(), 1); in test_perfectly_sized_buffer()
100 test_rewind(reporter, bufferedStream.get(), false); in test_perfectly_sized_buffer()
105 std::unique_ptr<SkStream> bufferedStream(SkFrontBufferedStream::Create(memStream, bufferSize)); in test_skipping() local
106 test_hasLength(reporter, *bufferedStream, *memStream); in test_skipping()
109 bufferedStream->skip(bufferSize / 2); in test_skipping()
112 test_rewind(reporter, bufferedStream.get(), true); in test_skipping()
113 test_read(reporter, bufferedStream.get(), gAbcs, bufferSize / 4); in test_skipping()
116 bufferedStream->skip(bufferSize / 2); in test_skipping()
119 test_read(reporter, bufferedStream.get(), gAbcs + memStream->getPosition(), bufferSize / 4); in test_skipping()
121 test_rewind(reporter, bufferedStream.get(), true); in test_skipping()
122 test_read(reporter, bufferedStream.get(), gAbcs, bufferSize); in test_skipping()
159 std::unique_ptr<SkStream> bufferedStream(SkFrontBufferedStream::Create(memStream, bufferSize)); in test_read_beyond_buffer() local
160 test_hasLength(reporter, *bufferedStream.get(), *memStream); in test_read_beyond_buffer()
163 test_read(reporter, bufferedStream.get(), gAbcs, bufferSize + 1); in test_read_beyond_buffer()
164 test_rewind(reporter, bufferedStream.get(), true); in test_read_beyond_buffer()
167 test_read(reporter, bufferedStream.get(), gAbcs, bufferSize); in test_read_beyond_buffer()
220 std::unique_ptr<SkStream> bufferedStream(SkFrontBufferedStream::Create(memStream, bufferSize)); in test_initial_offset() local
223 REPORTER_ASSERT(reporter, bufferedStream->hasLength()); in test_initial_offset()
226 const size_t bufferedLength = bufferedStream->getLength(); in test_initial_offset()
233 REPORTER_ASSERT(reporter, !bufferedStream->isAtEnd()); in test_initial_offset()
234 test_read(reporter, bufferedStream.get(), gAbcs + arbitraryOffset + currentPosition, in test_initial_offset()
239 REPORTER_ASSERT(reporter, bufferedStream->isAtEnd()); in test_initial_offset()