aboutsummaryrefslogtreecommitdiff
path: root/pixman/test/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'pixman/test/utils.c')
-rw-r--r--pixman/test/utils.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/pixman/test/utils.c b/pixman/test/utils.c
index 1e42d89d8..58cd100e2 100644
--- a/pixman/test/utils.c
+++ b/pixman/test/utils.c
@@ -192,3 +192,17 @@ image_endian_swap (pixman_image_t *img, int bpp)
}
}
+uint8_t *
+make_random_bytes (int n_bytes)
+{
+ uint8_t *bytes = malloc (n_bytes);
+ int i;
+
+ if (!bytes)
+ return NULL;
+
+ for (i = 0; i < n_bytes; ++i)
+ bytes[i] = lcg_rand () & 0xff;
+
+ return bytes;
+}