Lines Matching refs:Reporter
55 static void assert_eql(skiatest::Reporter* reporter,
60 REPORT_FAILURE(reporter, "", SkStringPrintf(
65 static void assert_eq(skiatest::Reporter* reporter,
68 assert_eql(reporter, skString, str, strlen(str));
73 static void assert_emit_eq(skiatest::Reporter* reporter,
77 assert_eq(reporter, result, string);
80 static void TestPDFStream(skiatest::Reporter* reporter) {
85 assert_emit_eq(reporter,
89 assert_emit_eq(reporter,
115 assert_eql(reporter,
123 static void TestObjectNumberMap(skiatest::Reporter* reporter) {
135 REPORTER_ASSERT(reporter, objNumMap.getObjectNumber(a1.get()) == 1);
136 REPORTER_ASSERT(reporter, objNumMap.getObjectNumber(a2.get()) == 2);
137 REPORTER_ASSERT(reporter, objNumMap.getObjectNumber(a3.get()) == 3);
140 REPORTER_ASSERT(reporter, objNumMap.getObjectNumber(a1.get()) == 1);
143 static void TestObjectRef(skiatest::Reporter* reporter) {
150 REPORTER_ASSERT(reporter, catalog.getObjectNumber(a1.get()) == 1);
155 assert_eq(reporter, result, "[1 0 R]");
175 static void assert_emit_eq_number(skiatest::Reporter* reporter, float number) {
180 ERRORF(reporter, "%.9g != %s", number, result.c_str());
185 static void TestPDFUnion(skiatest::Reporter* reporter) {
187 assert_emit_eq(reporter, boolTrue, "true");
190 assert_emit_eq(reporter, boolFalse, "false");
193 assert_emit_eq(reporter, int42, "42");
195 assert_emit_eq_number(reporter, SK_ScalarHalf);
196 assert_emit_eq_number(reporter, 110999.75f); // bigScalar
197 assert_emit_eq_number(reporter, 50000000.1f); // biggerScalar
198 assert_emit_eq_number(reporter, 1.0f / 65536); // smallScalar
201 assert_emit_eq(reporter, stringSimple, "(test \\) string \\( foo)");
205 assert_emit_eq(reporter, stringComplex, "(\\011test \\) string \\( foo)");
209 assert_emit_eq(reporter, binaryString, "<0102030405060708090A0B0C0D0E0F10>");
213 assert_emit_eq(reporter, name, "/Test#20name#09with#23tab");
217 assert_emit_eq(reporter, name2, "/A#23#2F#25#28#29#3C#3E#5B#5D#7B#7DB");
220 assert_emit_eq(reporter, name3, "/SimpleNameWithOnlyPrintableASCII");
225 assert_emit_eq(reporter, highBitName, "/#DE#ADbe#EF");
228 static void TestPDFArray(skiatest::Reporter* reporter) {
230 assert_emit_eq(reporter, *array, "[]");
233 assert_emit_eq(reporter, *array, "[42]");
236 assert_emit_eq(reporter, *array, "[42 .5]");
239 assert_emit_eq(reporter, *array, "[42 .5 0]");
242 assert_emit_eq(reporter, *array, "[42 .5 0 true]");
245 assert_emit_eq(reporter, *array, "[42 .5 0 true /ThisName]");
248 assert_emit_eq(reporter, *array, "[42 .5 0 true /ThisName /AnotherName]");
251 assert_emit_eq(reporter, *array,
255 assert_emit_eq(reporter, *array,
262 assert_emit_eq(reporter, *array,
269 REPORTER_ASSERT(reporter, catalog.getObjectNumber(
274 assert_eq(reporter, result,
279 static void TestPDFDict(skiatest::Reporter* reporter) {
281 assert_emit_eq(reporter, *dict, "<<>>");
284 assert_emit_eq(reporter, *dict, "<</n1 42>>");
287 assert_emit_eq(reporter, *dict, "<<>>");
290 assert_emit_eq(reporter, *dict, "<</n1 42>>");
298 assert_emit_eq(reporter, *dict, "<</n1 42\n/n2 .5\n/n3 [-100]>>");
301 assert_emit_eq(reporter, *dict, "<<>>");
304 assert_emit_eq(reporter, *dict, "<</n1 24>>");
307 assert_emit_eq(reporter, *dict, "<</n1 24\n/n2 99>>");
310 assert_emit_eq(reporter, *dict, "<</n1 24\n/n2 99\n/n3 .5>>");
313 assert_emit_eq(reporter, *dict, "<</n1 24\n/n2 99\n/n3 .5\n/n4 /AName>>");
316 assert_emit_eq(reporter, *dict, "<</n1 24\n/n2 99\n/n3 .5\n/n4 /AName\n"
320 assert_emit_eq(reporter, *dict, "<</n1 24\n/n2 99\n/n3 .5\n/n4 /AName\n"
324 assert_emit_eq(reporter, *dict, "<</n1 24\n/n2 99\n/n3 .5\n/n4 /AName\n"
328 assert_emit_eq(reporter, *dict, "<</Type /DType>>");
333 REPORTER_ASSERT(reporter, catalog.getObjectNumber(
337 assert_eq(reporter, result, "<</Type /DType\n/n1 1 0 R>>");
340 DEF_TEST(SkPDF_Primitives, reporter) {
341 TestPDFUnion(reporter);
342 TestPDFArray(reporter);
343 TestPDFDict(reporter);
344 TestPDFStream(reporter);
345 TestObjectNumberMap(reporter);
346 TestObjectRef(reporter);
395 DEF_TEST(SkPDF_ImageFilter, reporter) {
396 REQUIRE_PDF_DOCUMENT(SkPDF_ImageFilter, reporter);
404 REPORTER_ASSERT(reporter, !filter->visited());
411 REPORTER_ASSERT(reporter, filter->visited());
416 DEF_TEST(SkPDF_FontCanEmbedTypeface, reporter) {
422 REPORTER_ASSERT(reporter,
427 REPORTER_ASSERT(reporter,
434 skiatest::Reporter* reporter, float inputFloat) {
438 ERRORF(reporter, "string too long: %u", (unsigned)len);
442 ERRORF(reporter, "terminator misplaced.");
445 if (reporter->verbose()) {
450 ERRORF(reporter, "unscannable result: %s", floatString);
454 ERRORF(reporter, "roundTripFloat (%.9g) != inputFloat (%.9g)",
460 DEF_TEST(SkPDF_Primitives_Scalar, reporter) {
467 check_pdf_scalar_serialization(reporter, f);
476 check_pdf_scalar_serialization(reporter, inputFloat);
481 DEF_TEST(SkPDF_Primitives_Color, reporter) {
485 REPORTER_ASSERT(reporter, len == strlen(buffer));
487 REPORTER_ASSERT(reporter, 1 == sscanf(buffer, "%f", &f));
489 REPORTER_ASSERT(reporter, roundTrip == i);