[glib/wip/gcleanup: 22/71] slice: Don't run GSlice tests under valgrind



commit 26d7b74e51444ae54bdb16c97ebfaabe884d5ee7
Author: Stef Walter <stefw gnome org>
Date:   Sat Nov 9 20:27:37 2013 +0100

    slice: Don't run GSlice tests under valgrind
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711744

 tests/slice-concurrent.c |    6 ++++++
 tests/slice-threadinit.c |    6 ++++++
 2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/tests/slice-concurrent.c b/tests/slice-concurrent.c
index 8f8de37..ec07789 100644
--- a/tests/slice-concurrent.c
+++ b/tests/slice-concurrent.c
@@ -23,6 +23,8 @@
 #include <unistd.h>
 #endif
 
+#include "valgrind.h"
+
 #define N_THREADS      8
 #define N_ALLOCS       50000
 #define MAX_BLOCK_SIZE  64
@@ -98,6 +100,10 @@ main (void)
 {
   int t;
 
+  /* Don't bother testing gslice under valgrind */
+  if (RUNNING_ON_VALGRIND)
+    return 0;
+
   for (t = 0; t < N_THREADS; t++)
     {
       tdata[t].thread_id = t + 1;
diff --git a/tests/slice-threadinit.c b/tests/slice-threadinit.c
index f29dcbe..04baed5 100644
--- a/tests/slice-threadinit.c
+++ b/tests/slice-threadinit.c
@@ -20,6 +20,8 @@
  */
 #include <glib.h>
 
+#include "valgrind.h"
+
 #define N_PAGES                 (101)                   /* number of pages to sample */
 #define SAMPLE_SIZE             (7)
 #define PAGE_SIZE               (128)                   /* must be <= minimum GSlice alignment block */
@@ -73,6 +75,10 @@ main (int   argc,
   int j, n_pages = 0;
   void *mps[N_MAGAZINE_PROBES];
 
+  /* Don't bother testing gslice under valgrind */
+  if (RUNNING_ON_VALGRIND)
+    return 0;
+
   /* probe some magazine sizes */
   for (j = 0; j < N_MAGAZINE_PROBES; j++)
     mps[j] = g_slice_alloc (magazine_probes[j]);


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