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

Side by Side Diff: tests/Point3Test.cpp

Issue 1842753002: Style bikeshed - remove extraneous whitespace (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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/PathOpsTestCommon.cpp ('k') | tests/PointTest.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 2015 Google Inc. 2 * Copyright 2015 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 // Unit tests for src/core/SkPoint3.cpp and its header 8 // Unit tests for src/core/SkPoint3.cpp and its header
9 9
10 #include "SkPoint3.h" 10 #include "SkPoint3.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 v = SkPoint3::Make(SK_ScalarRoot2Over2, SK_ScalarRoot2Over2, 0.0f); 70 v = SkPoint3::Make(SK_ScalarRoot2Over2, SK_ScalarRoot2Over2, 0.0f);
71 71
72 dot = xAxis.dot(v); 72 dot = xAxis.dot(v);
73 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dot, SK_ScalarRoot2Over2)); 73 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dot, SK_ScalarRoot2Over2));
74 74
75 dot = yAxis.dot(v); 75 dot = yAxis.dot(v);
76 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dot, SK_ScalarRoot2Over2)); 76 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dot, SK_ScalarRoot2Over2));
77 } 77 }
78 78
79 static void test_length(skiatest::Reporter* reporter, 79 static void test_length(skiatest::Reporter* reporter,
80 SkScalar x, SkScalar y, SkScalar z, SkScalar expectedLen ) { 80 SkScalar x, SkScalar y, SkScalar z, SkScalar expectedLen ) {
81 SkPoint3 point = SkPoint3::Make(x, y, z); 81 SkPoint3 point = SkPoint3::Make(x, y, z);
82 82
83 SkScalar s1 = point.length(); 83 SkScalar s1 = point.length();
84 SkScalar s2 = SkPoint3::Length(x, y, z); 84 SkScalar s2 = SkPoint3::Length(x, y, z);
85 85
86 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(s1, s2)); 86 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(s1, s2));
87 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(s1, expectedLen)); 87 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(s1, expectedLen));
88 } 88 }
89 89
(...skipping 18 matching lines...) Expand all
108 108
109 DEF_TEST(Point3, reporter) { 109 DEF_TEST(Point3, reporter) {
110 test_eq_ops(reporter); 110 test_eq_ops(reporter);
111 test_ops(reporter); 111 test_ops(reporter);
112 test_dot(reporter); 112 test_dot(reporter);
113 113
114 static const struct { 114 static const struct {
115 SkScalar fX; 115 SkScalar fX;
116 SkScalar fY; 116 SkScalar fY;
117 SkScalar fZ; 117 SkScalar fZ;
118 SkScalar fLength; 118 SkScalar fLength;
119 } gRec[] = { 119 } gRec[] = {
120 { 0.0f, 0.0f, 0.0f, 0.0f }, 120 { 0.0f, 0.0f, 0.0f, 0.0f },
121 { 0.3f, 0.4f, 0.5f, SK_ScalarRoot2Over2 }, 121 { 0.3f, 0.4f, 0.5f, SK_ScalarRoot2Over2 },
122 { 1.0e-37f, 1.0e-37f, 1.0e-37f, 0.0f }, // underflows 122 { 1.0e-37f, 1.0e-37f, 1.0e-37f, 0.0f }, // underflows
123 { 3.4e38f, 0.0f, 0.0f, 3.4e38f } // overflows 123 { 3.4e38f, 0.0f, 0.0f, 3.4e38f } // overflows
124 }; 124 };
125 125
126 for (size_t i = 0; i < SK_ARRAY_COUNT(gRec); ++i) { 126 for (size_t i = 0; i < SK_ARRAY_COUNT(gRec); ++i) {
127 test_length(reporter, gRec[i].fX, gRec[i].fY, gRec[i].fZ, gRec[i].fLengt h); 127 test_length(reporter, gRec[i].fX, gRec[i].fY, gRec[i].fZ, gRec[i].fLengt h);
128 test_normalize(reporter, gRec[i].fX, gRec[i].fY, gRec[i].fZ, gRec[i].fLe ngth); 128 test_normalize(reporter, gRec[i].fX, gRec[i].fY, gRec[i].fZ, gRec[i].fLe ngth);
129 } 129 }
130 } 130 }
OLDNEW
« no previous file with comments | « tests/PathOpsTestCommon.cpp ('k') | tests/PointTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698