aboutsummaryrefslogtreecommitdiff
path: root/pixman/test/utils.h
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-09-21 18:40:53 +0000
committermarha <marha@users.sourceforge.net>2010-09-21 18:40:53 +0000
commiteeab52467b06a339cb5baee3071ef83bf3a48edb (patch)
tree9a1ab85abad405b87053fd9fc32c7d6ba676a385 /pixman/test/utils.h
parent874d43ba2be612fbe7bab82de6b35cd4c6d59958 (diff)
downloadvcxsrv-eeab52467b06a339cb5baee3071ef83bf3a48edb.tar.gz
vcxsrv-eeab52467b06a339cb5baee3071ef83bf3a48edb.tar.bz2
vcxsrv-eeab52467b06a339cb5baee3071ef83bf3a48edb.zip
pixman git update 21/9/2010
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);