caryclark@google.com | 639df89 | 2012-01-10 21:46:10 +0000 | [diff] [blame] | 1 | #include "CubicIntersection_Tests.h" |
| 2 | #include "LineIntersection.h" |
| 3 | |
caryclark@google.com | 27accef | 2012-01-25 18:57:23 +0000 | [diff] [blame^] | 4 | // FIXME: add tests for intersecting, non-intersecting, degenerate, coincident |
caryclark@google.com | 639df89 | 2012-01-10 21:46:10 +0000 | [diff] [blame] | 5 | const _Line tests[][2] = { |
| 6 | {{{166.86950047022856, 112.69654129527828}, {166.86948801592692, 112.69655741235339}}, |
| 7 | {{166.86960700313026, 112.6965477747386}, {166.86925794355412, 112.69656471103423}}}, |
| 8 | }; |
| 9 | |
| 10 | const size_t tests_count = sizeof(tests) / sizeof(tests[0]); |
| 11 | |
| 12 | static size_t firstLineIntersectionTest = 0; |
| 13 | |
| 14 | void LineIntersection_Test() { |
| 15 | for (size_t index = firstLineIntersectionTest; index < tests_count; ++index) { |
| 16 | const _Line& line1 = tests[index][0]; |
| 17 | const _Line& line2 = tests[index][1]; |
| 18 | _Point result; |
| 19 | lineIntersect(line1, line2, &result); |
caryclark@google.com | 27accef | 2012-01-25 18:57:23 +0000 | [diff] [blame^] | 20 | // FIXME: validate results |
| 21 | // see if result is between start and end of both lines |
| 22 | // see if result is on both lines |
| 23 | // printf("%s (%g,%g)\n", __FUNCTION__, result.x, result.y); |
caryclark@google.com | 639df89 | 2012-01-10 21:46:10 +0000 | [diff] [blame] | 24 | } |
| 25 | } |