aboutsummaryrefslogtreecommitdiff
path: root/pixman/test
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-06-12 08:30:03 +0200
committermarha <marha@users.sourceforge.net>2012-06-12 08:30:03 +0200
commit925b68a7b26823fdfa1cb25d3edc3545fc2175b1 (patch)
tree57c1e15fcc492bdc9b9cfd195e552c69aba845ce /pixman/test
parent567cbd4acc1e35ae40d99b24bb321d97632399db (diff)
downloadvcxsrv-925b68a7b26823fdfa1cb25d3edc3545fc2175b1.tar.gz
vcxsrv-925b68a7b26823fdfa1cb25d3edc3545fc2175b1.tar.bz2
vcxsrv-925b68a7b26823fdfa1cb25d3edc3545fc2175b1.zip
fontconfig mesa pixman git update 12 Juni 2012
Diffstat (limited to 'pixman/test')
-rw-r--r--pixman/test/composite.c3
-rw-r--r--pixman/test/fuzzer-find-diff.pl7
-rw-r--r--pixman/test/glyph-test.c10
-rw-r--r--pixman/test/stress-test.c15
4 files changed, 22 insertions, 13 deletions
diff --git a/pixman/test/composite.c b/pixman/test/composite.c
index 94b482551..bdecd75a7 100644
--- a/pixman/test/composite.c
+++ b/pixman/test/composite.c
@@ -739,7 +739,8 @@ main (int argc, char **argv)
{
#define N_TESTS (8 * 1024 * 1024)
int result = 0;
- uint32_t i, seed;
+ uint32_t seed;
+ int32_t i;
if (argc > 1)
{
diff --git a/pixman/test/fuzzer-find-diff.pl b/pixman/test/fuzzer-find-diff.pl
index 53d9b8de1..e1d67fbf7 100644
--- a/pixman/test/fuzzer-find-diff.pl
+++ b/pixman/test/fuzzer-find-diff.pl
@@ -29,10 +29,17 @@ sub test_range {
my $min = shift;
my $max = shift;
+ # check that [$min, $max] range is "bad", otherwise return
if (`$ARGV[0] $min $max 2>/dev/null` eq `$ARGV[1] $min $max 2>/dev/null`) {
return;
}
+ # check that $min itself is "good", otherwise return
+ if (`$ARGV[0] $min 2>/dev/null` ne `$ARGV[1] $min 2>/dev/null`) {
+ return $min;
+ }
+
+ # start bisecting
while ($max != $min + 1) {
my $avg = int(($min + $max) / 2);
my $res1 = `$ARGV[0] $min $avg 2>/dev/null`;
diff --git a/pixman/test/glyph-test.c b/pixman/test/glyph-test.c
index 9ff2a2bd4..0fb664191 100644
--- a/pixman/test/glyph-test.c
+++ b/pixman/test/glyph-test.c
@@ -150,9 +150,13 @@ create_image (int max_size, const pixman_format_code_t *formats, uint32_t flags)
}
else
{
+ uint8_t *d8;
+
data = malloc (stride * height);
- for (i = 0; i < height * stride / 4; ++i)
- data[i] = lcg_rand_u32();
+
+ d8 = (uint8_t *)data;
+ for (i = 0; i < height * stride; ++i)
+ d8[i] = lcg_rand_n (256);
destroy = destroy_malloced;
}
@@ -326,6 +330,6 @@ int
main (int argc, const char *argv[])
{
return fuzzer_test_main ("glyph", 30000,
- 0xA2B67F99,
+ 0x1B7696A2,
test_glyphs, argc, argv);
}
diff --git a/pixman/test/stress-test.c b/pixman/test/stress-test.c
index 3174621e6..0b48da3f7 100644
--- a/pixman/test/stress-test.c
+++ b/pixman/test/stress-test.c
@@ -797,10 +797,10 @@ main (int argc, char **argv)
{
int verbose = FALSE;
uint32_t seed = 1;
- uint32_t n_tests = 0xffffffff;
+ uint32_t n_tests = 8000;
uint32_t mod = 0;
pixman_bool_t use_threads = TRUE;
- uint32_t i;
+ int32_t i;
pixman_disable_out_of_bounds_workaround ();
@@ -847,9 +847,6 @@ main (int argc, char **argv)
}
}
- if (n_tests == 0xffffffff)
- n_tests = 8000;
-
if (getenv ("PIXMAN_RANDOMIZE_TESTS"))
{
seed = get_random_seed();
@@ -861,13 +858,13 @@ main (int argc, char **argv)
#ifdef USE_OPENMP
# pragma omp parallel for default(none) shared(verbose, n_tests, mod, seed)
#endif
- for (i = seed; i < seed + n_tests; ++i)
- run_test (i, verbose, mod);
+ for (i = 0; i < (int32_t)n_tests; ++i)
+ run_test (seed + i, verbose, mod);
}
else
{
- for (i = seed; i < seed + n_tests; ++i)
- run_test (i, verbose, mod);
+ for (i = 0; i < (int32_t)n_tests; ++i)
+ run_test (seed + i, verbose, mod);
}
return 0;