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

Side by Side Diff: tests/PDFPrimitivesTest.cpp

Issue 12440066: Fix minor valgrind-found memory leaks (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Addressed code review issues Created 7 years, 9 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/Matrix44Test.cpp ('k') | no next file » | 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 2010 The Android Open Source Project 3 * Copyright 2010 The Android Open Source Project
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 8
9 9
10 #include "Test.h" 10 #include "Test.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 REPORTER_ASSERT(reporter, stream_equals(buffer, 0, expectedResult, 218 REPORTER_ASSERT(reporter, stream_equals(buffer, 0, expectedResult,
219 buffer.getOffset())); 219 buffer.getOffset()));
220 } 220 }
221 221
222 // This test used to assert without the fix submitted for 222 // This test used to assert without the fix submitted for
223 // http://code.google.com/p/skia/issues/detail?id=1083. 223 // http://code.google.com/p/skia/issues/detail?id=1083.
224 // SKP files might have invalid glyph ids. This test ensures they are ignored, 224 // SKP files might have invalid glyph ids. This test ensures they are ignored,
225 // and there is no assert on input data in Debug mode. 225 // and there is no assert on input data in Debug mode.
226 static void test_issue1083() { 226 static void test_issue1083() {
227 SkISize pageSize = SkISize::Make(100, 100); 227 SkISize pageSize = SkISize::Make(100, 100);
228 SkPDFDevice* dev = new SkPDFDevice(pageSize, pageSize, SkMatrix::I()); 228 SkAutoTUnref<SkPDFDevice> dev(new SkPDFDevice(pageSize, pageSize, SkMatrix:: I()));
229 229
230 SkCanvas c(dev); 230 SkCanvas c(dev);
231 SkPaint paint; 231 SkPaint paint;
232 paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); 232 paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
233 233
234 uint16_t glyphID = 65000; 234 uint16_t glyphID = 65000;
235 c.drawText(&glyphID, 2, 0, 0, paint); 235 c.drawText(&glyphID, 2, 0, 0, paint);
236 236
237 SkPDFDocument doc; 237 SkPDFDocument doc;
238 doc.appendPage(dev); 238 doc.appendPage(dev);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 321
322 TestObjectRef(reporter); 322 TestObjectRef(reporter);
323 323
324 TestSubstitute(reporter); 324 TestSubstitute(reporter);
325 325
326 test_issue1083(); 326 test_issue1083();
327 } 327 }
328 328
329 #include "TestClassDef.h" 329 #include "TestClassDef.h"
330 DEFINE_TESTCLASS("PDFPrimitives", PDFPrimitivesTestClass, TestPDFPrimitives) 330 DEFINE_TESTCLASS("PDFPrimitives", PDFPrimitivesTestClass, TestPDFPrimitives)
OLDNEW
« no previous file with comments | « tests/Matrix44Test.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698