diff --git a/test/get-path-extents.c b/test/get-path-extents.c index 917039efc..ba2b116ba 100644 --- a/test/get-path-extents.c +++ b/test/get-path-extents.c @@ -121,6 +121,41 @@ draw (cairo_t *cr, int width, int height) !check_extents (phase, cr2, STROKE, EQUALS, 0, 0, 0, 0)) ret = CAIRO_TEST_FAILURE; + cairo_save (cr2); + + cairo_new_path (cr2); + cairo_move_to (cr2, 200, 400); + cairo_rel_line_to (cr2, 0., 0.); + phase = "Degenerate line"; + if (!check_extents (phase, cr2, FILL, EQUALS, 0, 0, 0, 0) || + !check_extents (phase, cr2, STROKE, EQUALS, 0, 0, 0, 0)) + ret = CAIRO_TEST_FAILURE; + + cairo_new_path (cr2); + cairo_move_to (cr2, 200, 400); + cairo_rel_curve_to (cr2, 0., 0., 0., 0., 0., 0.); + phase = "Degenerate curve"; + if (!check_extents (phase, cr2, FILL, EQUALS, 0, 0, 0, 0) || + !check_extents (phase, cr2, STROKE, EQUALS, 0, 0, 0, 0)) + ret = CAIRO_TEST_FAILURE; + + cairo_new_path (cr2); + cairo_arc (cr2, 200, 400, 0., 0, 2 * M_PI); + phase = "Degenerate arc (R=0)"; + if (!check_extents (phase, cr2, FILL, EQUALS, 0, 0, 0, 0) || + !check_extents (phase, cr2, STROKE, EQUALS, 0, 0, 0, 0)) + ret = CAIRO_TEST_FAILURE; + + cairo_new_path (cr2); + cairo_arc (cr2, 200, 400, 10., 0, 0); + phase = "Degenerate arc (Θ=0)"; + if (!check_extents (phase, cr2, FILL, EQUALS, 0, 0, 0, 0) || + !check_extents (phase, cr2, STROKE, EQUALS, 0, 0, 0, 0)) + ret = CAIRO_TEST_FAILURE; + + cairo_new_path (cr2); + cairo_restore (cr2); + /* http://bugs.freedesktop.org/show_bug.cgi?id=7965 */ phase = "A vertical, open path"; cairo_save (cr2);