summaryrefslogtreecommitdiff
path: root/test/horizontal-clip.c
diff options
context:
space:
mode:
authorAndrea Canciani <ranma42@gmail.com>2011-07-27 21:50:45 +0200
committerAndrea Canciani <ranma42@gmail.com>2011-07-28 18:11:27 +0200
commitde25fec06bbdbb3cf458aefb4e3b9d2271022b9c (patch)
treef78f666be8712f5a77f88d02305537c2c8610f17 /test/horizontal-clip.c
parent80b7a1aa9b600aa3cc746d662b4090e76838f17a (diff)
downloadcairo-de25fec06bbdbb3cf458aefb4e3b9d2271022b9c.tar.gz
test: Improve horizontal-clip
The bug pointed out by this test now causes failures in xcb and xlib.
Diffstat (limited to 'test/horizontal-clip.c')
-rw-r--r--test/horizontal-clip.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/test/horizontal-clip.c b/test/horizontal-clip.c
index 2a5025cfc..93127a722 100644
--- a/test/horizontal-clip.c
+++ b/test/horizontal-clip.c
@@ -29,10 +29,11 @@
#include "cairo-test.h"
-#define WIDTH 20
-#define HEIGHT 20
+#define WIDTH 16
+#define HEIGHT 26
-#define BUG 1
+#define BUGY 1
+#define BUGX (4 * BUGY * WIDTH * 256)
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
@@ -41,28 +42,28 @@ draw (cairo_t *cr, int width, int height)
cairo_paint (cr);
cairo_set_source_rgb (cr, 0, 0, 0);
- cairo_move_to (cr, 0-256, 4 - BUG);
- cairo_line_to (cr, WIDTH + 256, 4 + BUG);
- cairo_line_to (cr, WIDTH + 256, 2 - BUG);
- cairo_line_to (cr, 0-256, 2 + BUG);
+ cairo_move_to (cr, - BUGX, 6 - BUGY);
+ cairo_line_to (cr, + BUGX, 6 + BUGY);
+ cairo_line_to (cr, WIDTH + BUGX, 2 - BUGY);
+ cairo_line_to (cr, WIDTH - BUGX, 2 + BUGY);
cairo_fill (cr);
- cairo_move_to (cr, 0-256, 6 - BUG);
- cairo_line_to (cr, WIDTH + 256, 6 + BUG);
- cairo_line_to (cr, WIDTH + 256, 8 - BUG);
- cairo_line_to (cr, 0-256, 8 + BUG);
+ cairo_move_to (cr, WIDTH + BUGX, 8 - BUGY);
+ cairo_line_to (cr, WIDTH - BUGX, 8 + BUGY);
+ cairo_line_to (cr, - BUGX, 12 - BUGY);
+ cairo_line_to (cr, + BUGX, 12 + BUGY);
cairo_fill (cr);
- cairo_move_to (cr, WIDTH+256, 12 - BUG);
- cairo_line_to (cr, 0-256, 12 + BUG);
- cairo_line_to (cr, 0-256, 14 - BUG);
- cairo_line_to (cr, WIDTH+256, 14 + BUG);
+ cairo_move_to (cr, - BUGX, 14 - BUGY);
+ cairo_line_to (cr, + BUGX, 14 + BUGY);
+ cairo_line_to (cr, WIDTH + BUGX, 18 - BUGY);
+ cairo_line_to (cr, WIDTH - BUGX, 18 + BUGY);
cairo_fill (cr);
- cairo_move_to (cr, WIDTH+256, 18 - BUG);
- cairo_line_to (cr, 0-256, 18 + BUG);
- cairo_line_to (cr, 0-256, 16 - BUG);
- cairo_line_to (cr, WIDTH+256, 16 + BUG);
+ cairo_move_to (cr, WIDTH + BUGX, 24 - BUGY);
+ cairo_line_to (cr, WIDTH - BUGX, 24 + BUGY);
+ cairo_line_to (cr, - BUGX, 20 - BUGY);
+ cairo_line_to (cr, + BUGX, 20 + BUGY);
cairo_fill (cr);
return CAIRO_TEST_SUCCESS;