caryclark@google.com | 1304bb2 | 2013-03-13 20:29:41 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2012 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | #include "Intersection_Tests.h" |
| 8 | #include "CubicUtilities.h" |
| 9 | |
| 10 | const Cubic tests[] = { |
| 11 | {{2, 0}, {3, 1}, {2, 2}, {1, 1}}, |
| 12 | {{3, 1}, {2, 2}, {1, 1}, {2, 0}}, |
| 13 | {{3, 0}, {2, 1}, {3, 2}, {1, 1}}, |
| 14 | }; |
| 15 | |
| 16 | const size_t tests_count = sizeof(tests) / sizeof(tests[0]); |
| 17 | static size_t firstLineParameterTest = 0; |
| 18 | |
| 19 | void CubicUtilities_Test() { |
| 20 | for (size_t index = firstLineParameterTest; index < tests_count; ++index) { |
| 21 | const Cubic& cubic = tests[index]; |
| 22 | bool result = clockwise(cubic); |
| 23 | if (!result) { |
| 24 | SkDebugf("%s [%d] expected clockwise\n", __FUNCTION__, index); |
| 25 | SkASSERT(0); |
| 26 | } |
| 27 | } |
| 28 | } |