summaryrefslogtreecommitdiff
path: root/test/degenerate-path.c
diff options
context:
space:
mode:
authorJeff Muizelaar <jrmuizel@uwaterloo.ca>2007-02-19 16:06:56 -0500
committerJeff Muizelaar <jrmuizel@uwaterloo.ca>2007-02-19 16:06:56 -0500
commit1c1697398c5ef17e38bc031e8c067113a6c10287 (patch)
treecb0ca88710d1bebe7dd5cf773cad7aa7fb3fc9d0 /test/degenerate-path.c
parent9927dde5334322c97942982f9bf632e74502d628 (diff)
downloadcairo-1c1697398c5ef17e38bc031e8c067113a6c10287.tar.gz
Add two new test cases to degenerate-path test
These new cases deal with degenerate paths at the end of dashed paths. They currently fail.
Diffstat (limited to 'test/degenerate-path.c')
-rw-r--r--test/degenerate-path.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/test/degenerate-path.c b/test/degenerate-path.c
index 2c1e4c221..c861cd2ce 100644
--- a/test/degenerate-path.c
+++ b/test/degenerate-path.c
@@ -35,7 +35,7 @@ static cairo_test_draw_function_t draw;
cairo_test_t test = {
"degenerate-path",
"Tests the behaviour of degenerate paths with different cap types",
- 3*(PAD+LINE_WIDTH+PAD), 6*(LINE_WIDTH+PAD) + PAD,
+ 3*(PAD+LINE_WIDTH+PAD), 8*(LINE_WIDTH+PAD) + PAD,
draw
};
@@ -45,6 +45,7 @@ draw (cairo_t *cr, int width, int height)
const cairo_line_cap_t cap[] = { CAIRO_LINE_CAP_ROUND, CAIRO_LINE_CAP_SQUARE, CAIRO_LINE_CAP_BUTT };
size_t i;
double dash[] = {2, 2};
+ double dash_long[] = {6, 6};
cairo_set_source_rgb (cr, 1, 0, 0);
@@ -91,6 +92,26 @@ draw (cairo_t *cr, int width, int height)
cairo_close_path (cr);
cairo_stroke (cr);
+ /* this should draw a single degenerate sub-path
+ * at the end of the path */
+ cairo_set_dash (cr, dash_long, 2, 6.);
+
+ cairo_translate (cr, 0, 3*PAD);
+ cairo_move_to (cr, LINE_WIDTH + 6.0, LINE_WIDTH);
+ cairo_line_to (cr, LINE_WIDTH, LINE_WIDTH);
+ cairo_stroke (cr);
+
+ /* this should draw a single degenerate sub-path
+ * at the end of the path. The difference between this
+ * and the above is that this ends with a degenerate sub-path*/
+ cairo_set_dash (cr, dash_long, 2, 6.);
+
+ cairo_translate (cr, 0, 3*PAD);
+ cairo_move_to (cr, LINE_WIDTH + 6.0, LINE_WIDTH);
+ cairo_line_to (cr, LINE_WIDTH, LINE_WIDTH);
+ cairo_line_to (cr, LINE_WIDTH, LINE_WIDTH);
+ cairo_stroke (cr);
+
cairo_restore (cr);
cairo_translate (cr, PAD+LINE_WIDTH+PAD, 0);