[glib] tests/option-context: fix under --verbose



commit 80253cd71007975946a084697ccec9891102a3e7
Author: Dan Winship <danw gnome org>
Date:   Sun Nov 25 11:42:59 2012 -0500

    tests/option-context: fix under --verbose
    
    We need to always pass G_TEST_TRAP_SILENCE_STDERR/STDOUT, or else
    we can't check that they contained the right text later.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=679683

 glib/tests/option-context.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/glib/tests/option-context.c b/glib/tests/option-context.c
index e58dbe5..fb2f2b2 100644
--- a/glib/tests/option-context.c
+++ b/glib/tests/option-context.c
@@ -124,19 +124,16 @@ test_group_captions (void)
 
       for (j = 0; j < G_N_ELEMENTS (test_name_base); ++j)
         {
-          GTestTrapFlags trap_flags = 0;
           gboolean expect_main_description = FALSE;
           gboolean expect_main_switch      = FALSE;
           gboolean expect_test_description = FALSE;
           gboolean expect_test_switch      = FALSE;
           gboolean expect_test_group       = FALSE;
 
-          if (!g_test_verbose ())
-            trap_flags |= G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR;
-
           test_name = g_strdup_printf ("/option/group/captions:%s-%d",
                                        test_name_base[j], i);
-          g_test_trap_subprocess (test_name, 0, trap_flags);
+          g_test_trap_subprocess (test_name, 0,
+                                  G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR);
           g_free (test_name);
           g_test_trap_assert_passed ();
           g_test_trap_assert_stderr ("");



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