Lines Matching refs:reporter

14 static void check_contents(skiatest::Reporter* reporter, const SkWriter32& writer,  in check_contents()  argument
17 REPORTER_ASSERT(reporter, writer.bytesWritten() == size); in check_contents()
19 REPORTER_ASSERT(reporter, !memcmp(storage.get(), expected, size)); in check_contents()
23 static void test_reserve(skiatest::Reporter* reporter) { in test_reserve() argument
31 static void test_string_null(skiatest::Reporter* reporter) { in test_string_null() argument
38 check_contents(reporter, writer, expected, sizeof(expected)); in test_string_null()
41 static void test_rewind(skiatest::Reporter* reporter) { in test_rewind() argument
45 REPORTER_ASSERT(reporter, 0 == writer.bytesWritten()); in test_rewind()
49 check_contents(reporter, writer, array, sizeof(array)); in test_rewind()
52 REPORTER_ASSERT(reporter, sizeof(array) - 4 == writer.bytesWritten()); in test_rewind()
54 REPORTER_ASSERT(reporter, sizeof(array) == writer.bytesWritten()); in test_rewind()
56 check_contents(reporter, writer, array, sizeof(array)); in test_rewind()
65 REPORTER_ASSERT(reporter, 100*4 == writer.bytesWritten()); in test_rewind()
69 REPORTER_ASSERT(reporter, writer.bytesWritten() < 16); in test_rewind()
73 static void test_ptr(skiatest::Reporter* reporter) { in test_ptr() argument
76 void* p0 = reporter; in test_ptr()
88 REPORTER_ASSERT(reporter, 2 * sizeof(void*) + 2 * sizeof(int32_t)); in test_ptr()
95 REPORTER_ASSERT(reporter, reader.readPtr() == p0); in test_ptr()
96 REPORTER_ASSERT(reporter, reader.readInt() == 0x33); in test_ptr()
97 REPORTER_ASSERT(reporter, reader.readPtr() == p1); in test_ptr()
98 REPORTER_ASSERT(reporter, reader.readInt() == 0x66); in test_ptr()
101 static void test1(skiatest::Reporter* reporter, SkWriter32* writer) { in test1() argument
104 REPORTER_ASSERT(reporter, i*4 == writer->bytesWritten()); in test1()
106 REPORTER_ASSERT(reporter, data[i] == writer->readTAt<uint32_t>(i * 4)); in test1()
110 REPORTER_ASSERT(reporter, sizeof(buffer) == writer->bytesWritten()); in test1()
112 REPORTER_ASSERT(reporter, !memcmp(data, buffer, sizeof(buffer))); in test1()
115 static void test2(skiatest::Reporter* reporter, SkWriter32* writer) { in test2() argument
124 REPORTER_ASSERT(reporter, writer->bytesWritten() == len); in test2()
132 REPORTER_ASSERT(reporter, !reader.eof()); in test2()
134 REPORTER_ASSERT(reporter, i == len); in test2()
135 REPORTER_ASSERT(reporter, strlen(str) == len); in test2()
136 REPORTER_ASSERT(reporter, !memcmp(str, gStr, len)); in test2()
140 REPORTER_ASSERT(reporter, 0 == str[j]); in test2()
143 REPORTER_ASSERT(reporter, reader.eof()); in test2()
146 static void testWritePad(skiatest::Reporter* reporter, SkWriter32* writer) { in testWritePad() argument
175 REPORTER_ASSERT(reporter, memcmp(readPtr, originalData.get(), len) == 0); in testWritePad()
180 REPORTER_ASSERT(reporter, *readPtr++ == 0); in testWritePad()
185 static void testOverwriteT(skiatest::Reporter* reporter, SkWriter32* writer) { in testOverwriteT() argument
207 REPORTER_ASSERT(reporter, writer->readTAt<uint32_t>(padding) == uint1); in testOverwriteT()
208 REPORTER_ASSERT(reporter, writer->readTAt<SkRect>(padding + sizeof(uint32_t)) == rect1); in testOverwriteT()
209 REPORTER_ASSERT(reporter, writer->readTAt<SkScalar>( in testOverwriteT()
216 REPORTER_ASSERT(reporter, writer->readTAt<uint32_t>(padding) == uint2); in testOverwriteT()
217 REPORTER_ASSERT(reporter, writer->readTAt<SkRect>(padding + sizeof(uint32_t)) == rect2); in testOverwriteT()
218 REPORTER_ASSERT(reporter, writer->readTAt<SkScalar>( in testOverwriteT()
222 DEF_TEST(Writer32_dynamic, reporter) { in DEF_TEST() argument
224 test1(reporter, &writer); in DEF_TEST()
227 test2(reporter, &writer); in DEF_TEST()
230 testWritePad(reporter, &writer); in DEF_TEST()
233 testOverwriteT(reporter, &writer); in DEF_TEST()
236 DEF_TEST(Writer32_small, reporter) { in DEF_TEST() argument
238 test1(reporter, &writer); in DEF_TEST()
240 test2(reporter, &writer); in DEF_TEST()
243 testWritePad(reporter, &writer); in DEF_TEST()
246 testOverwriteT(reporter, &writer); in DEF_TEST()
249 DEF_TEST(Writer32_large, reporter) { in DEF_TEST() argument
251 test1(reporter, &writer); in DEF_TEST()
253 test2(reporter, &writer); in DEF_TEST()
256 testWritePad(reporter, &writer); in DEF_TEST()
259 testOverwriteT(reporter, &writer); in DEF_TEST()
262 DEF_TEST(Writer32_misc, reporter) { in DEF_TEST() argument
263 test_reserve(reporter); in DEF_TEST()
264 test_string_null(reporter); in DEF_TEST()
265 test_ptr(reporter); in DEF_TEST()
266 test_rewind(reporter); in DEF_TEST()
269 DEF_TEST(Writer32_data, reporter) { in DEF_TEST() argument
285 REPORTER_ASSERT(reporter, sizeWritten == writer.bytesWritten()); in DEF_TEST()
289 REPORTER_ASSERT(reporter, sizeWritten == writer.bytesWritten()); in DEF_TEST()
293 REPORTER_ASSERT(reporter, sizeWritten == writer.bytesWritten()); in DEF_TEST()
302 REPORTER_ASSERT(reporter, 0 == d0->size()); in DEF_TEST()
303 REPORTER_ASSERT(reporter, strlen(str)+1 == d1->size()); in DEF_TEST()
304 REPORTER_ASSERT(reporter, !memcmp(str, d1->data(), strlen(str)+1)); in DEF_TEST()
305 REPORTER_ASSERT(reporter, 0 == d2->size()); in DEF_TEST()
307 REPORTER_ASSERT(reporter, reader.offset() == sizeWritten); in DEF_TEST()
308 REPORTER_ASSERT(reporter, reader.eof()); in DEF_TEST()