[gdk-pixbuf] Further reduce pixbuf-randomly-modified test



commit fc240edcb482bc90f32ad8b89de9306ad8c7ea8a
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Sep 23 09:05:22 2013 -0400

    Further reduce pixbuf-randomly-modified test
    
    In order to not have distcheck DOS my machine, reduce the number
    of iterations to 1, and limit the amount of memory the test is
    allowed to consume.

 tests/pixbuf-randomly-modified.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/tests/pixbuf-randomly-modified.c b/tests/pixbuf-randomly-modified.c
index 7aed961..2aa06ce 100644
--- a/tests/pixbuf-randomly-modified.c
+++ b/tests/pixbuf-randomly-modified.c
@@ -25,6 +25,8 @@
 #include <stdlib.h>
 #include <time.h>
 #include <string.h>
+#include <sys/time.h>
+#include <sys/resource.h>
 
 static void
 disaster (const char *what)
@@ -102,13 +104,19 @@ main (int argc, char **argv)
   gboolean got_seed = FALSE;
   GPtrArray *files = g_ptr_array_new ();
   int l, iterations;
+  struct rlimit max_mem_size;
+
+  max_mem_size.rlim_cur = 100 * 1024 * 1024; /* 100M */
+  max_mem_size.rlim_max = max_mem_size.rlim_cur;
+  setrlimit (RLIMIT_DATA, &max_mem_size);
+  setrlimit (RLIMIT_AS, &max_mem_size);
 
   g_test_init (&argc, &argv, NULL);
 
   if (g_getenv ("ITERATIONS"))
     iterations = atoi (g_getenv ("ITERATIONS"));
   else
-    iterations = 10;
+    iterations = 1;
 
   seed = time (NULL);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]