Home | History | Annotate | Download | only in tests

Lines Matching refs:Reporter

26 static void test_loop_stream(skiatest::Reporter* reporter, SkStream* stream,
33 REPORTER_ASSERT(reporter, bytes == len);
34 REPORTER_ASSERT(reporter, !memcmp(tmp, src, len));
39 REPORTER_ASSERT(reporter, 0 == bytes);
41 REPORTER_ASSERT(reporter, stream->isAtEnd());
44 static void test_filestreams(skiatest::Reporter* reporter, const char* tmpDir) {
52 ERRORF(reporter, "Failed to create tmp file %s\n", path.c_str());
63 REPORTER_ASSERT(reporter, stream.isValid());
64 test_loop_stream(reporter, &stream, s, 26, 100);
67 test_loop_stream(reporter, stream2.get(), s, 26, 100);
73 REPORTER_ASSERT(reporter, stream.isValid());
74 test_loop_stream(reporter, &stream, s, 26, 100);
77 test_loop_stream(reporter, stream2.get(), s, 26, 100);
81 static void TestWStream(skiatest::Reporter* reporter) {
86 REPORTER_ASSERT(reporter, ds.write(s, 26));
88 REPORTER_ASSERT(reporter, ds.bytesWritten() == 100 * 26);
93 REPORTER_ASSERT(reporter, dst[100*26] == '*');
95 REPORTER_ASSERT(reporter, memcmp(&dst[i * 26], s, 26) == 0);
100 REPORTER_ASSERT(reporter, 100 * 26 == stream->getLength());
101 REPORTER_ASSERT(reporter, ds.bytesWritten() == 0);
102 test_loop_stream(reporter, stream.get(), s, 26, 100);
105 test_loop_stream(reporter, stream2.get(), s, 26, 100);
108 REPORTER_ASSERT(reporter, stream3->isAtEnd());
111 REPORTER_ASSERT(reporter, 0 == bytes);
113 test_loop_stream(reporter, stream3.get(), s, 26, 100);
117 REPORTER_ASSERT(reporter, ds.write(s, 26));
119 REPORTER_ASSERT(reporter, ds.bytesWritten() == 100 * 26);
124 REPORTER_ASSERT(reporter, ds.bytesWritten() == 0);
125 test_loop_stream(reporter, stream.get(), s, 26, 100);
128 test_loop_stream(reporter, stream2.get(), s, 26, 100);
134 test_filestreams(reporter, tmpDir.c_str());
138 static void TestPackedUInt(skiatest::Reporter* reporter) {
154 REPORTER_ASSERT(reporter, success);
161 ERRORF(reporter, "sizes:%x != n:%x\n", i, sizes[i], n);
183 DEF_TEST(Stream, reporter) {
184 TestWStream(reporter);
185 TestPackedUInt(reporter);
195 static size_t compare_peek_to_read(skiatest::Reporter* reporter,
198 REPORTER_ASSERT(reporter, bytesToPeek > 0);
209 REPORTER_ASSERT(reporter, bytesRead == bytesToPeek || stream->isAtEnd());
213 REPORTER_ASSERT(reporter, !memcmp(peekPtr, readPtr, bytesPeeked));
216 REPORTER_ASSERT(reporter, bytesRead >= bytesPeeked);
221 static void test_fully_peekable_stream(skiatest::Reporter* r, SkStream* stream, size_t limit) {
227 static void test_peeking_front_buffered_stream(skiatest::Reporter* r,
283 DEF_TEST(StreamPeek, reporter) {
287 test_fully_peekable_stream(reporter, &memStream, memStream.getLength());
291 REPORTER_ASSERT(reporter, fileStream.isValid());
297 REPORTER_ASSERT(reporter, fileStream.peek(storage.get(), i) == 0);
302 test_peeking_front_buffered_stream(reporter, memStream, i);
308 static void stream_peek_test(skiatest::Reporter* rep,
394 static void stream_copy_test(skiatest::Reporter* reporter,
400 ERRORF(reporter, "SkStreamCopy failed");
405 ERRORF(reporter, "SkStreamCopy incorrect size");
409 ERRORF(reporter, "SkStreamCopy bad copy");
433 DEF_TEST(StreamCopy, reporter) {
442 stream_copy_test(reporter, src, N, &dumbStream);
444 stream_copy_test(reporter, src, N, &smartStream);
455 DEF_TEST(RBuffer, reporter) {
458 REPORTER_ASSERT(reporter, buffer.isValid());
461 REPORTER_ASSERT(reporter, buffer.read(&tmp, 4));
462 REPORTER_ASSERT(reporter, buffer.isValid());
464 REPORTER_ASSERT(reporter, !buffer.read(&tmp, 4));
465 REPORTER_ASSERT(reporter, !buffer.isValid());