aboutsummaryrefslogtreecommitdiff
path: root/pixman/test/utils.h
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-09-21 19:02:11 +0000
committermarha <marha@users.sourceforge.net>2010-09-21 19:02:11 +0000
commit1c3f92a2ba37d5220032112f9d8925857b1fa71d (patch)
treeebf62974d469d204ce12aefc4e8026a7ebbf9e73 /pixman/test/utils.h
parent97aaa22fb796662afd3ad4052d4f7d1c5945bb70 (diff)
parenteeab52467b06a339cb5baee3071ef83bf3a48edb (diff)
downloadvcxsrv-1c3f92a2ba37d5220032112f9d8925857b1fa71d.tar.gz
vcxsrv-1c3f92a2ba37d5220032112f9d8925857b1fa71d.tar.bz2
vcxsrv-1c3f92a2ba37d5220032112f9d8925857b1fa71d.zip
svn merge ^/branches/released .
Diffstat (limited to 'pixman/test/utils.h')
-rw-r--r--pixman/test/utils.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/pixman/test/utils.h b/pixman/test/utils.h
index ab71452a4..e6122119a 100644
--- a/pixman/test/utils.h
+++ b/pixman/test/utils.h
@@ -51,10 +51,23 @@ compute_crc32 (uint32_t in_crc32,
void
image_endian_swap (pixman_image_t *img, int bpp);
-/* Generate n_bytes random bytes in malloced memory */
+/* Allocate memory that is bounded by protected pages,
+ * so that out-of-bounds access will cause segfaults
+ */
+void *
+fence_malloc (uint32_t len);
+
+void
+fence_free (void *data);
+
+/* Generate n_bytes random bytes in fence_malloced memory */
uint8_t *
make_random_bytes (int n_bytes);
+/* Return current time in seconds */
+double
+gettime (void);
+
/* main body of the fuzzer test */
int
fuzzer_test_main (const char *test_name,
@@ -101,3 +114,7 @@ fail_after (int seconds, const char *msg);
assert (frcd_canary_variable6 == frcd_volatile_constant6); \
assert (frcd_canary_variable7 == frcd_volatile_constant7); \
assert (frcd_canary_variable8 == frcd_volatile_constant8);
+
+/* Try to get an aligned memory chunk */
+void *
+aligned_malloc (size_t align, size_t size);