aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PDFPrimitivesTest.cpp
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2016-09-09 11:41:59 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-09 11:41:59 -0700
commit57f744e3030fec4d1a2b3e9119011904b149a4da (patch)
tree62e2dbe5a2550e0fccfcf085663ada6a8a3d8756 /tests/PDFPrimitivesTest.cpp
parent8d914908d8ad37a73c39ba8f7ef298bfee457388 (diff)
SkPDF/Tests: imporve test coverage.
Also: make sure that all SkPDF unit tests are named SkPDF_* to make testing changes to SkPDF easier. Other cleanup. Add test: SkPDF_pdfa_document to verify that flag in public API works. SkPDF_JpegIdentification test: test slightly malformed JPEGs to verify that all code paths work. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2322133003 Review-Url: https://codereview.chromium.org/2322133003
Diffstat (limited to 'tests/PDFPrimitivesTest.cpp')
-rw-r--r--tests/PDFPrimitivesTest.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/PDFPrimitivesTest.cpp b/tests/PDFPrimitivesTest.cpp
index 1001b99c47..c719f488d2 100644
--- a/tests/PDFPrimitivesTest.cpp
+++ b/tests/PDFPrimitivesTest.cpp
@@ -334,7 +334,7 @@ static void TestPDFDict(skiatest::Reporter* reporter) {
assert_eq(reporter, result, "<</Type /DType\n/n1 1 0 R>>");
}
-DEF_TEST(PDFPrimitives, reporter) {
+DEF_TEST(SkPDF_Primitives, reporter) {
TestPDFUnion(reporter);
TestPDFArray(reporter);
TestPDFDict(reporter);
@@ -389,7 +389,8 @@ void DummyImageFilter::toString(SkString* str) const {
// Check that PDF rendering of image filters successfully falls back to
// CPU rasterization.
-DEF_TEST(PDFImageFilter, reporter) {
+DEF_TEST(SkPDF_ImageFilter, reporter) {
+ REQUIRE_PDF_DOCUMENT(SkPDF_ImageFilter, reporter);
SkDynamicMemoryWStream stream;
sk_sp<SkDocument> doc(SkDocument::MakePDF(&stream));
SkCanvas* canvas = doc->beginPage(100.0f, 100.0f);
@@ -409,7 +410,7 @@ DEF_TEST(PDFImageFilter, reporter) {
// Check that PDF rendering of image filters successfully falls back to
// CPU rasterization.
-DEF_TEST(PDFFontCanEmbedTypeface, reporter) {
+DEF_TEST(SkPDF_FontCanEmbedTypeface, reporter) {
SkPDFCanon canon;
const char resource[] = "fonts/Roboto2-Regular_NoEmbed.ttf";
@@ -453,7 +454,7 @@ static void check_pdf_scalar_serialization(
}
// Test SkPDFUtils::AppendScalar for accuracy.
-DEF_TEST(PDFPrimitives_Scalar, reporter) {
+DEF_TEST(SkPDF_Primitives_Scalar, reporter) {
SkRandom random(0x5EED);
int iterationCount = 512;
while (iterationCount-- > 0) {
@@ -474,7 +475,7 @@ DEF_TEST(PDFPrimitives_Scalar, reporter) {
}
// Test SkPDFUtils:: for accuracy.
-DEF_TEST(PDFPrimitives_Color, reporter) {
+DEF_TEST(SkPDF_Primitives_Color, reporter) {
char buffer[5];
for (int i = 0; i < 256; ++i) {
size_t len = SkPDFUtils::ColorToDecimal(i, buffer);