[glib] Skip tests of incorrect property usage under gtester -m no-undefined



commit 254efaf85e0bb0748e97a3dbe68153831a96592f
Author: Simon McVittie <simon mcvittie collabora co uk>
Date:   Thu Jan 5 15:02:07 2012 +0000

    Skip tests of incorrect property usage under gtester -m no-undefined
    
    Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666116
    Signed-off-by: Simon McVittie <simon mcvittie collabora co uk>
    Reviewed-by: Colin Walters <walters verbum org>

 gobject/tests/param.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/gobject/tests/param.c b/gobject/tests/param.c
index 7e7721b..671642e 100644
--- a/gobject/tests/param.c
+++ b/gobject/tests/param.c
@@ -478,6 +478,9 @@ test_interface_default_init (TestInterfaceInterface *iface)
 
         if (perms[j] == NULL)
           {
+            if (!g_test_undefined ())
+              continue;
+
             /* we think that this is impossible.  make sure. */
             if (g_test_trap_fork (G_TIME_SPAN_SECOND, G_TEST_TRAP_SILENCE_STDERR))
               {
@@ -708,6 +711,16 @@ test_param_implement (void)
       for (use_this_flag = 0; use_this_flag < 16; use_this_flag++)
         for (use_this_type = 0; use_this_type < 4; use_this_type++)
           {
+            if (!g_test_undefined ())
+              {
+                /* only test the valid (defined) cases, e.g. under valgrind */
+                if (valid_impl_flags[change_this_flag][use_this_flag] != 'v')
+                  continue;
+
+                if (valid_impl_types[change_this_type * 16 + change_this_flag][use_this_type] != 'v')
+                  continue;
+              }
+
             if (g_test_trap_fork (G_TIME_SPAN_SECOND, G_TEST_TRAP_SILENCE_STDERR))
               {
                 g_type_class_ref (test_implementation_get_type ());



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