blob: 2af74d29c42434d4aece54d527f464fb5ca84781 [file] [log] [blame]
caryclark@google.com639df892012-01-10 21:46:10 +00001#include "CubicIntersection_Tests.h"
2#include "LineIntersection.h"
3
caryclark@google.com27accef2012-01-25 18:57:23 +00004// FIXME: add tests for intersecting, non-intersecting, degenerate, coincident
caryclark@google.com639df892012-01-10 21:46:10 +00005const _Line tests[][2] = {
6 {{{166.86950047022856, 112.69654129527828}, {166.86948801592692, 112.69655741235339}},
7 {{166.86960700313026, 112.6965477747386}, {166.86925794355412, 112.69656471103423}}},
8};
9
10const size_t tests_count = sizeof(tests) / sizeof(tests[0]);
11
12static size_t firstLineIntersectionTest = 0;
13
14void 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.com27accef2012-01-25 18:57:23 +000020 // 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.com639df892012-01-10 21:46:10 +000024 }
25}