summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSiarhei Siamashka <siarhei.siamashka@nokia.com>2010-10-26 15:40:01 +0300
committerSiarhei Siamashka <siarhei.siamashka@nokia.com>2011-02-10 16:17:18 +0200
commit3b68c295fd45297a631569b35608364dbcb6d452 (patch)
treecf9b664a33eee11a331e5d47706ea72cc1cb7c6e /test
parent56f173f0af5a59a12596cf1ed9d6fb7c8ebe6318 (diff)
test: affine-test updated to stress 90/180/270 degrees rotation more
Diffstat (limited to 'test')
-rw-r--r--test/affine-test.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/test/affine-test.c b/test/affine-test.c
index f7f058a..b7a1fa6 100644
--- a/test/affine-test.c
+++ b/test/affine-test.c
@@ -112,10 +112,36 @@ test_composite (int testnum,
if (lcg_rand_n (4) > 0)
{
- int c = lcg_rand_N (2 * 65536) - 65536;
- int s = lcg_rand_N (2 * 65536) - 65536;
-
+ int c, s, tx = 0, ty = 0;
+ switch (lcg_rand_n (4))
+ {
+ case 0:
+ /* 90 degrees */
+ c = 0;
+ s = pixman_fixed_1;
+ tx = pixman_int_to_fixed (MAX_SRC_HEIGHT);
+ break;
+ case 1:
+ /* 180 degrees */
+ c = -pixman_fixed_1;
+ s = 0;
+ tx = pixman_int_to_fixed (MAX_SRC_WIDTH);
+ ty = pixman_int_to_fixed (MAX_SRC_HEIGHT);
+ break;
+ case 2:
+ /* 270 degrees */
+ c = 0;
+ s = -pixman_fixed_1;
+ ty = pixman_int_to_fixed (MAX_SRC_WIDTH);
+ break;
+ default:
+ /* arbitrary rotation */
+ c = lcg_rand_N (2 * 65536) - 65536;
+ s = lcg_rand_N (2 * 65536) - 65536;
+ break;
+ }
pixman_transform_rotate (&transform, NULL, c, s);
+ pixman_transform_translate (&transform, NULL, tx, ty);
}
pixman_image_set_transform (src_img, &transform);
@@ -256,6 +282,6 @@ main (int argc, const char *argv[])
{
pixman_disable_out_of_bounds_workaround ();
- return fuzzer_test_main ("affine", 8000000, 0x46EC3C6A,
+ return fuzzer_test_main ("affine", 8000000, 0x4B5D1852,
test_composite, argc, argv);
}