OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "PathOpsTestCommon.h" | 7 #include "PathOpsTestCommon.h" |
8 #include "SkPathOpsCubic.h" | 8 #include "SkPathOpsCubic.h" |
9 #include "Test.h" | 9 #include "Test.h" |
10 #include "TestClassDef.h" | |
11 | 10 |
12 static const SkDCubic tests[] = { | 11 static const SkDCubic tests[] = { |
13 {{{2, 0}, {3, 1}, {2, 2}, {1, 1}}}, | 12 {{{2, 0}, {3, 1}, {2, 2}, {1, 1}}}, |
14 {{{3, 1}, {2, 2}, {1, 1}, {2, 0}}}, | 13 {{{3, 1}, {2, 2}, {1, 1}, {2, 0}}}, |
15 {{{3, 0}, {2, 1}, {3, 2}, {1, 1}}}, | 14 {{{3, 0}, {2, 1}, {3, 2}, {1, 1}}}, |
16 }; | 15 }; |
17 | 16 |
18 static const size_t tests_count = SK_ARRAY_COUNT(tests); | 17 static const size_t tests_count = SK_ARRAY_COUNT(tests); |
19 | 18 |
20 DEF_TEST(PathOpsDCubic, reporter) { | 19 DEF_TEST(PathOpsDCubic, reporter) { |
21 for (size_t index = 0; index < tests_count; ++index) { | 20 for (size_t index = 0; index < tests_count; ++index) { |
22 const SkDCubic& cubic = tests[index]; | 21 const SkDCubic& cubic = tests[index]; |
23 SkASSERT(ValidCubic(cubic)); | 22 SkASSERT(ValidCubic(cubic)); |
24 bool result = cubic.clockwise(); | 23 bool result = cubic.clockwise(); |
25 if (!result) { | 24 if (!result) { |
26 SkDebugf("%s [%d] expected clockwise\n", __FUNCTION__, index); | 25 SkDebugf("%s [%d] expected clockwise\n", __FUNCTION__, index); |
27 REPORTER_ASSERT(reporter, 0); | 26 REPORTER_ASSERT(reporter, 0); |
28 } | 27 } |
29 } | 28 } |
30 } | 29 } |
OLD | NEW |