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



commit e7294ad6510e52c6f558ff92c630cf24842f0d0b
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 202cfe7..b664065 100644
--- a/tests/slice-concurrent.c
+++ b/tests/slice-concurrent.c
@@ -21,6 +21,8 @@
 #include <stdlib.h>
 #include <unistd.h>
 
+#include "valgrind.h"
+
 #define N_THREADS      8
 #define N_ALLOCS       50000
 #define MAX_BLOCK_SIZE  64
@@ -96,6 +98,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]