summaryrefslogtreecommitdiff
path: root/test/utils.h
diff options
context:
space:
mode:
authorSiarhei Siamashka <siarhei.siamashka@nokia.com>2010-05-11 22:46:47 +0300
committerSiarhei Siamashka <siarhei.siamashka@nokia.com>2010-05-13 21:02:27 +0300
commit30c3e91c3f97cf3d5932ba639d8ac126b83efb70 (patch)
tree16e51a85366105ad638ce474a2d49ce79169c45f /test/utils.h
parent164fe215f2c904cf74537caf9d76b7f9ce2667ec (diff)
test: main loop from blitters-test added as a new function to utils.c
This new generalized function can be reused in both blitters-test and scaling-test. Final checksum calculation changed in order to make it parallelizable (it is a sum of individual 32-bit values returned by a callback function, which is now responsible for running test-specific code). Return values may be crc32, some other hash or even just zero on success and non-zero on error (in this case, the expected result of the whole test run should be 0).
Diffstat (limited to 'test/utils.h')
-rw-r--r--test/utils.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/utils.h b/test/utils.h
index fb1ccec..161635f 100644
--- a/test/utils.h
+++ b/test/utils.h
@@ -43,3 +43,12 @@ image_endian_swap (pixman_image_t *img, int bpp);
/* Generate n_bytes random bytes in malloced memory */
uint8_t *
make_random_bytes (int n_bytes);
+
+/* main body of the fuzzer test */
+int
+fuzzer_test_main (const char *test_name,
+ int default_number_of_iterations,
+ uint32_t expected_checksum,
+ uint32_t (*test_function)(int testnum, int verbose),
+ int argc,
+ const char *argv[]);