aboutsummaryrefslogtreecommitdiff
path: root/pixman/test/composite-traps-test.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-12-10 08:33:13 +0100
committermarha <marha@users.sourceforge.net>2012-12-10 08:33:13 +0100
commit0328076efb5ff6e62152c09e38d0d11f7931d07b (patch)
treece71cf0fe95186671dc75862c2ced47f4735214f /pixman/test/composite-traps-test.c
parente82692e521240c5f8592f9ce56c9d5b3d68870ec (diff)
downloadvcxsrv-0328076efb5ff6e62152c09e38d0d11f7931d07b.tar.gz
vcxsrv-0328076efb5ff6e62152c09e38d0d11f7931d07b.tar.bz2
vcxsrv-0328076efb5ff6e62152c09e38d0d11f7931d07b.zip
fontconfig libX11 mesa pixman git update 10 dec 2012
libX11 9833489e6c3829a1e835bc0a11f028fc180809e4 mesa 17f5dc57306b8f5079304701e455bf4b927d3cae pixman 8ca4e144724ba2041bc5ef077ccf6d24e7cf4d1f fontconfig 608c5b590bd3428dfcd30f3d68ee8b7131e2f019
Diffstat (limited to 'pixman/test/composite-traps-test.c')
-rw-r--r--pixman/test/composite-traps-test.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/pixman/test/composite-traps-test.c b/pixman/test/composite-traps-test.c
index 9fc94a4d6..2983eae83 100644
--- a/pixman/test/composite-traps-test.c
+++ b/pixman/test/composite-traps-test.c
@@ -26,7 +26,7 @@ static pixman_op_t operators[] =
};
#define RANDOM_ELT(array) \
- ((array)[lcg_rand_n(ARRAY_LENGTH((array)))])
+ ((array)[prng_rand_n(ARRAY_LENGTH((array)))])
static void
destroy_bits (pixman_image_t *image, void *data)
@@ -37,7 +37,7 @@ destroy_bits (pixman_image_t *image, void *data)
static pixman_fixed_t
random_fixed (int n)
{
- return lcg_rand_N (n << 16);
+ return prng_rand_n (n << 16);
}
/*
@@ -75,17 +75,17 @@ test_composite (int testnum,
FLOAT_REGS_CORRUPTION_DETECTOR_START ();
- lcg_srand (testnum);
+ prng_srand (testnum);
op = RANDOM_ELT (operators);
mask_format = RANDOM_ELT (mask_formats);
/* Create source image */
- if (lcg_rand_n (4) == 0)
+ if (prng_rand_n (4) == 0)
{
src_img = pixman_image_create_solid_fill (
- &(colors[lcg_rand_n (ARRAY_LENGTH (colors))]));
+ &(colors[prng_rand_n (ARRAY_LENGTH (colors))]));
src_x = 10;
src_y = 234;
@@ -94,13 +94,13 @@ test_composite (int testnum,
{
pixman_format_code_t src_format = RANDOM_ELT(formats);
int src_bpp = (PIXMAN_FORMAT_BPP (src_format) + 7) / 8;
- int src_width = lcg_rand_n (MAX_SRC_WIDTH) + 1;
- int src_height = lcg_rand_n (MAX_SRC_HEIGHT) + 1;
- int src_stride = src_width * src_bpp + lcg_rand_n (MAX_STRIDE) * src_bpp;
+ int src_width = prng_rand_n (MAX_SRC_WIDTH) + 1;
+ int src_height = prng_rand_n (MAX_SRC_HEIGHT) + 1;
+ int src_stride = src_width * src_bpp + prng_rand_n (MAX_STRIDE) * src_bpp;
uint32_t *bits;
- src_x = -(src_width / 4) + lcg_rand_n (src_width * 3 / 2);
- src_y = -(src_height / 4) + lcg_rand_n (src_height * 3 / 2);
+ src_x = -(src_width / 4) + prng_rand_n (src_width * 3 / 2);
+ src_y = -(src_height / 4) + prng_rand_n (src_height * 3 / 2);
src_stride = (src_stride + 3) & ~3;
@@ -111,19 +111,19 @@ test_composite (int testnum,
pixman_image_set_destroy_function (src_img, destroy_bits, bits);
- if (lcg_rand_n (8) == 0)
+ if (prng_rand_n (8) == 0)
{
pixman_box16_t clip_boxes[2];
- int n = lcg_rand_n (2) + 1;
+ int n = prng_rand_n (2) + 1;
for (i = 0; i < n; i++)
{
- clip_boxes[i].x1 = lcg_rand_n (src_width);
- clip_boxes[i].y1 = lcg_rand_n (src_height);
+ clip_boxes[i].x1 = prng_rand_n (src_width);
+ clip_boxes[i].y1 = prng_rand_n (src_height);
clip_boxes[i].x2 =
- clip_boxes[i].x1 + lcg_rand_n (src_width - clip_boxes[i].x1);
+ clip_boxes[i].x1 + prng_rand_n (src_width - clip_boxes[i].x1);
clip_boxes[i].y2 =
- clip_boxes[i].y1 + lcg_rand_n (src_height - clip_boxes[i].y1);
+ clip_boxes[i].y1 + prng_rand_n (src_height - clip_boxes[i].y1);
if (verbose)
{
@@ -146,15 +146,15 @@ test_composite (int testnum,
{
dst_format = RANDOM_ELT(formats);
dst_bpp = (PIXMAN_FORMAT_BPP (dst_format) + 7) / 8;
- dst_width = lcg_rand_n (MAX_DST_WIDTH) + 1;
- dst_height = lcg_rand_n (MAX_DST_HEIGHT) + 1;
- dst_stride = dst_width * dst_bpp + lcg_rand_n (MAX_STRIDE) * dst_bpp;
+ dst_width = prng_rand_n (MAX_DST_WIDTH) + 1;
+ dst_height = prng_rand_n (MAX_DST_HEIGHT) + 1;
+ dst_stride = dst_width * dst_bpp + prng_rand_n (MAX_STRIDE) * dst_bpp;
dst_stride = (dst_stride + 3) & ~3;
dst_bits = (uint32_t *)make_random_bytes (dst_stride * dst_height);
- dst_x = -(dst_width / 4) + lcg_rand_n (dst_width * 3 / 2);
- dst_y = -(dst_height / 4) + lcg_rand_n (dst_height * 3 / 2);
+ dst_x = -(dst_width / 4) + prng_rand_n (dst_width * 3 / 2);
+ dst_y = -(dst_height / 4) + prng_rand_n (dst_height * 3 / 2);
dst_img = pixman_image_create_bits (
dst_format, dst_width, dst_height, dst_bits, dst_stride);
@@ -166,7 +166,7 @@ test_composite (int testnum,
{
int i;
- n_traps = lcg_rand_n (25);
+ n_traps = prng_rand_n (25);
traps = fence_malloc (n_traps * sizeof (pixman_trapezoid_t));
for (i = 0; i < n_traps; ++i)
@@ -186,18 +186,18 @@ test_composite (int testnum,
}
}
- if (lcg_rand_n (8) == 0)
+ if (prng_rand_n (8) == 0)
{
pixman_box16_t clip_boxes[2];
- int n = lcg_rand_n (2) + 1;
+ int n = prng_rand_n (2) + 1;
for (i = 0; i < n; i++)
{
- clip_boxes[i].x1 = lcg_rand_n (dst_width);
- clip_boxes[i].y1 = lcg_rand_n (dst_height);
+ clip_boxes[i].x1 = prng_rand_n (dst_width);
+ clip_boxes[i].y1 = prng_rand_n (dst_height);
clip_boxes[i].x2 =
- clip_boxes[i].x1 + lcg_rand_n (dst_width - clip_boxes[i].x1);
+ clip_boxes[i].x1 + prng_rand_n (dst_width - clip_boxes[i].x1);
clip_boxes[i].y2 =
- clip_boxes[i].y1 + lcg_rand_n (dst_height - clip_boxes[i].y1);
+ clip_boxes[i].y1 + prng_rand_n (dst_height - clip_boxes[i].y1);
if (verbose)
{
@@ -251,6 +251,6 @@ test_composite (int testnum,
int
main (int argc, const char *argv[])
{
- return fuzzer_test_main("composite traps", 40000, 0x33BFAA55,
+ return fuzzer_test_main("composite traps", 40000, 0x749BCC57,
test_composite, argc, argv);
}