blob: 3228d897795916efa73bdeaa3da77c25a383906e [file] [log] [blame]
caryclark@google.com639df892012-01-10 21:46:10 +00001#include "CubicIntersection.h"
2#include "CubicIntersection_TestData.h"
3#include "CubicIntersection_Tests.h"
4
5void BezierClip_Test() {
6 for (size_t index = 0; index < tests_count; ++index) {
7 const Cubic& cubic1 = tests[index][0];
8 const Cubic& cubic2 = tests[index][1];
9 Cubic reduce1, reduce2;
10 int order1 = reduceOrder(cubic1, reduce1, kReduceOrder_NoQuadraticsAllowed);
11 int order2 = reduceOrder(cubic2, reduce2, kReduceOrder_NoQuadraticsAllowed);
12 if (order1 < 4) {
13 printf("%s [%d] cubic1 order=%d\n", __FUNCTION__, (int) index, order1);
14 }
15 if (order2 < 4) {
16 printf("%s [%d] cubic2 order=%d\n", __FUNCTION__, (int) index, order2);
17 }
18 if (order1 == 4 && order2 == 4) {
19 double minT = 0;
20 double maxT = 1;
21 bezier_clip(reduce1, reduce2, minT, maxT);
22 }
23 }
24}