From 880afeecc0d8bd610733292fd1cb692bba98dd5b Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Fri, 24 Apr 2009 21:35:46 -0400 Subject: [PATCH] Add trap-crasher.c test program Based off of Pavel Kankovsky's test case in bug 16560. --- test/Makefile.am | 4 +++- test/trap-crasher.c | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 test/trap-crasher.c diff --git a/test/Makefile.am b/test/Makefile.am index cccb6f8..1beac5b 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -4,11 +4,13 @@ INCLUDES = -I$(top_srcdir)/pixman -I$(top_builddir)/pixman TESTPROGRAMS = \ region-test \ scaling-test \ - fetch-test + fetch-test \ + trap-crasher fetch_test_LDADD = $(TEST_LDADD) region_test_LDADD = $(TEST_LDADD) scaling_test_LDADD = $(TEST_LDADD) +trap_crasher_LDADD = $(TEST_LDADD) # GTK using test programs diff --git a/test/trap-crasher.c b/test/trap-crasher.c new file mode 100644 index 0000000..42b82f6 --- /dev/null +++ b/test/trap-crasher.c @@ -0,0 +1,27 @@ +#include +#include + +int +main() +{ + pixman_image_t *dst; + pixman_trapezoid_t traps[1] = { + { + .top = 2147483646, + .bottom = 2147483647, + .left = { + .p1 = { .x = 0, .y = 0 }, + .p2 = { .x = 0, .y = 2147483647 } + }, + .right = { + .p1 = { .x = 65536, .y = 0 }, + .p2 = { .x = 0, .y = 2147483647 } + } + }, + }; + + dst = pixman_image_create_bits (PIXMAN_a8, 1, 1, NULL, -1); + + pixman_add_trapezoids (dst, 0, 0, sizeof (traps)/sizeof (traps[0]), traps); + return (0); +} -- 2.7.4