summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2012-06-11 19:13:45 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2012-06-11 19:19:23 -0400
commit619a60d201bfdfe2f15fca75f6e686fc7c275b5b (patch)
tree2268ff51829f0073be0dc3ac5ec066df8c0134b7 /test
parentf80e7ad3cbf46218bb3b4247e7b9e5d448670ad8 (diff)
test: Make glyph test pass on big endian
The destination buffer was initialized with random uint32_t values, so it started out different on big endian vs. little endian. Fix that by initializing the buffer with random uint8_t values instead.
Diffstat (limited to 'test')
-rw-r--r--test/glyph-test.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/glyph-test.c b/test/glyph-test.c
index 9ff2a2b..0fb6641 100644
--- a/test/glyph-test.c
+++ b/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);
}