summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-11-11 10:22:17 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2008-11-13 11:36:42 +0000
commit9afad537301529a5a4b4ddf8b7e4425002ea39c7 (patch)
tree737b275252e15f5a07729df61bacd008ed77f6b4
parentcebc84f367a81eedebf7ab0b6b082691923c3ef7 (diff)
[test] Expand in-fill-trapezoid
Test vertices and edges of a rectangle to probe 'corner-cases', using the insideness conditions from flash.
-rw-r--r--test/in-fill-trapezoid.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/in-fill-trapezoid.c b/test/in-fill-trapezoid.c
index 717a87a0..57429687 100644
--- a/test/in-fill-trapezoid.c
+++ b/test/in-fill-trapezoid.c
@@ -42,6 +42,40 @@ draw (cairo_t *cr, int width, int height)
ret = CAIRO_TEST_FAILURE;
}
+ /* rectangular boundary tests */
+ if (cairo_in_fill (cr, -10, -10)) {
+ cairo_test_log (ctx, "Error: Found top-left vertex inside rectangle\n");
+ ret = CAIRO_TEST_FAILURE;
+ }
+ if (cairo_in_fill (cr, -10, 10)) {
+ cairo_test_log (ctx, "Error: Found bottom-left vertex inside rectangle\n");
+ ret = CAIRO_TEST_FAILURE;
+ }
+ if (! cairo_in_fill (cr, 10, -10)) {
+ cairo_test_log (ctx, "Error: Failed to find top-right vertex inside rectangle\n");
+ ret = CAIRO_TEST_FAILURE;
+ }
+ if (cairo_in_fill (cr, 10, 10)) {
+ cairo_test_log (ctx, "Error: Found bottom-right vertex inside rectangle\n");
+ ret = CAIRO_TEST_FAILURE;
+ }
+ if (cairo_in_fill (cr, -10, 0)) {
+ cairo_test_log (ctx, "Error: Found left edge inside rectangle\n");
+ ret = CAIRO_TEST_FAILURE;
+ }
+ if (! cairo_in_fill (cr, 0, -10)) {
+ cairo_test_log (ctx, "Error: Failed to find top edge inside rectangle\n");
+ ret = CAIRO_TEST_FAILURE;
+ }
+ if (! cairo_in_fill (cr, 10, 0)) {
+ cairo_test_log (ctx, "Error: Failed to find right edge inside rectangle\n");
+ ret = CAIRO_TEST_FAILURE;
+ }
+ if (cairo_in_fill (cr, 0, 10)) {
+ cairo_test_log (ctx, "Error: Found bottom edge inside rectangle\n");
+ ret = CAIRO_TEST_FAILURE;
+ }
+
/* simple circle */
cairo_new_path (cr);
cairo_arc (cr, 0, 0, 10, 0, 2 * M_PI);