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 "SkIntersections.h" | 8 #include "SkIntersections.h" |
9 #include "SkPathOpsLine.h" | 9 #include "SkPathOpsLine.h" |
10 #include "Test.h" | 10 #include "Test.h" |
11 #include "TestClassDef.h" | |
12 | 11 |
13 // FIXME: add tests for intersecting, non-intersecting, degenerate, coincident | 12 // FIXME: add tests for intersecting, non-intersecting, degenerate, coincident |
14 static const SkDLine tests[][2] = { | 13 static const SkDLine tests[][2] = { |
15 {{{{30,20}, {30,50}}}, {{{24,30}, {36,30}}}}, | 14 {{{{30,20}, {30,50}}}, {{{24,30}, {36,30}}}}, |
16 {{{{323,193}, {-317,193}}}, {{{0,994}, {0,0}}}}, | 15 {{{{323,193}, {-317,193}}}, {{{0,994}, {0,0}}}}, |
17 {{{{90,230}, {160,60}}}, {{{60,120}, {260,120}}}}, | 16 {{{{90,230}, {160,60}}}, {{{60,120}, {260,120}}}}, |
18 {{{{90,230}, {160,60}}}, {{{181.176468,120}, {135.294128,120}}}}, | 17 {{{{90,230}, {160,60}}}, {{{181.176468,120}, {135.294128,120}}}}, |
19 {{{{181.1764678955078125f, 120}, {186.3661956787109375f, 134.7042236328125f}
}}, | 18 {{{{181.1764678955078125f, 120}, {186.3661956787109375f, 134.7042236328125f}
}}, |
20 {{{175.8309783935546875f, 141.5211334228515625f}, {187.8782806396484375f, 1
33.7258148193359375f}}}}, | 19 {{{175.8309783935546875f, 141.5211334228515625f}, {187.8782806396484375f, 1
33.7258148193359375f}}}}, |
21 #if 0 // FIXME: these fail because one line is too short and appears quasi-coin
cident | 20 #if 0 // FIXME: these fail because one line is too short and appears quasi-coin
cident |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 testOne(reporter, tests[1][0], tests[1][1]); | 208 testOne(reporter, tests[1][0], tests[1][1]); |
210 } | 209 } |
211 | 210 |
212 DEF_TEST(PathOpsLineIntersectionOneCoincident, reporter) { | 211 DEF_TEST(PathOpsLineIntersectionOneCoincident, reporter) { |
213 int index = 0; | 212 int index = 0; |
214 SkASSERT(index < (int) coincidentTests_count); | 213 SkASSERT(index < (int) coincidentTests_count); |
215 const SkDLine& line1 = coincidentTests[index][0]; | 214 const SkDLine& line1 = coincidentTests[index][0]; |
216 const SkDLine& line2 = coincidentTests[index][1]; | 215 const SkDLine& line2 = coincidentTests[index][1]; |
217 testOneCoincident(reporter, line1, line2); | 216 testOneCoincident(reporter, line1, line2); |
218 } | 217 } |
OLD | NEW |