summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2015-10-12 17:30:17 +0200
committerBenjamin Otte <otte@redhat.com>2015-10-13 02:56:48 +0200
commit7ec2bd239421ac18d56194160f21aa3262bd2312 (patch)
tree84c84606601b549727e8d8c2bde36c728e312ecb
parent1d49b21bd423f276f2df42d11ab0d610fed5988b (diff)
downloadgdk-pixbuf-7ec2bd239421ac18d56194160f21aa3262bd2312.tar.gz
tests: Limit the number of bytes we modify per test to 100
It doesn't make sense to use file_size / 4 because once a file is broken, it's broken. Breaking it even more is not very useful.
-rw-r--r--tests/pixbuf-randomly-modified.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/pixbuf-randomly-modified.c b/tests/pixbuf-randomly-modified.c
index 93722fda2..9f482e45a 100644
--- a/tests/pixbuf-randomly-modified.c
+++ b/tests/pixbuf-randomly-modified.c
@@ -34,12 +34,14 @@
static void
randomly_modify (const gchar *image, guint size)
{
- int i;
+ int i, n;
guchar *img_copy = g_malloc (size);
g_memmove (img_copy, image, size);
- for (i = 0; i < size / 4; i++)
+ n = MIN (100, size / 4);
+
+ for (i = 0; i < n; i++)
{
FILE *f;
GdkPixbufLoader *loader;