Home | History | Annotate | Download | only in tests

Lines Matching refs:Reporter

12 static void assert_eof(skiatest::Reporter* reporter, const SkReader32& reader) {
13 REPORTER_ASSERT(reporter, reader.eof());
14 REPORTER_ASSERT(reporter, reader.size() == reader.offset());
15 REPORTER_ASSERT(reporter, (const char*)reader.peek() ==
19 static void assert_start(skiatest::Reporter* reporter, const SkReader32& reader) {
20 REPORTER_ASSERT(reporter, 0 == reader.offset());
21 REPORTER_ASSERT(reporter, reader.size() == reader.available());
22 REPORTER_ASSERT(reporter, reader.isAvailable(reader.size()));
23 REPORTER_ASSERT(reporter, !reader.isAvailable(reader.size() + 1));
24 REPORTER_ASSERT(reporter, reader.peek() == reader.base());
27 static void assert_empty(skiatest::Reporter* reporter, const SkReader32& reader) {
28 REPORTER_ASSERT(reporter, 0 == reader.size());
29 REPORTER_ASSERT(reporter, 0 == reader.offset());
30 REPORTER_ASSERT(reporter, 0 == reader.available());
31 REPORTER_ASSERT(reporter, !reader.isAvailable(1));
32 assert_eof(reporter, reader);
33 assert_start(reporter, reader);
36 DEF_TEST(Reader32, reporter) {
38 assert_empty(reporter, reader);
39 REPORTER_ASSERT(reporter, NULL == reader.base());
40 REPORTER_ASSERT(reporter, NULL == reader.peek());
52 REPORTER_ASSERT(reporter, sizeof(data) == reader.size());
53 REPORTER_ASSERT(reporter, i*4 == reader.offset());
54 REPORTER_ASSERT(reporter, (const void*)data == reader.base());
55 REPORTER_ASSERT(reporter, (const void*)&data[i] == reader.peek());
56 REPORTER_ASSERT(reporter, data[i] == reader.readInt());
58 assert_eof(reporter, reader);
60 assert_start(reporter, reader);
62 REPORTER_ASSERT(reporter, !memcmp(data, buffer, sizeof(data)));
66 REPORTER_ASSERT(reporter, sizeof(data2) == reader.size());
67 REPORTER_ASSERT(reporter, i*4 == reader.offset());
68 REPORTER_ASSERT(reporter, (const void*)data2 == reader.base());
69 REPORTER_ASSERT(reporter, (const void*)&data2[i] == reader.peek());
70 REPORTER_ASSERT(reporter, data2[i] == reader.readScalar());
72 assert_eof(reporter, reader);
74 assert_start(reporter, reader);
76 REPORTER_ASSERT(reporter, !memcmp(data2, buffer, sizeof(data2)));
79 assert_empty(reporter, reader);
80 REPORTER_ASSERT(reporter, NULL == reader.base());
81 REPORTER_ASSERT(reporter, NULL == reader.peek());