[glib/wip/smcv/none-flags: 573/576] giomodule test: Don't pass a magic number to g_test_trap_subprocess()




commit 6d3131b95df36fcec02bfb8a8a3972f3711fb389
Author: Simon McVittie <smcv collabora com>
Date:   Thu Jun 23 10:09:15 2022 +0100

    giomodule test: Don't pass a magic number to g_test_trap_subprocess()
    
    This worked, but seems like bad style.
    
    Signed-off-by: Simon McVittie <smcv collabora com>

 gio/tests/giomodule.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gio/tests/giomodule.c b/gio/tests/giomodule.c
index b4923eeefd..4ea6efebd1 100644
--- a/gio/tests/giomodule.c
+++ b/gio/tests/giomodule.c
@@ -80,6 +80,10 @@ test_extension_point (void)
   g_assert (g_io_extension_get_priority (ext) == 10);
 }
 
+#define INHERIT_ALL (G_TEST_SUBPROCESS_INHERIT_STDIN | \
+                     G_TEST_SUBPROCESS_INHERIT_STDOUT | \
+                     G_TEST_SUBPROCESS_INHERIT_STDERR)
+
 static void
 test_module_scan_all (void)
 {
@@ -105,7 +109,7 @@ test_module_scan_all (void)
       g_assert_cmpstr (g_io_extension_get_name (ext), ==, "test-a");
       return;
     }
-  g_test_trap_subprocess (NULL, 0, 7);
+  g_test_trap_subprocess (NULL, 0, INHERIT_ALL);
   g_test_trap_assert_passed ();
 }
 
@@ -136,7 +140,7 @@ test_module_scan_all_with_scope (void)
       g_io_module_scope_free (scope);
       return;
     }
-  g_test_trap_subprocess (NULL, 0, 7);
+  g_test_trap_subprocess (NULL, 0, INHERIT_ALL);
   g_test_trap_assert_passed ();
 }
 


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