• Home
  • Raw
  • Download

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 auto bufferedStream = SkFrontBufferedStream::Make(std::unique_ptr<SkStream>(memStream), in test_incremental_buffering() local
61 test_hasLength(reporter, *bufferedStream, *memStream); in test_incremental_buffering()
64 test_read(reporter, bufferedStream.get(), gAbcs, bufferSize / 2); in test_incremental_buffering()
68 test_rewind(reporter, bufferedStream.get(), true); in test_incremental_buffering()
69 test_read(reporter, bufferedStream.get(), gAbcs, bufferSize / 4); in test_incremental_buffering()
72 test_read(reporter, bufferedStream.get(), gAbcs + bufferSize / 4, bufferSize / 2); in test_incremental_buffering()
76 test_rewind(reporter, bufferedStream.get(), true); in test_incremental_buffering()
77 test_read(reporter, bufferedStream.get(), gAbcs, bufferSize << 1); in test_incremental_buffering()
82 test_rewind(reporter, bufferedStream.get(), false); in test_incremental_buffering()
87 auto bufferedStream = SkFrontBufferedStream::Make(std::unique_ptr<SkStream>(memStream), in test_perfectly_sized_buffer() local
89 test_hasLength(reporter, *bufferedStream, *memStream); in test_perfectly_sized_buffer()
92 test_read(reporter, bufferedStream.get(), gAbcs, bufferSize); in test_perfectly_sized_buffer()
95 test_rewind(reporter, bufferedStream.get(), true); in test_perfectly_sized_buffer()
98 test_read(reporter, bufferedStream.get(), gAbcs, bufferSize); in test_perfectly_sized_buffer()
101 test_read(reporter, bufferedStream.get(), gAbcs + memStream->getPosition(), 1); in test_perfectly_sized_buffer()
102 test_rewind(reporter, bufferedStream.get(), false); in test_perfectly_sized_buffer()
107 auto bufferedStream = SkFrontBufferedStream::Make(std::unique_ptr<SkStream>(memStream), in test_skipping() local
109 test_hasLength(reporter, *bufferedStream, *memStream); in test_skipping()
112 bufferedStream->skip(bufferSize / 2); in test_skipping()
115 test_rewind(reporter, bufferedStream.get(), true); in test_skipping()
116 test_read(reporter, bufferedStream.get(), gAbcs, bufferSize / 4); in test_skipping()
119 bufferedStream->skip(bufferSize / 2); in test_skipping()
122 test_read(reporter, bufferedStream.get(), gAbcs + memStream->getPosition(), bufferSize / 4); in test_skipping()
124 test_rewind(reporter, bufferedStream.get(), true); in test_skipping()
125 test_read(reporter, bufferedStream.get(), gAbcs, bufferSize); in test_skipping()
162 auto bufferedStream = SkFrontBufferedStream::Make(std::unique_ptr<SkStream>(memStream), in test_read_beyond_buffer() local
164 test_hasLength(reporter, *bufferedStream.get(), *memStream); in test_read_beyond_buffer()
167 test_read(reporter, bufferedStream.get(), gAbcs, bufferSize + 1); in test_read_beyond_buffer()
168 test_rewind(reporter, bufferedStream.get(), true); in test_read_beyond_buffer()
171 test_read(reporter, bufferedStream.get(), gAbcs, bufferSize); in test_read_beyond_buffer()
225 auto bufferedStream = SkFrontBufferedStream::Make(std::unique_ptr<SkStream>(memStream), in test_initial_offset() local
229 REPORTER_ASSERT(reporter, bufferedStream->hasLength()); in test_initial_offset()
232 const size_t bufferedLength = bufferedStream->getLength(); in test_initial_offset()
239 REPORTER_ASSERT(reporter, !bufferedStream->isAtEnd()); in test_initial_offset()
240 test_read(reporter, bufferedStream.get(), gAbcs + arbitraryOffset + currentPosition, in test_initial_offset()
245 REPORTER_ASSERT(reporter, bufferedStream->isAtEnd()); in test_initial_offset()