blob: aa475c7334c114d3c5b7780d6d6f114f49a903a9 [file] [log] [blame]
caryclark@google.comaf46cff2012-05-22 21:12:00 +00001/*
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
caryclark@google.comaf46cff2012-05-22 21:12:00 +00008#include "EdgeWalker_Test.h"
9#include "Intersection_Tests.h"
caryclark@google.com8dcf1142012-07-02 20:27:02 +000010#include "ShapeOps.h"
caryclark@google.comaf46cff2012-05-22 21:12:00 +000011
caryclark@google.com47580692012-07-23 12:14:49 +000012#define TEST(name) { name, #name }
13
caryclark@google.comaf46cff2012-05-22 21:12:00 +000014static void testLine1() {
15 SkPath path, simple;
16 path.moveTo(2,0);
17 path.lineTo(1,1);
18 path.lineTo(0,0);
19 path.close();
caryclark@google.com88f7d0c2012-06-07 21:09:20 +000020 testSimplifyx(path);
caryclark@google.comaf46cff2012-05-22 21:12:00 +000021}
22
23static void addInnerCWTriangle(SkPath& path) {
24 path.moveTo(3,0);
25 path.lineTo(4,1);
26 path.lineTo(2,1);
27 path.close();
28}
29
30static void addInnerCCWTriangle(SkPath& path) {
31 path.moveTo(3,0);
32 path.lineTo(2,1);
33 path.lineTo(4,1);
34 path.close();
35}
36
37static void addOuterCWTriangle(SkPath& path) {
38 path.moveTo(3,0);
39 path.lineTo(6,2);
40 path.lineTo(0,2);
41 path.close();
42}
43
44static void addOuterCCWTriangle(SkPath& path) {
45 path.moveTo(3,0);
46 path.lineTo(0,2);
47 path.lineTo(6,2);
48 path.close();
49}
50
51static void testLine2() {
52 SkPath path, simple;
53 addInnerCWTriangle(path);
54 addOuterCWTriangle(path);
caryclark@google.com88f7d0c2012-06-07 21:09:20 +000055 testSimplifyx(path);
caryclark@google.comaf46cff2012-05-22 21:12:00 +000056}
57
caryclark@google.com495f8e42012-05-31 13:13:11 +000058static void testLine3() {
59 SkPath path, simple;
60 addInnerCCWTriangle(path);
61 addOuterCWTriangle(path);
caryclark@google.com88f7d0c2012-06-07 21:09:20 +000062 testSimplifyx(path);
caryclark@google.com495f8e42012-05-31 13:13:11 +000063}
64
65static void testLine4() {
66 SkPath path, simple;
67 addOuterCCWTriangle(path);
68 addOuterCWTriangle(path);
caryclark@google.com88f7d0c2012-06-07 21:09:20 +000069 testSimplifyx(path);
caryclark@google.com495f8e42012-05-31 13:13:11 +000070}
71
72static void testLine5() {
73 SkPath path, simple;
74 addOuterCWTriangle(path);
75 addOuterCWTriangle(path);
caryclark@google.com88f7d0c2012-06-07 21:09:20 +000076 testSimplifyx(path);
caryclark@google.com495f8e42012-05-31 13:13:11 +000077}
caryclark@google.comaf46cff2012-05-22 21:12:00 +000078
caryclark@google.com88f7d0c2012-06-07 21:09:20 +000079static void testLine6() {
80 SkPath path, simple;
81 path.moveTo(0,0);
82 path.lineTo(4,0);
83 path.lineTo(2,2);
84 path.close();
85 path.moveTo(2,0);
86 path.lineTo(6,0);
87 path.lineTo(4,2);
88 path.close();
89 testSimplifyx(path);
90}
91
92static void testLine7() {
93 SkPath path, simple;
94 path.moveTo(0,0);
95 path.lineTo(4,0);
96 path.lineTo(2,2);
97 path.close();
98 path.moveTo(6,0);
99 path.lineTo(2,0);
100 path.lineTo(4,2);
101 path.close();
102 testSimplifyx(path);
103}
104
caryclark@google.comfa4a6e92012-07-11 17:52:32 +0000105static void testLine7a() {
106 SkPath path, simple;
107 path.moveTo(0,0);
108 path.lineTo(4,0);
109 path.lineTo(2,2);
110 path.close();
111 testSimplifyx(path);
112}
113
114static void testLine7b() {
115 SkPath path, simple;
116 path.moveTo(0,0);
117 path.lineTo(4,0);
118 path.close();
119 path.moveTo(6,0);
120 path.lineTo(2,0);
121 path.lineTo(4,2);
122 path.close();
123 testSimplifyx(path);
124}
125
caryclark@google.com88f7d0c2012-06-07 21:09:20 +0000126static void testLine8() {
127 SkPath path, simple;
128 path.moveTo(0,4);
129 path.lineTo(4,4);
130 path.lineTo(2,2);
131 path.close();
132 path.moveTo(2,4);
133 path.lineTo(6,4);
134 path.lineTo(4,2);
135 path.close();
136 testSimplifyx(path);
137}
138
139static void testLine9() {
140 SkPath path, simple;
141 path.moveTo(0,4);
142 path.lineTo(4,4);
143 path.lineTo(2,2);
144 path.close();
145 path.moveTo(6,4);
146 path.lineTo(2,4);
147 path.lineTo(4,2);
148 path.close();
149 testSimplifyx(path);
150}
151
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000152static void testLine10() {
153 SkPath path, simple;
154 path.moveTo(0,4);
155 path.lineTo(4,4);
156 path.lineTo(2,2);
157 path.close();
158 path.moveTo(2,1);
159 path.lineTo(3,4);
160 path.lineTo(6,1);
161 path.close();
162 testSimplifyx(path);
163}
caryclark@google.com88f7d0c2012-06-07 21:09:20 +0000164
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000165static void testLine10a() {
166 SkPath path, simple;
167 path.moveTo(0,4);
168 path.lineTo(8,4);
169 path.lineTo(4,0);
170 path.close();
171 path.moveTo(2,2);
172 path.lineTo(3,3);
173 path.lineTo(4,2);
174 path.close();
175 testSimplifyx(path);
176}
177
178static void addCWContainer(SkPath& path) {
179 path.moveTo(6,4);
180 path.lineTo(0,4);
181 path.lineTo(3,1);
182 path.close();
183}
184
185static void addCCWContainer(SkPath& path) {
186 path.moveTo(0,4);
187 path.lineTo(6,4);
188 path.lineTo(3,1);
189 path.close();
190}
191
192static void addCWContents(SkPath& path) {
193 path.moveTo(2,3);
194 path.lineTo(3,2);
195 path.lineTo(4,3);
196 path.close();
197}
198
199static void addCCWContents(SkPath& path) {
200 path.moveTo(3,2);
201 path.lineTo(2,3);
202 path.lineTo(4,3);
203 path.close();
204}
205
206static void testLine11() {
207 SkPath path, simple;
208 addCWContainer(path);
209 addCWContents(path);
210 testSimplifyx(path);
211}
212
213static void testLine12() {
214 SkPath path, simple;
215 addCCWContainer(path);
216 addCWContents(path);
217 testSimplifyx(path);
218}
219
220static void testLine13() {
221 SkPath path, simple;
222 addCWContainer(path);
223 addCCWContents(path);
224 testSimplifyx(path);
225}
226
227static void testLine14() {
228 SkPath path, simple;
229 addCCWContainer(path);
230 addCCWContents(path);
231 testSimplifyx(path);
232}
233
234static void testLine15() {
235 SkPath path, simple;
236 path.addRect(0, 0, 9, 9, (SkPath::Direction) 0);
237 testSimplifyx(path);
238}
239
240static void testLine16() {
241 SkPath path, simple;
242 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
243 path.addRect(0, 4, 9, 9, (SkPath::Direction) 0);
244 testSimplifyx(path);
245}
246
247static void testLine17() {
248 SkPath path, simple;
249 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
250 path.addRect(4, 12, 13, 13, (SkPath::Direction) 0);
251 testSimplifyx(path);
252}
253
254static void testLine18() {
255 SkPath path, simple;
256 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
257 path.addRect(12, 4, 21, 21, (SkPath::Direction) 0);
258 testSimplifyx(path);
259}
260
261static void testLine19() {
262 SkPath path, simple;
263 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
264 path.addRect(12, 16, 21, 21, (SkPath::Direction) 0);
265 testSimplifyx(path);
266}
267
268static void testLine20() {
269 SkPath path, simple;
270 path.addRect(0, 12, 12, 12, (SkPath::Direction) 0);
271 path.addRect(0, 12, 9, 9, (SkPath::Direction) 0);
272 testSimplifyx(path);
273}
274
275static void testLine21() {
276 SkPath path, simple;
277 path.addRect(0, 12, 12, 12, (SkPath::Direction) 0);
278 path.addRect(0, 16, 9, 9, (SkPath::Direction) 0);
279 testSimplifyx(path);
280}
281
282static void testLine22() {
283 SkPath path, simple;
284 path.addRect(0, 12, 12, 12, (SkPath::Direction) 0);
285 path.addRect(4, 12, 13, 13, (SkPath::Direction) 0);
286 testSimplifyx(path);
287}
288
289static void testLine23() {
290 SkPath path, simple;
291 path.addRect(0, 12, 12, 12, (SkPath::Direction) 0);
292 path.addRect(12, 0, 21, 21, (SkPath::Direction) 0);
293 testSimplifyx(path);
294}
295
296
297
298static void testLine24a() {
299 SkPath path, simple;
300 path.moveTo(2,0);
301 path.lineTo(4,4);
302 path.lineTo(0,4);
303 path.close();
304 path.moveTo(2,0);
305 path.lineTo(1,2);
306 path.lineTo(2,2);
307 path.close();
308 testSimplifyx(path);
309}
310
311static void testLine24() {
312 SkPath path, simple;
313 path.addRect(0, 18, 12, 12, (SkPath::Direction) 0);
314 path.addRect(4, 12, 13, 13, (SkPath::Direction) 0);
315 testSimplifyx(path);
316}
317
318static void testLine25() {
319 SkPath path, simple;
320 path.addRect(0, 6, 12, 12, (SkPath::Direction) 0);
321 path.addRect(12, 0, 21, 21, (SkPath::Direction) 0);
322 testSimplifyx(path);
323}
324
325static void testLine26() {
326 SkPath path, simple;
327 path.addRect(0, 18, 12, 12, (SkPath::Direction) 0);
328 path.addRect(0, 12, 9, 9, (SkPath::Direction) 0);
329 testSimplifyx(path);
330}
331
332static void testLine27() {
333 SkPath path, simple;
334 path.addRect(0, 18, 12, 12, (SkPath::Direction) 0);
335 path.addRect(12, 8, 21, 21, (SkPath::Direction) 0);
336 testSimplifyx(path);
337}
338
caryclark@google.comfa4a6e92012-07-11 17:52:32 +0000339static void testLine28() {
340 SkPath path, simple;
341 path.addRect(0, 6, 12, 12, (SkPath::Direction) 0);
342 path.addRect(0, 0, 9, 9, (SkPath::Direction) 0);
343 testSimplifyx(path);
344}
345
346static void testLine29() {
347 SkPath path, simple;
348 path.addRect(0, 18, 12, 12, (SkPath::Direction) 0);
349 path.addRect(12, 12, 21, 21, (SkPath::Direction) 0);
350 testSimplifyx(path);
351}
352
353static void testLine30() {
354 SkPath path, simple;
355 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
356 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
357 path.addRect(4, 4, 13, 13, (SkPath::Direction) 0);
358 testSimplifyx(path);
359}
360
361static void testLine31() {
362 SkPath path, simple;
363 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
364 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
365 path.addRect(0, 4, 9, 9, (SkPath::Direction) 0);
366 testSimplifyx(path);
367}
368
369static void testLine32() {
370 SkPath path, simple;
371 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
372 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
373 path.addRect(4, 12, 13, 13, (SkPath::Direction) 0);
374 testSimplifyx(path);
375}
376
caryclark@google.com210acaf2012-07-12 21:05:13 +0000377static void testLine33() {
378 SkPath path, simple;
379 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
380 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
381 path.addRect(4, 16, 13, 13, (SkPath::Direction) 0);
382 testSimplifyx(path);
383}
384
385static void testLine34() {
386 SkPath path, simple;
387 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
388 path.addRect(0, 6, 12, 12, (SkPath::Direction) 0);
389 path.addRect(4, 12, 13, 13, (SkPath::Direction) 0);
390 testSimplifyx(path);
391}
392
393static void testLine35() {
394 SkPath path, simple;
395 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
396 path.addRect(6, 0, 18, 18, (SkPath::Direction) 0);
397 path.addRect(4, 16, 13, 13, (SkPath::Direction) 0);
398 testSimplifyx(path);
399}
400
caryclark@google.com0e08a192012-07-13 21:07:52 +0000401static void testLine36() {
402 SkPath path, simple;
403 path.addRect(0, 10, 20, 20, (SkPath::Direction) 0);
404 path.addRect(6, 12, 18, 18, (SkPath::Direction) 0);
405 path.addRect(4, 16, 13, 13, (SkPath::Direction) 0);
406 testSimplifyx(path);
407}
408
caryclark@google.com47580692012-07-23 12:14:49 +0000409static void testLine37() {
410 SkPath path, simple;
411 path.addRect(0, 20, 20, 20, (SkPath::Direction) 0);
412 path.addRect(18, 24, 30, 30, (SkPath::Direction) 0);
413 path.addRect(0, 0, 9, 9, (SkPath::Direction) 0);
414 testSimplifyx(path);
415}
416
417static void testLine38() {
418 SkPath path, simple;
419 path.addRect(10, 0, 30, 30, (SkPath::Direction) 0);
420 path.addRect(6, 12, 18, 18, (SkPath::Direction) 0);
421 path.addRect(12, 12, 21, 21, (SkPath::Direction) 0);
422 testSimplifyx(path);
423}
424
425static void testLine40() {
426 SkPath path, simple;
427 path.addRect(10, 0, 30, 30, (SkPath::Direction) 0);
428 path.addRect(12, 18, 24, 24, (SkPath::Direction) 0);
429 path.addRect(4, 16, 13, 13, (SkPath::Direction) 0);
430 testSimplifyx(path);
431}
432
433static void testLine41() {
434 SkPath path, simple;
435 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
436 path.addRect(18, 24, 30, 30, (SkPath::Direction) 0);
437 path.addRect(12, 0, 21, 21, (SkPath::Direction) 0);
438 testSimplifyx(path);
439}
440
441static void testLine42() {
442 SkPath path, simple;
443 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
444 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
445 path.addRect(8, 16, 17, 17, (SkPath::Direction) 0);
446 testSimplifyx(path);
447}
448
449static void testLine43() {
450 SkPath path, simple;
451 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
452 path.addRect(6, 24, 18, 18, (SkPath::Direction) 0);
453 path.addRect(0, 32, 9, 36, (SkPath::Direction) 1);
454 testSimplifyx(path);
455}
456
457static void testLine44() {
458 SkPath path, simple;
459 path.addRect(10, 40, 30, 30, (SkPath::Direction) 0);
460 path.addRect(18, 0, 30, 30, (SkPath::Direction) 0);
461 path.addRect(18, 32, 27, 36, (SkPath::Direction) 1);
462 testSimplifyx(path);
463}
464
465static void testLine45() {
466 SkPath path, simple;
467 path.addRect(10, 0, 30, 30, (SkPath::Direction) 0);
468 path.addRect(18, 0, 30, 30, (SkPath::Direction) 0);
469 path.addRect(24, 32, 33, 36, (SkPath::Direction) 0);
470 testSimplifyx(path);
471}
472
473static void testLine46() {
474 SkPath path, simple;
475 path.addRect(10, 40, 30, 30, (SkPath::Direction) 0);
476 path.addRect(24, 0, 36, 36, (SkPath::Direction) 0);
477 path.addRect(24, 32, 33, 36, (SkPath::Direction) 0);
478 testSimplifyx(path);
479}
480
481static void testLine47() {
482 SkPath path, simple;
483 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
484 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
485 path.addRect(0, 0, 9, 9, (SkPath::Direction) 1);
486 testSimplifyx(path);
487}
488
489static void testLine48() {
490 SkPath path, simple;
491 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
492 path.addRect(0, 6, 12, 12, (SkPath::Direction) 0);
493 path.addRect(0, 0, 9, 9, (SkPath::Direction) 1);
494 testSimplifyx(path);
495}
496
497static void testLine49() {
498 SkPath path, simple;
499 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
500 path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
501 path.addRect(0, 0, 9, 9, (SkPath::Direction) 0);
502 testSimplifyx(path);
503}
504
505static void testLine50() {
506 SkPath path, simple;
507 path.addRect(10, 30, 30, 30, (SkPath::Direction) 0);
508 path.addRect(24, 20, 36, 30, (SkPath::Direction) 0);
509 testSimplifyx(path);
510}
511
512
513static void testLine51() {
514 SkPath path, simple;
515 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
516 path.addRect(0, 12, 12, 12, (SkPath::Direction) 0);
517 path.addRect(4, 12, 13, 13, (SkPath::Direction) 1);
518 testSimplifyx(path);
519}
520
caryclark@google.come21cb182012-07-23 21:26:31 +0000521static void testLine52() {
522 SkPath path, simple;
523 path.addRect(0, 30, 20, 20, (SkPath::Direction) 0);
524 path.addRect(6, 20, 18, 30, (SkPath::Direction) 0);
525 path.addRect(32, 0, 36, 41, (SkPath::Direction) 0);
526 testSimplifyx(path);
527}
528
529static void testLine53() {
530 SkPath path, simple;
531 path.addRect(10, 30, 30, 30, (SkPath::Direction) 0);
532 path.addRect(12, 20, 24, 30, (SkPath::Direction) 0);
533 path.addRect(12, 32, 21, 36, (SkPath::Direction) 1);
534 testSimplifyx(path);
535}
536
537static void testLine54() {
538 SkPath path, simple;
539 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
540 path.addRect(6, 0, 18, 18, (SkPath::Direction) 0);
541 path.addRect(8, 4, 17, 17, (SkPath::Direction) 1);
542 testSimplifyx(path);
543}
544
545static void testLine55() {
546 SkPath path, simple;
547 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
548 path.addRect(6, 6, 18, 18, (SkPath::Direction) 0);
549 path.addRect(4, 4, 13, 13, (SkPath::Direction) 1);
550 testSimplifyx(path);
551}
552
caryclark@google.com18063442012-07-25 12:05:18 +0000553static void testLine56() {
554 SkPath path, simple;
555 path.addRect(0, 20, 20, 20, (SkPath::Direction) 0);
556 path.addRect(18, 20, 30, 30, (SkPath::Direction) 0);
557 path.addRect(12, 0, 21, 21, (SkPath::Direction) 1);
558 testSimplifyx(path);
559}
560
561static void testLine57() {
562 SkPath path, simple;
563 path.addRect(20, 0, 40, 40, (SkPath::Direction) 0);
564 path.addRect(20, 0, 30, 40, (SkPath::Direction) 0);
565 path.addRect(12, 0, 21, 21, (SkPath::Direction) 1);
566 testSimplifyx(path);
567}
568
caryclark@google.comcc905052012-07-25 20:59:42 +0000569static void testLine58() {
570 SkPath path, simple;
571 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
572 path.addRect(0, 0, 12, 12, (SkPath::Direction) 1);
573 path.addRect(0, 12, 9, 9, (SkPath::Direction) 1);
574 testSimplifyx(path);
575}
576
577static void testLine59() {
578 SkPath path, simple;
579 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
580 path.addRect(6, 6, 18, 18, (SkPath::Direction) 1);
581 path.addRect(4, 4, 13, 13, (SkPath::Direction) 1);
582 testSimplifyx(path);
583}
584
caryclark@google.com27c449a2012-07-27 18:26:38 +0000585static void testLine60() {
586 SkPath path, simple;
587 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
588 path.addRect(6, 12, 18, 18, (SkPath::Direction) 1);
589 path.addRect(4, 12, 13, 13, (SkPath::Direction) 1);
590 testSimplifyx(path);
591}
592
593static void testLine61() {
594 SkPath path, simple;
595 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
596 path.addRect(12, 0, 24, 24, (SkPath::Direction) 1);
597 path.addRect(12, 0, 21, 21, (SkPath::Direction) 1);
598 testSimplifyx(path);
599}
600
601static void testLine62() {
602 SkPath path, simple;
603 path.addRect(0, 0, 60, 60, (SkPath::Direction) 0);
604 path.addRect(0, 0, 20, 20, (SkPath::Direction) 0);
605 path.addRect(0, 12, 12, 12, (SkPath::Direction) 0);
606 path.addRect(4, 12, 13, 13, (SkPath::Direction) 1);
607 testSimplifyx(path);
608}
609
610static void testLine63() {
611 SkPath path, simple;
612 path.addRect(0, 0, 60, 60, (SkPath::Direction) 0);
613 path.addRect(0, 10, 20, 20, (SkPath::Direction) 0);
614 path.addRect(0, 6, 12, 12, (SkPath::Direction) 1);
615 path.addRect(0, 32, 9, 36, (SkPath::Direction) 1);
616 testSimplifyx(path);
617}
618
619static void testLine64() {
620 SkPath path, simple;
621 path.addRect(0, 0, 60, 60, (SkPath::Direction) 0);
622 path.addRect(10, 40, 30, 30, (SkPath::Direction) 0);
623 path.addRect(18, 6, 30, 30, (SkPath::Direction) 0);
624 testSimplifyx(path);
625}
626
627static void testLine65() {
628 SkPath path, simple;
629 path.addRect(0, 0, 60, 60, (SkPath::Direction) 0);
630 path.addRect(10, 0, 30, 30, (SkPath::Direction) 0);
631 path.addRect(24, 0, 36, 36, (SkPath::Direction) 0);
632 path.addRect(32, 6, 36, 41, (SkPath::Direction) 1);
633 testSimplifyx(path);
634}
635
636static void testLine66() {
637 SkPath path, simple;
638 path.addRect(0, 0, 60, 60, (SkPath::Direction) 0);
639 path.addRect(0, 30, 20, 20, (SkPath::Direction) 0);
640 path.addRect(12, 20, 24, 30, (SkPath::Direction) 0);
641 testSimplifyx(path);
642}
643
644static void (*firstTest)() = testLine66;
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000645
646static struct {
647 void (*fun)();
648 const char* str;
649} tests[] = {
caryclark@google.com27c449a2012-07-27 18:26:38 +0000650 TEST(testLine66),
651 TEST(testLine65),
652 TEST(testLine64),
653 TEST(testLine63),
654 TEST(testLine62),
655 TEST(testLine61),
656 TEST(testLine60),
caryclark@google.comcc905052012-07-25 20:59:42 +0000657 TEST(testLine59),
658 TEST(testLine58),
caryclark@google.com18063442012-07-25 12:05:18 +0000659 TEST(testLine57),
660 TEST(testLine56),
caryclark@google.come21cb182012-07-23 21:26:31 +0000661 TEST(testLine55),
662 TEST(testLine54),
663 TEST(testLine53),
664 TEST(testLine52),
caryclark@google.com47580692012-07-23 12:14:49 +0000665 TEST(testLine51),
666 TEST(testLine50),
667 TEST(testLine49),
668 TEST(testLine48),
669 TEST(testLine47),
670 TEST(testLine46),
671 TEST(testLine45),
672 TEST(testLine44),
673 TEST(testLine43),
674 TEST(testLine42),
675 TEST(testLine41),
676 TEST(testLine40),
677 TEST(testLine38),
678 TEST(testLine37),
679 TEST(testLine36),
680 TEST(testLine35),
681 TEST(testLine34),
682 TEST(testLine33),
683 TEST(testLine32),
684 TEST(testLine31),
685 TEST(testLine30),
686 TEST(testLine29),
687 TEST(testLine28),
688 TEST(testLine27),
689 TEST(testLine26),
690 TEST(testLine25),
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000691 TEST(testLine24a),
692 TEST(testLine24),
caryclark@google.com47580692012-07-23 12:14:49 +0000693 TEST(testLine23),
694 TEST(testLine22),
695 TEST(testLine21),
696 TEST(testLine20),
697 TEST(testLine19),
698 TEST(testLine18),
699 TEST(testLine17),
700 TEST(testLine16),
701 TEST(testLine15),
702 TEST(testLine14),
703 TEST(testLine13),
704 TEST(testLine12),
705 TEST(testLine11),
706 TEST(testLine10a),
707 TEST(testLine10),
708 TEST(testLine9),
709 TEST(testLine8),
710 TEST(testLine7b),
711 TEST(testLine7a),
712 TEST(testLine7),
713 TEST(testLine6),
714 TEST(testLine5),
715 TEST(testLine4),
716 TEST(testLine3),
717 TEST(testLine2),
718 TEST(testLine1),
caryclark@google.comaf46cff2012-05-22 21:12:00 +0000719};
720
721static const size_t testCount = sizeof(tests) / sizeof(tests[0]);
722
caryclark@google.comaf46cff2012-05-22 21:12:00 +0000723static bool skipAll = false;
724
725void SimplifyNew_Test() {
726 if (skipAll) {
727 return;
728 }
caryclark@google.com47580692012-07-23 12:14:49 +0000729#ifdef SK_DEBUG
caryclark@google.com27c449a2012-07-27 18:26:38 +0000730 gDebugMaxWindSum = 4;
731 gDebugMaxWindValue = 4;
caryclark@google.com47580692012-07-23 12:14:49 +0000732#endif
caryclark@google.come21cb182012-07-23 21:26:31 +0000733 size_t index = testCount - 1;
caryclark@google.comaf46cff2012-05-22 21:12:00 +0000734 if (firstTest) {
caryclark@google.come21cb182012-07-23 21:26:31 +0000735 while (index > 0 && tests[index].fun != firstTest) {
736 --index;
caryclark@google.comaf46cff2012-05-22 21:12:00 +0000737 }
738 }
739 bool firstTestComplete = false;
caryclark@google.come21cb182012-07-23 21:26:31 +0000740 do {
741 SkDebugf(" %s [%s]\n", __FUNCTION__, tests[index].str);
caryclark@google.com8dcf1142012-07-02 20:27:02 +0000742 (*tests[index].fun)();
caryclark@google.comaf46cff2012-05-22 21:12:00 +0000743 firstTestComplete = true;
caryclark@google.come21cb182012-07-23 21:26:31 +0000744 } while (index--);
caryclark@google.com47580692012-07-23 12:14:49 +0000745#ifdef SK_DEBUG
746 gDebugMaxWindSum = SK_MaxS32;
747 gDebugMaxWindValue = SK_MaxS32;
748#endif
caryclark@google.comaf46cff2012-05-22 21:12:00 +0000749}