Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Side by Side Diff: tests/PDFDocumentTest.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/PDFDeflateWStreamTest.cpp ('k') | tests/PDFGlyphsToUnicodeTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include "Test.h" 7 #include "Test.h"
8 8
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkDocument.h" 10 #include "SkDocument.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 SkAutoTUnref<SkDocument> doc(SkDocument::CreatePDF(path.c_str())); 76 SkAutoTUnref<SkDocument> doc(SkDocument::CreatePDF(path.c_str()));
77 77
78 SkCanvas* canvas = doc->beginPage(100, 100); 78 SkCanvas* canvas = doc->beginPage(100, 100);
79 79
80 canvas->drawColor(SK_ColorRED); 80 canvas->drawColor(SK_ColorRED);
81 doc->endPage(); 81 doc->endPage();
82 doc->close(); 82 doc->close();
83 83
84 FILE* file = fopen(path.c_str(), "r"); 84 FILE* file = fopen(path.c_str(), "r");
85 REPORTER_ASSERT(reporter, file != NULL); 85 REPORTER_ASSERT(reporter, file != nullptr);
86 char header[100]; 86 char header[100];
87 REPORTER_ASSERT(reporter, fread(header, 4, 1, file) != 0); 87 REPORTER_ASSERT(reporter, fread(header, 4, 1, file) != 0);
88 REPORTER_ASSERT(reporter, strncmp(header, "%PDF", 4) == 0); 88 REPORTER_ASSERT(reporter, strncmp(header, "%PDF", 4) == 0);
89 fclose(file); 89 fclose(file);
90 } 90 }
91 91
92 static void test_close(skiatest::Reporter* reporter) { 92 static void test_close(skiatest::Reporter* reporter) {
93 SkDynamicMemoryWStream stream; 93 SkDynamicMemoryWStream stream;
94 SkAutoTUnref<SkDocument> doc(SkDocument::CreatePDF(&stream)); 94 SkAutoTUnref<SkDocument> doc(SkDocument::CreatePDF(&stream));
95 95
96 SkCanvas* canvas = doc->beginPage(100, 100); 96 SkCanvas* canvas = doc->beginPage(100, 100);
97 canvas->drawColor(SK_ColorRED); 97 canvas->drawColor(SK_ColorRED);
98 doc->endPage(); 98 doc->endPage();
99 99
100 doc->close(); 100 doc->close();
101 101
102 REPORTER_ASSERT(reporter, stream.bytesWritten() != 0); 102 REPORTER_ASSERT(reporter, stream.bytesWritten() != 0);
103 } 103 }
104 104
105 DEF_TEST(document_tests, reporter) { 105 DEF_TEST(document_tests, reporter) {
106 REQUIRE_PDF_DOCUMENT(document_tests, reporter); 106 REQUIRE_PDF_DOCUMENT(document_tests, reporter);
107 test_empty(reporter); 107 test_empty(reporter);
108 test_abort(reporter); 108 test_abort(reporter);
109 test_abortWithFile(reporter); 109 test_abortWithFile(reporter);
110 test_file(reporter); 110 test_file(reporter);
111 test_close(reporter); 111 test_close(reporter);
112 } 112 }
OLDNEW
« no previous file with comments | « tests/PDFDeflateWStreamTest.cpp ('k') | tests/PDFGlyphsToUnicodeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698