aboutsummaryrefslogtreecommitdiff
path: root/pixman/test
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-08-24 19:36:08 +0000
committermarha <marha@users.sourceforge.net>2010-08-24 19:36:08 +0000
commitf1e55ffbe94408dc7aee8a9a5fbb45fdd72afe9b (patch)
tree8919acc34c9fd1fb0ecb508257d4586e91b97582 /pixman/test
parenta219a0434f082a1d1faca472c14ba8c8e6d0fbc7 (diff)
parentc5e0555ef58f02918a9803cb910e2cc523260d5d (diff)
downloadvcxsrv-f1e55ffbe94408dc7aee8a9a5fbb45fdd72afe9b.tar.gz
vcxsrv-f1e55ffbe94408dc7aee8a9a5fbb45fdd72afe9b.tar.bz2
vcxsrv-f1e55ffbe94408dc7aee8a9a5fbb45fdd72afe9b.zip
svn merge ^/branches/released .
Diffstat (limited to 'pixman/test')
-rw-r--r--pixman/test/Makefile.am2
-rw-r--r--pixman/test/region-translate-test.c30
2 files changed, 32 insertions, 0 deletions
diff --git a/pixman/test/Makefile.am b/pixman/test/Makefile.am
index d3e9d3fa0..108ae96ee 100644
--- a/pixman/test/Makefile.am
+++ b/pixman/test/Makefile.am
@@ -7,6 +7,7 @@ INCLUDES = -I$(top_srcdir)/pixman -I$(top_builddir)/pixman
TESTPROGRAMS = \
a1-trap-test \
region-test \
+ region-translate-test \
fetch-test \
oob-test \
window-test \
@@ -27,6 +28,7 @@ trap_crasher_LDADD = $(TEST_LDADD)
oob_test_LDADD = $(TEST_LDADD)
window_test_LDADD = $(TEST_LDADD)
scaling_crash_test_LDADD = $(TEST_LDADD)
+region_translate_test_LDADD = $(TEST_LDADD)
region_test_LDADD = $(TEST_LDADD)
region_test_SOURCES = region-test.c utils.c utils.h
diff --git a/pixman/test/region-translate-test.c b/pixman/test/region-translate-test.c
new file mode 100644
index 000000000..7c63df966
--- /dev/null
+++ b/pixman/test/region-translate-test.c
@@ -0,0 +1,30 @@
+#include <pixman.h>
+#include <assert.h>
+
+/* Pixman had a bug where 32bit regions where clipped to 16bit sizes when
+ * pixman_region32_translate() was called. This test exercises that bug.
+ */
+
+#define LARGE 32000
+
+int
+main (int argc, char **argv)
+{
+ pixman_box32_t rect = { -LARGE, -LARGE, LARGE, LARGE };
+ pixman_region32_t r1, r2;
+
+ pixman_region32_init_rects (&r1, &rect, 1);
+ pixman_region32_init_rect (&r2, rect.x1, rect.y1, rect.x2 - rect.x1, rect.y2 - rect.y1);
+
+ assert (pixman_region32_equal (&r1, &r2));
+
+ pixman_region32_translate (&r1, -LARGE, LARGE);
+ pixman_region32_translate (&r1, LARGE, -LARGE);
+
+ assert (pixman_region32_equal (&r1, &r2));
+
+ pixman_region32_fini (&r1);
+ pixman_region32_fini (&r2);
+
+ return 0;
+}