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

Side by Side Diff: tests/DashPathEffectTest.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/ColorFilterTest.cpp ('k') | tests/DataRefTest.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 2014 Google Inc. 2 * Copyright 2014 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 7
8 #include "Test.h" 8 #include "Test.h"
9 9
10 #include "SkDashPathEffect.h" 10 #include "SkDashPathEffect.h"
11 #include "SkWriteBuffer.h" 11 #include "SkWriteBuffer.h"
12 12
13 // crbug.com/348821 was rooted in SkDashPathEffect refusing to flatten and unfla tten itself when 13 // crbug.com/348821 was rooted in SkDashPathEffect refusing to flatten and unfla tten itself when
14 // fInitialDashLength < 0 (a signal the effect is nonsense). Here we test that it flattens. 14 // fInitialDashLength < 0 (a signal the effect is nonsense). Here we test that it flattens.
15 15
16 DEF_TEST(DashPathEffectTest_crbug_348821, r) { 16 DEF_TEST(DashPathEffectTest_crbug_348821, r) {
17 SkScalar intervals[] = { 1.76934361e+36f, 2.80259693e-45f }; // Values from bug. 17 SkScalar intervals[] = { 1.76934361e+36f, 2.80259693e-45f }; // Values from bug.
18 const int count = 2; 18 const int count = 2;
19 SkScalar phase = SK_ScalarInfinity; // Used to force the bad fInitialDashLe ngth = -1 path. 19 SkScalar phase = SK_ScalarInfinity; // Used to force the bad fInitialDashLe ngth = -1 path.
20 SkAutoTUnref<SkDashPathEffect> dash(SkDashPathEffect::Create(intervals, coun t, phase)); 20 SkAutoTUnref<SkDashPathEffect> dash(SkDashPathEffect::Create(intervals, coun t, phase));
21 21
22 // NULL -> refuses to work with flattening framework. 22 // nullptr -> refuses to work with flattening framework.
23 REPORTER_ASSERT(r, dash->getFactory() != NULL); 23 REPORTER_ASSERT(r, dash->getFactory() != nullptr);
24 24
25 SkWriteBuffer buffer; 25 SkWriteBuffer buffer;
26 buffer.writeFlattenable(dash); 26 buffer.writeFlattenable(dash);
27 REPORTER_ASSERT(r, buffer.bytesWritten() > 12); // We'd write 12 if broken, >=40 if not. 27 REPORTER_ASSERT(r, buffer.bytesWritten() > 12); // We'd write 12 if broken, >=40 if not.
28 } 28 }
29 29
30 // Test out the asPoint culling behavior. 30 // Test out the asPoint culling behavior.
31 DEF_TEST(DashPathEffectTest_asPoints, r) { 31 DEF_TEST(DashPathEffectTest_asPoints, r) {
32 32
33 const SkScalar intervals[] = { 1.0f, 1.0f }; 33 const SkScalar intervals[] = { 1.0f, 1.0f };
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 if (i < 2) { 79 if (i < 2) {
80 REPORTER_ASSERT(r, actualResult == testCases[j].fExpectedRes ult); 80 REPORTER_ASSERT(r, actualResult == testCases[j].fExpectedRes ult);
81 } else { 81 } else {
82 // On the third pass all the lines should be outside the tra nslated cull rect 82 // On the third pass all the lines should be outside the tra nslated cull rect
83 REPORTER_ASSERT(r, !actualResult); 83 REPORTER_ASSERT(r, !actualResult);
84 } 84 }
85 } 85 }
86 } 86 }
87 } 87 }
88 } 88 }
OLDNEW
« no previous file with comments | « tests/ColorFilterTest.cpp ('k') | tests/DataRefTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698