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

Side by Side Diff: tests/AnnotationTest.cpp

Issue 145313004: Cleanup: Sanitize the order of includes under tests/ (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: more two fixes Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « tests/AndroidPaintTest.cpp ('k') | tests/AtomicTest.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "Test.h"
9 #include "SkAnnotation.h" 8 #include "SkAnnotation.h"
9 #include "SkCanvas.h"
10 #include "SkData.h" 10 #include "SkData.h"
11 #include "SkCanvas.h"
12 #include "SkPDFDevice.h" 11 #include "SkPDFDevice.h"
13 #include "SkPDFDocument.h" 12 #include "SkPDFDocument.h"
13 #include "Test.h"
14 14
15 /** Returns true if data (may contain null characters) contains needle (null 15 /** Returns true if data (may contain null characters) contains needle (null
16 * terminated). */ 16 * terminated). */
17 static bool ContainsString(const char* data, size_t dataSize, const char* needle ) { 17 static bool ContainsString(const char* data, size_t dataSize, const char* needle ) {
18 size_t nSize = strlen(needle); 18 size_t nSize = strlen(needle);
19 for (size_t i = 0; i < dataSize - nSize; i++) { 19 for (size_t i = 0; i < dataSize - nSize; i++) {
20 if (strncmp(&data[i], needle, nSize) == 0) { 20 if (strncmp(&data[i], needle, nSize) == 0) {
21 return true; 21 return true;
22 } 22 }
23 } 23 }
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 SkPDFDocument doc; 87 SkPDFDocument doc;
88 doc.appendPage(&device); 88 doc.appendPage(&device);
89 SkDynamicMemoryWStream outStream; 89 SkDynamicMemoryWStream outStream;
90 doc.emitPDF(&outStream); 90 doc.emitPDF(&outStream);
91 SkAutoDataUnref out(outStream.copyToData()); 91 SkAutoDataUnref out(outStream.copyToData());
92 const char* rawOutput = (const char*)out->data(); 92 const char* rawOutput = (const char*)out->data();
93 93
94 REPORTER_ASSERT(reporter, 94 REPORTER_ASSERT(reporter,
95 ContainsString(rawOutput, out->size(), "/example ")); 95 ContainsString(rawOutput, out->size(), "/example "));
96 } 96 }
OLDNEW
« no previous file with comments | « tests/AndroidPaintTest.cpp ('k') | tests/AtomicTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698