Fix BUG=skia:5662
authorHal Canary <halcanary@google.com>
Thu, 10 Nov 2016 18:03:21 +0000 (13:03 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Thu, 10 Nov 2016 18:39:31 +0000 (18:39 +0000)
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4661

Change-Id: I5f5b10387be5d538347a3626c165cc17af154212
Reviewed-on: https://skia-review.googlesource.com/4661
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>

tests/PDFDocumentTest.cpp

index fb32819..fca8496 100644 (file)
@@ -61,9 +61,9 @@ static void test_abortWithFile(skiatest::Reporter* reporter) {
     }
 
     FILE* file = fopen(path.c_str(), "r");
-    // The created file should be empty.
-    char buffer[100];
-    REPORTER_ASSERT(reporter, fread(buffer, 1, 1, file) == 0);
+    // Test that only the header is written, not the full document.
+    char buffer[256];
+    REPORTER_ASSERT(reporter, fread(buffer, 1, sizeof(buffer), file) < sizeof(buffer));
     fclose(file);
 }