[glib/wip/smcv/none-flags: 4/8] gtestutils: Add G_TEST_SUBPROCESS_DEFAULT, G_TEST_TRAP_DEFAULT
- From: Simon McVittie <smcv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/smcv/none-flags: 4/8] gtestutils: Add G_TEST_SUBPROCESS_DEFAULT, G_TEST_TRAP_DEFAULT
- Date: Thu, 23 Jun 2022 09:50:13 +0000 (UTC)
commit de8672fe0b9f55047fbaee6f425e330cdfc8189f
Author: Simon McVittie <smcv collabora com>
Date: Thu Mar 31 14:30:43 2022 +0100
gtestutils: Add G_TEST_SUBPROCESS_DEFAULT, G_TEST_TRAP_DEFAULT
This makes calls to test subprocesses with default behaviour more
self-documenting.
Signed-off-by: Simon McVittie <smcv collabora com>
gio/tests/gapplication.c | 2 +-
gio/tests/gdbus-address-get-session.c | 6 +-
gio/tests/gdbus-non-socket.c | 2 +-
gio/tests/gdbus-peer.c | 10 ++--
gio/tests/glistmodel.c | 2 +-
gio/tests/gschema-compile.c | 2 +-
gio/tests/gsettings.c | 55 +++++++++++-------
gio/tests/task.c | 8 +--
gio/tests/tls-bindings.c | 4 +-
gio/tests/win32-appinfo.c | 6 +-
glib/gtestutils.c | 3 +-
glib/gtestutils.h | 3 +
glib/tests/array-test.c | 4 +-
glib/tests/convert.c | 24 +++++---
glib/tests/dataset.c | 2 +-
glib/tests/error.c | 2 +-
glib/tests/gvariant.c | 2 +-
glib/tests/hash.c | 3 +-
glib/tests/list.c | 2 +-
glib/tests/logging.c | 55 ++++++++++--------
glib/tests/mem-overflow.c | 9 ++-
glib/tests/refcount.c | 4 +-
glib/tests/scannerapi.c | 2 +-
glib/tests/slice.c | 4 +-
glib/tests/spawn-singlethread.c | 2 +-
glib/tests/test-printf.c | 10 ++--
glib/tests/testing.c | 102 ++++++++++++++++++++++------------
glib/tests/thread-pool.c | 2 +-
glib/tests/utils.c | 9 +--
glib/tests/win32.c | 9 ++-
gobject/tests/param.c | 5 +-
gobject/tests/properties.c | 4 +-
gobject/tests/signals.c | 4 +-
gobject/tests/testing.c | 3 +-
34 files changed, 223 insertions(+), 143 deletions(-)
---
diff --git a/gio/tests/gapplication.c b/gio/tests/gapplication.c
index 6f1a27e0f3..b017e437ff 100644
--- a/gio/tests/gapplication.c
+++ b/gio/tests/gapplication.c
@@ -827,7 +827,7 @@ test_help (void)
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stdout ("*Application options*");
}
diff --git a/gio/tests/gdbus-address-get-session.c b/gio/tests/gdbus-address-get-session.c
index fd43242358..858a66ae56 100644
--- a/gio/tests/gdbus-address-get-session.c
+++ b/gio/tests/gdbus-address-get-session.c
@@ -144,7 +144,7 @@ test_x11_autolaunch (void)
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_stderr_unmatched ("?*");
g_test_trap_assert_stdout ("hello:this=address-is-from-the,mock=dbus-launch\n");
g_test_trap_assert_passed ();
@@ -167,7 +167,7 @@ test_xdg_runtime (void)
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_stderr_unmatched ("?*");
g_test_trap_assert_stdout ("unix:path=/tmp/gdbus%2Cunix%2Ctest.*/bus\n");
g_test_trap_assert_passed ();
@@ -203,7 +203,7 @@ test_win32_autolaunch (void)
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
/* stderr is not checked: coverage prints warnings there */
g_test_trap_assert_stdout ("nonce-tcp:host=localhost,port=*,noncefile=*\\gdbus-nonce-file-*\n");
g_test_trap_assert_passed ();
diff --git a/gio/tests/gdbus-non-socket.c b/gio/tests/gdbus-non-socket.c
index a07808502b..598c37ecb1 100644
--- a/gio/tests/gdbus-non-socket.c
+++ b/gio/tests/gdbus-non-socket.c
@@ -222,7 +222,7 @@ test_non_socket (void)
/* This is #ifdef G_OS_UNIX anyway, so just use g_test_trap_fork() */
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
- if (!g_test_trap_fork (0, 0))
+ if (!g_test_trap_fork (0, G_TEST_TRAP_DEFAULT))
{
/* parent */
g_object_unref (streams[0]);
diff --git a/gio/tests/gdbus-peer.c b/gio/tests/gdbus-peer.c
index 68ee0647f4..7179d089df 100644
--- a/gio/tests/gdbus-peer.c
+++ b/gio/tests/gdbus-peer.c
@@ -1202,7 +1202,7 @@ test_peer_invalid_server (void)
}
else
{
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*CRITICAL*G_DBUS_SERVER_FLAGS_ALL*");
}
@@ -1249,7 +1249,7 @@ test_peer_invalid_conn_stream_sync (void)
}
else
{
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*CRITICAL*G_DBUS_CONNECTION_FLAGS_ALL*");
}
@@ -1295,7 +1295,7 @@ test_peer_invalid_conn_stream_async (void)
}
else
{
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*CRITICAL*G_DBUS_CONNECTION_FLAGS_ALL*");
}
@@ -1324,7 +1324,7 @@ test_peer_invalid_conn_addr_sync (void)
}
else
{
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*CRITICAL*G_DBUS_CONNECTION_FLAGS_ALL*");
}
@@ -1347,7 +1347,7 @@ test_peer_invalid_conn_addr_async (void)
}
else
{
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*CRITICAL*G_DBUS_CONNECTION_FLAGS_ALL*");
}
diff --git a/gio/tests/glistmodel.c b/gio/tests/glistmodel.c
index f771df81f6..ee61d1d501 100644
--- a/gio/tests/glistmodel.c
+++ b/gio/tests/glistmodel.c
@@ -71,7 +71,7 @@ test_store_non_gobjects (void)
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*WARNING*value * of type 'GType' is invalid or "
"out of range for property 'item-type'*");
diff --git a/gio/tests/gschema-compile.c b/gio/tests/gschema-compile.c
index 8dc4985b8f..6a51e424eb 100644
--- a/gio/tests/gschema-compile.c
+++ b/gio/tests/gschema-compile.c
@@ -38,7 +38,7 @@ test_schema (gpointer data)
gchar *child_name;
child_name = g_strdup_printf ("/gschema/%s%s/subprocess/do_compile", test->name, test->opt ? "/opt" : "");
- g_test_trap_subprocess (child_name, 0, 0);
+ g_test_trap_subprocess (child_name, 0, G_TEST_SUBPROCESS_DEFAULT);
g_free (child_name);
if (test->err)
diff --git a/gio/tests/gsettings.c b/gio/tests/gsettings.c
index 35d958e4db..1956ac5e64 100644
--- a/gio/tests/gsettings.c
+++ b/gio/tests/gsettings.c
@@ -147,7 +147,7 @@ test_unknown_key (void)
g_object_unref (settings);
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*does not contain*");
}
@@ -170,7 +170,7 @@ test_no_schema (void)
g_assert_null (settings);
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*Settings schema 'no.such.schema' is not installed*");
}
@@ -220,7 +220,7 @@ test_wrong_path (void)
settings = g_settings_new_with_path ("org.gtk.test", "/wrong-path/");
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*but path * specified by schema*");
}
@@ -238,7 +238,7 @@ test_no_path (void)
settings = g_settings_new ("org.gtk.test.no-path");
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*attempting to create schema * without a path**");
}
@@ -1507,7 +1507,7 @@ test_typesafe_binding (void)
g_object_unref (settings);
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*not compatible*");
}
@@ -1665,12 +1665,14 @@ test_no_read_binding (void)
{
if (g_test_undefined ())
{
- g_test_trap_subprocess ("/gsettings/no-read-binding/subprocess/fail", 0, 0);
+ g_test_trap_subprocess ("/gsettings/no-read-binding/subprocess/fail", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*property*is not readable*");
}
- g_test_trap_subprocess ("/gsettings/no-read-binding/subprocess/pass", 0, 0);
+ g_test_trap_subprocess ("/gsettings/no-read-binding/subprocess/pass", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
}
@@ -1708,12 +1710,14 @@ test_no_write_binding (void)
{
if (g_test_undefined ())
{
- g_test_trap_subprocess ("/gsettings/no-write-binding/subprocess/fail", 0, 0);
+ g_test_trap_subprocess ("/gsettings/no-write-binding/subprocess/fail", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*property*is not writable*");
}
- g_test_trap_subprocess ("/gsettings/no-write-binding/subprocess/pass", 0, 0);
+ g_test_trap_subprocess ("/gsettings/no-write-binding/subprocess/pass", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
}
@@ -2141,19 +2145,23 @@ test_enums (void)
if (g_test_undefined () && !backend_set)
{
- g_test_trap_subprocess ("/gsettings/enums/subprocess/non-enum-key", 0, 0);
+ g_test_trap_subprocess ("/gsettings/enums/subprocess/non-enum-key", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*not associated with an enum*");
- g_test_trap_subprocess ("/gsettings/enums/subprocess/non-enum-value", 0, 0);
+ g_test_trap_subprocess ("/gsettings/enums/subprocess/non-enum-value", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*invalid enum value 42*");
- g_test_trap_subprocess ("/gsettings/enums/subprocess/range", 0, 0);
+ g_test_trap_subprocess ("/gsettings/enums/subprocess/range", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*g_settings_set_value*valid range*");
- g_test_trap_subprocess ("/gsettings/enums/subprocess/non-flags", 0, 0);
+ g_test_trap_subprocess ("/gsettings/enums/subprocess/non-flags", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*not associated with a flags*");
}
@@ -2239,19 +2247,23 @@ test_flags (void)
if (g_test_undefined () && !backend_set)
{
- g_test_trap_subprocess ("/gsettings/flags/subprocess/non-flags-key", 0, 0);
+ g_test_trap_subprocess ("/gsettings/flags/subprocess/non-flags-key", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*not associated with a flags*");
- g_test_trap_subprocess ("/gsettings/flags/subprocess/non-flags-value", 0, 0);
+ g_test_trap_subprocess ("/gsettings/flags/subprocess/non-flags-value", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*invalid flags value 0x00000042*");
- g_test_trap_subprocess ("/gsettings/flags/subprocess/range", 0, 0);
+ g_test_trap_subprocess ("/gsettings/flags/subprocess/range", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*g_settings_set_value*valid range*");
- g_test_trap_subprocess ("/gsettings/flags/subprocess/non-enum", 0, 0);
+ g_test_trap_subprocess ("/gsettings/flags/subprocess/non-enum", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*not associated with an enum*");
}
@@ -2328,11 +2340,13 @@ test_range (void)
if (g_test_undefined () && !backend_set)
{
- g_test_trap_subprocess ("/gsettings/range/subprocess/high", 0, 0);
+ g_test_trap_subprocess ("/gsettings/range/subprocess/high", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*g_settings_set_value*valid range*");
- g_test_trap_subprocess ("/gsettings/range/subprocess/low", 0, 0);
+ g_test_trap_subprocess ("/gsettings/range/subprocess/low", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*g_settings_set_value*valid range*");
}
@@ -2881,7 +2895,8 @@ test_per_desktop (void)
if (!g_test_subprocess ())
{
- g_test_trap_subprocess ("/gsettings/per-desktop/subprocess", 0, 0);
+ g_test_trap_subprocess ("/gsettings/per-desktop/subprocess", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
}
diff --git a/gio/tests/task.c b/gio/tests/task.c
index bf24490cdf..10ff6f8b17 100644
--- a/gio/tests/task.c
+++ b/gio/tests/task.c
@@ -2305,7 +2305,7 @@ test_return_in_idle_error_first (void)
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*CRITICAL*assertion '!task->ever_returned' failed*");
}
@@ -2321,7 +2321,7 @@ test_return_in_idle_value_first (void)
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*CRITICAL*assertion '!task->ever_returned' failed*");
}
@@ -2337,7 +2337,7 @@ test_return_error_first (void)
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*CRITICAL*assertion '!task->ever_returned' failed*");
}
@@ -2353,7 +2353,7 @@ test_return_value_first (void)
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*CRITICAL*assertion '!task->ever_returned' failed*");
}
diff --git a/gio/tests/tls-bindings.c b/gio/tests/tls-bindings.c
index 681b658c7c..81b31896fc 100644
--- a/gio/tests/tls-bindings.c
+++ b/gio/tests/tls-bindings.c
@@ -40,7 +40,7 @@ get_tls_channel_binding (void)
G_TLS_CHANNEL_BINDING_TLS_UNIQUE, NULL, (GError **)¬_null));
g_object_unref (tls);
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*GLib-GIO-CRITICAL*");
}
@@ -75,7 +75,7 @@ get_dtls_channel_binding (void)
G_TLS_CHANNEL_BINDING_TLS_UNIQUE, NULL, (GError **)¬_null));
g_object_unref (dtls);
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*GLib-GIO-CRITICAL*");
}
diff --git a/gio/tests/win32-appinfo.c b/gio/tests/win32-appinfo.c
index fa8aa2aafb..8402a202e4 100644
--- a/gio/tests/win32-appinfo.c
+++ b/gio/tests/win32-appinfo.c
@@ -442,10 +442,12 @@ do_fail_on_broken_utf16_2 (void)
static void
test_fail_on_broken_utf16 (void)
{
- g_test_trap_subprocess ("/appinfo/subprocess/win32-assert-broken-utf16_1", 0, 0);
+ g_test_trap_subprocess ("/appinfo/subprocess/win32-assert-broken-utf16_1", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*GLib-GIO:ERROR:*giowin32-private.c:*:_g_win32_extract_executable: assertion
failed: (folded)*");
- g_test_trap_subprocess ("/appinfo/subprocess/win32-assert-broken-utf16_2", 0, 0);
+ g_test_trap_subprocess ("/appinfo/subprocess/win32-assert-broken-utf16_2", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*GLib-GIO:ERROR:*giowin32-private.c:*:_g_win32_extract_executable: assertion
failed: (folded)*");
}
diff --git a/glib/gtestutils.c b/glib/gtestutils.c
index 09c70d484c..de70e921ad 100644
--- a/glib/gtestutils.c
+++ b/glib/gtestutils.c
@@ -357,6 +357,7 @@
/**
* GTestSubprocessFlags:
+ * @G_TEST_SUBPROCESS_DEFAULT: Default behaviour. Since: 2.74
* @G_TEST_SUBPROCESS_INHERIT_STDIN: If this flag is given, the child
* process will inherit the parent's stdin. Otherwise, the child's
* stdin is redirected to `/dev/null`.
@@ -3782,7 +3783,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
* }
*
* // Reruns this same test in a subprocess
- * g_test_trap_subprocess (NULL, 0, 0);
+ * g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
* g_test_trap_assert_failed ();
* g_test_trap_assert_stderr ("*ERROR*too large*");
* }
diff --git a/glib/gtestutils.h b/glib/gtestutils.h
index 3369f5fc6e..4e38eb4146 100644
--- a/glib/gtestutils.h
+++ b/glib/gtestutils.h
@@ -426,6 +426,7 @@ void g_test_queue_destroy (GDestroyNotify destroy_func,
/**
* GTestTrapFlags:
+ * @G_TEST_TRAP_DEFAULT: Default behaviour. Since: 2.74
* @G_TEST_TRAP_SILENCE_STDOUT: Redirect stdout of the test child to
* `/dev/null` so it cannot be observed on the console during test
* runs. The actual output is still captured though to allow later
@@ -446,6 +447,7 @@ void g_test_queue_destroy (GDestroyNotify destroy_func,
* #GTestSubprocessFlags.
*/
typedef enum {
+ G_TEST_TRAP_DEFAULT GLIB_AVAILABLE_ENUMERATOR_IN_2_74 = 0,
G_TEST_TRAP_SILENCE_STDOUT = 1 << 7,
G_TEST_TRAP_SILENCE_STDERR = 1 << 8,
G_TEST_TRAP_INHERIT_STDIN = 1 << 9
@@ -460,6 +462,7 @@ gboolean g_test_trap_fork (guint64 usec_timeout,
G_GNUC_END_IGNORE_DEPRECATIONS
typedef enum {
+ G_TEST_SUBPROCESS_DEFAULT GLIB_AVAILABLE_ENUMERATOR_IN_2_74 = 0,
G_TEST_SUBPROCESS_INHERIT_STDIN = 1 << 0,
G_TEST_SUBPROCESS_INHERIT_STDOUT = 1 << 1,
G_TEST_SUBPROCESS_INHERIT_STDERR = 1 << 2
diff --git a/glib/tests/array-test.c b/glib/tests/array-test.c
index 9395607eff..cd617200a7 100644
--- a/glib/tests/array-test.c
+++ b/glib/tests/array-test.c
@@ -861,7 +861,7 @@ array_overflow_append_vals (void)
}
else
{
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*adding 4294967295 to array would overflow*");
}
@@ -880,7 +880,7 @@ array_overflow_set_size (void)
}
else
{
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*adding 4294967295 to array would overflow*");
}
diff --git a/glib/tests/convert.c b/glib/tests/convert.c
index 9a1a25ab78..6daeec2372 100644
--- a/glib/tests/convert.c
+++ b/glib/tests/convert.c
@@ -709,9 +709,11 @@ test_convert_embedded_nul (void)
static void
test_locale_to_utf8_embedded_nul (void)
{
- g_test_trap_subprocess ("/conversion/locale-to-utf8/embedded-nul/subprocess/utf8", 0, 0);
+ g_test_trap_subprocess ("/conversion/locale-to-utf8/embedded-nul/subprocess/utf8",
+ 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
- g_test_trap_subprocess ("/conversion/locale-to-utf8/embedded-nul/subprocess/iconv", 0, 0);
+ g_test_trap_subprocess ("/conversion/locale-to-utf8/embedded-nul/subprocess/iconv",
+ 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
}
@@ -760,9 +762,11 @@ test_locale_to_utf8_embedded_nul_iconv (void)
static void
test_locale_from_utf8_embedded_nul (void)
{
- g_test_trap_subprocess ("/conversion/locale-from-utf8/embedded-nul/subprocess/utf8", 0, 0);
+ g_test_trap_subprocess ("/conversion/locale-from-utf8/embedded-nul/subprocess/utf8",
+ 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
- g_test_trap_subprocess ("/conversion/locale-from-utf8/embedded-nul/subprocess/iconv", 0, 0);
+ g_test_trap_subprocess ("/conversion/locale-from-utf8/embedded-nul/subprocess/iconv",
+ 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
}
@@ -813,9 +817,11 @@ test_locale_from_utf8_embedded_nul_iconv (void)
static void
test_filename_to_utf8_embedded_nul (void)
{
- g_test_trap_subprocess ("/conversion/filename-to-utf8/embedded-nul/subprocess/utf8", 0, 0);
+ g_test_trap_subprocess ("/conversion/filename-to-utf8/embedded-nul/subprocess/utf8",
+ 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
- g_test_trap_subprocess ("/conversion/filename-to-utf8/embedded-nul/subprocess/iconv", 0, 0);
+ g_test_trap_subprocess ("/conversion/filename-to-utf8/embedded-nul/subprocess/iconv",
+ 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
}
@@ -870,9 +876,11 @@ test_filename_to_utf8_embedded_nul_iconv (void)
static void
test_filename_from_utf8_embedded_nul (void)
{
- g_test_trap_subprocess ("/conversion/filename-from-utf8/embedded-nul/subprocess/utf8", 0, 0);
+ g_test_trap_subprocess ("/conversion/filename-from-utf8/embedded-nul/subprocess/utf8",
+ 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
- g_test_trap_subprocess ("/conversion/filename-from-utf8/embedded-nul/subprocess/iconv", 0, 0);
+ g_test_trap_subprocess ("/conversion/filename-from-utf8/embedded-nul/subprocess/iconv",
+ 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
}
diff --git a/glib/tests/dataset.c b/glib/tests/dataset.c
index b02b3e42bd..3b96b42a78 100644
--- a/glib/tests/dataset.c
+++ b/glib/tests/dataset.c
@@ -202,7 +202,7 @@ test_datalist_clear (void)
return;
}
- g_test_trap_subprocess (NULL, 500000, 0);
+ g_test_trap_subprocess (NULL, 500000, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
}
diff --git a/glib/tests/error.c b/glib/tests/error.c
index 51a0c35dc4..7ea04ea3ce 100644
--- a/glib/tests/error.c
+++ b/glib/tests/error.c
@@ -336,7 +336,7 @@ test_extended_duplicate (void)
if (!g_test_subprocess ())
{
/* Spawn a subprocess and expect it to fail. */
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*CRITICAL*Attempted to register an extended error domain for TestError
more than once*");
}
diff --git a/glib/tests/gvariant.c b/glib/tests/gvariant.c
index 470688c15e..918f13ebd0 100644
--- a/glib/tests/gvariant.c
+++ b/glib/tests/gvariant.c
@@ -2936,7 +2936,7 @@ static void
do_failed_test (const char *test,
const gchar *pattern)
{
- g_test_trap_subprocess (test, 1000000, 0);
+ g_test_trap_subprocess (test, 1000000, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr (pattern);
}
diff --git a/glib/tests/hash.c b/glib/tests/hash.c
index 5bb6ff3bd3..32d3579796 100644
--- a/glib/tests/hash.c
+++ b/glib/tests/hash.c
@@ -875,7 +875,8 @@ test_recursive_remove_all_subprocess (void)
static void
test_recursive_remove_all (void)
{
- g_test_trap_subprocess ("/hash/recursive-remove-all/subprocess", 1000000, 0);
+ g_test_trap_subprocess ("/hash/recursive-remove-all/subprocess", 1000000,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
}
diff --git a/glib/tests/list.c b/glib/tests/list.c
index 4efd8b6256..20d01db08c 100644
--- a/glib/tests/list.c
+++ b/glib/tests/list.c
@@ -552,7 +552,7 @@ test_double_free (void)
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*corrupted double-linked list detected*");
}
diff --git a/glib/tests/logging.c b/glib/tests/logging.c
index b79362a7d0..e58b405a2c 100644
--- a/glib/tests/logging.c
+++ b/glib/tests/logging.c
@@ -200,48 +200,59 @@ test_default_handler_0x400 (void)
static void
test_default_handler (void)
{
- g_test_trap_subprocess ("/logging/default-handler/subprocess/error", 0, 0);
+ g_test_trap_subprocess ("/logging/default-handler/subprocess/error", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*ERROR*message1*");
- g_test_trap_subprocess ("/logging/default-handler/subprocess/critical", 0, 0);
+ g_test_trap_subprocess ("/logging/default-handler/subprocess/critical", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*CRITICAL*message2*");
- g_test_trap_subprocess ("/logging/default-handler/subprocess/warning", 0, 0);
+ g_test_trap_subprocess ("/logging/default-handler/subprocess/warning", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*WARNING*message3*");
- g_test_trap_subprocess ("/logging/default-handler/subprocess/message", 0, 0);
+ g_test_trap_subprocess ("/logging/default-handler/subprocess/message", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stderr ("*Message*message4*");
- g_test_trap_subprocess ("/logging/default-handler/subprocess/info", 0, 0);
+ g_test_trap_subprocess ("/logging/default-handler/subprocess/info", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stdout_unmatched ("*INFO*message5*");
- g_test_trap_subprocess ("/logging/default-handler/subprocess/bar-info", 0, 0);
+ g_test_trap_subprocess ("/logging/default-handler/subprocess/bar-info", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stdout ("*INFO*message5*");
- g_test_trap_subprocess ("/logging/default-handler/subprocess/baz-debug", 0, 0);
+ g_test_trap_subprocess ("/logging/default-handler/subprocess/baz-debug", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stdout ("*DEBUG*message6*");
- g_test_trap_subprocess ("/logging/default-handler/subprocess/debug", 0, 0);
+ g_test_trap_subprocess ("/logging/default-handler/subprocess/debug", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stdout ("*DEBUG*6*6*6*");
- g_test_trap_subprocess ("/logging/default-handler/subprocess/debug-stderr", 0, 0);
+ g_test_trap_subprocess ("/logging/default-handler/subprocess/debug-stderr", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stdout_unmatched ("DEBUG");
g_test_trap_assert_stderr ("*DEBUG*6*6*6*");
- g_test_trap_subprocess ("/logging/default-handler/subprocess/0x400", 0, 0);
+ g_test_trap_subprocess ("/logging/default-handler/subprocess/0x400", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stdout ("*LOG-0x400*message7*");
- g_test_trap_subprocess ("/logging/default-handler/subprocess/would-drop", 0, 0);
+ g_test_trap_subprocess ("/logging/default-handler/subprocess/would-drop", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
}
@@ -254,7 +265,7 @@ test_fatal_log_mask (void)
g_log ("bu", G_LOG_LEVEL_INFO, "fatal");
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
/* G_LOG_LEVEL_INFO isn't printed by default */
g_test_trap_assert_stdout_unmatched ("*fatal*");
@@ -361,7 +372,7 @@ test_gibberish (void)
g_warning ("bla bla \236\237\190");
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*bla bla \\x9e\\x9f\\u000190*");
}
@@ -465,7 +476,7 @@ test_structured_logging_no_state (void)
}
else
{
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
}
}
@@ -494,7 +505,7 @@ test_structured_logging_some_state (void)
}
else
{
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
}
}
@@ -517,7 +528,7 @@ test_structured_logging_robustness (void)
}
else
{
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
}
}
@@ -568,7 +579,7 @@ test_structured_logging_roundtrip1 (void)
}
else
{
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
}
}
@@ -603,7 +614,7 @@ test_structured_logging_roundtrip2 (void)
}
else
{
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
}
}
@@ -632,7 +643,7 @@ test_structured_logging_roundtrip3 (void)
}
else
{
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
}
}
@@ -672,7 +683,7 @@ test_structured_logging_variant1 (void)
}
else
{
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
}
}
@@ -704,7 +715,7 @@ test_structured_logging_variant2 (void)
}
else
{
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
}
}
@@ -721,7 +732,7 @@ test_structured_logging_set_writer_func_twice (void)
}
else
{
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
}
}
diff --git a/glib/tests/mem-overflow.c b/glib/tests/mem-overflow.c
index fd926854f7..66a005684e 100644
--- a/glib/tests/mem-overflow.c
+++ b/glib/tests/mem-overflow.c
@@ -139,7 +139,8 @@ mem_overflow (void)
#define CHECK_SUBPROCESS_FAIL(name) do { \
if (g_test_undefined ()) \
{ \
- g_test_trap_subprocess ("/mem/overflow/subprocess/" #name, 0, 0); \
+ g_test_trap_subprocess ("/mem/overflow/subprocess/" #name, 0, \
+ G_TEST_SUBPROCESS_DEFAULT); \
g_test_trap_assert_failed(); \
} \
} while (0)
@@ -147,7 +148,8 @@ mem_overflow (void)
#define CHECK_SUBPROCESS_PASS(name) do { \
if (g_test_undefined ()) \
{ \
- g_test_trap_subprocess ("/mem/overflow/subprocess/" #name, 0, 0); \
+ g_test_trap_subprocess ("/mem/overflow/subprocess/" #name, 0, \
+ G_TEST_SUBPROCESS_DEFAULT); \
g_test_trap_assert_passed(); \
} \
} while (0)
@@ -208,7 +210,8 @@ empty_alloc (void)
g_assert_cmpint (sizeof (Empty), ==, 0);
- g_test_trap_subprocess ("/mem/empty-alloc/subprocess", 0, 0);
+ g_test_trap_subprocess ("/mem/empty-alloc/subprocess", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
}
#endif
diff --git a/glib/tests/refcount.c b/glib/tests/refcount.c
index 9a906b24e8..66d4b3bcf8 100644
--- a/glib/tests/refcount.c
+++ b/glib/tests/refcount.c
@@ -100,7 +100,7 @@ test_grefcount_saturation (void)
exit (0);
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
#if defined (G_DISABLE_CHECKS) && defined (__GNUC__)
/* With checks disabled we don't get any warning */
@@ -193,7 +193,7 @@ test_gatomicrefcount_saturation (void)
exit (0);
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
#if defined (G_DISABLE_CHECKS) && defined (__GNUC__)
/* With checks disabled we don't get any warning */
diff --git a/glib/tests/scannerapi.c b/glib/tests/scannerapi.c
index 4ee9754d18..cee3956ea6 100644
--- a/glib/tests/scannerapi.c
+++ b/glib/tests/scannerapi.c
@@ -70,7 +70,7 @@ test_scanner_error (ScannerFixture *fix,
exit (0);
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stderr ("*scanner-error-message-test*");
}
diff --git a/glib/tests/slice.c b/glib/tests/slice.c
index a566280dbf..7cf53b4f72 100644
--- a/glib/tests/slice.c
+++ b/glib/tests/slice.c
@@ -25,7 +25,7 @@ test_slice_nodebug (void)
g_slice_debug_tree_statistics ();
return;
}
- g_test_trap_subprocess (NULL, 1000000, 0);
+ g_test_trap_subprocess (NULL, 1000000, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stderr ("*GSlice: MemChecker: root=NULL*");
@@ -53,7 +53,7 @@ test_slice_debug (void)
g_slice_debug_tree_statistics ();
return;
}
- g_test_trap_subprocess (NULL, 1000000, 0);
+ g_test_trap_subprocess (NULL, 1000000, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stderr ("*GSlice: MemChecker: * trunks, * branches, * old branches*");
diff --git a/glib/tests/spawn-singlethread.c b/glib/tests/spawn-singlethread.c
index fec9a69d10..e4f15ecab8 100644
--- a/glib/tests/spawn-singlethread.c
+++ b/glib/tests/spawn-singlethread.c
@@ -401,7 +401,7 @@ test_spawn_stderr_socket (void)
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
}
diff --git a/glib/tests/test-printf.c b/glib/tests/test-printf.c
index 6eadf1e982..9aca97febc 100644
--- a/glib/tests/test-printf.c
+++ b/glib/tests/test-printf.c
@@ -639,7 +639,7 @@ test_positional_params2 (void)
g_assert_cmpint (res, ==, 7);
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stdout ("a b\n ab\nabcabc\n");
}
@@ -674,7 +674,7 @@ test_percent2 (void)
g_assert_cmpint (res, ==, 1);
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stdout ("*%*");
}
@@ -858,13 +858,15 @@ _Pragma ("GCC diagnostic pop")
static void
test_64bit2 (void)
{
- g_test_trap_subprocess ("/printf/test-64bit/subprocess/base", 0, 0);
+ g_test_trap_subprocess ("/printf/test-64bit/subprocess/base", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stdout ("123456\n-123456\n123456\n"
"361100\n0361100\n1e240\n"
"0x1e240\n1E240\n");
#ifdef G_OS_WIN32
- g_test_trap_subprocess ("/printf/test-64bit/subprocess/win32", 0, 0);
+ g_test_trap_subprocess ("/printf/test-64bit/subprocess/win32", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stdout ("123456\n-123456\n123456\n"
"361100\n0361100\n1e240\n"
diff --git a/glib/tests/testing.c b/glib/tests/testing.c
index accd5dbfec..60fdb4ccdc 100644
--- a/glib/tests/testing.c
+++ b/glib/tests/testing.c
@@ -208,56 +208,69 @@ test_assertions (void)
g_variant_unref (v2);
g_variant_unref (v1);
- g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpvariant_types", 0, 0);
+ g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpvariant_types", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*assertion failed*");
- g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpvariant_values", 0, 0);
+ g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpvariant_values", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*assertion failed*");
- g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpstr", 0, 0);
+ g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpstr", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*assertion failed*");
- g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpstrv_null1", 0, 0);
+ g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpstrv_null1", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*assertion failed*");
- g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpstrv_null2", 0, 0);
+ g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpstrv_null2", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*assertion failed*");
- g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpstrv_length", 0, 0);
+ g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpstrv_length", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*assertion failed*");
- g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpstrv_values", 0, 0);
+ g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpstrv_values", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*assertion failed*");
- g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpint", 0, 0);
+ g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpint", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*assertion failed*");
- g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpmem_len", 0, 0);
+ g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpmem_len", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*assertion failed*len*");
- g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpmem_data", 0, 0);
+ g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpmem_data", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*assertion failed*");
g_test_trap_assert_stderr_unmatched ("*assertion failed*len*");
- g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpmem_null", 0, 0);
+ g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpmem_null", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*assertion failed*NULL*");
- g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpfloat_epsilon", 0, 0);
+ g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpfloat_epsilon", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*assertion failed*");
- g_test_trap_subprocess ("/misc/assertions/subprocess/bad_no_errno", 0, 0);
+ g_test_trap_subprocess ("/misc/assertions/subprocess/bad_no_errno", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*assertion failed*");
}
@@ -312,7 +325,7 @@ static void
test_fork_timeout (void)
{
/* allow child to run for only a fraction of a second */
- if (g_test_trap_fork (0.11 * 1000000, 0))
+ if (g_test_trap_fork (0.11 * 1000000, G_TEST_TRAP_DEFAULT))
{
/* loop and sleep forever */
while (TRUE)
@@ -334,7 +347,7 @@ test_subprocess_fail (void)
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*ERROR*test_subprocess_fail*should not be reached*");
}
@@ -344,11 +357,12 @@ test_subprocess_no_such_test (void)
{
if (g_test_subprocess ())
{
- g_test_trap_subprocess ("/trap_subprocess/this-test-does-not-exist", 0, 0);
+ g_test_trap_subprocess ("/trap_subprocess/this-test-does-not-exist", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_assert_not_reached ();
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*test does not exist*");
g_test_trap_assert_stderr_unmatched ("*should not be reached*");
@@ -363,7 +377,7 @@ test_subprocess_patterns (void)
g_printerr ("some stderr text: semagic43\n");
exit (0);
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stdout ("*somagic17*");
g_test_trap_assert_stderr ("*semagic43*");
@@ -380,7 +394,7 @@ test_subprocess_timeout (void)
return;
}
/* allow child to run for only a fraction of a second */
- g_test_trap_subprocess (NULL, 0.11 * 1000000, 0);
+ g_test_trap_subprocess (NULL, 0.11 * 1000000, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_assert_true (g_test_trap_reached_timeout ());
}
@@ -508,16 +522,19 @@ test_fatal_log_handler_critical_fail (void)
static void
test_fatal_log_handler (void)
{
- g_test_trap_subprocess ("/misc/fatal-log-handler/subprocess/critical-pass", 0, 0);
+ g_test_trap_subprocess ("/misc/fatal-log-handler/subprocess/critical-pass", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stderr ("*CRITICAL*g_str_has_prefix*");
g_test_trap_assert_stderr ("*CRITICAL*Test passing*");
- g_test_trap_subprocess ("/misc/fatal-log-handler/subprocess/error-fail", 0, 0);
+ g_test_trap_subprocess ("/misc/fatal-log-handler/subprocess/error-fail", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*ERROR*Test failing*");
- g_test_trap_subprocess ("/misc/fatal-log-handler/subprocess/critical-fail", 0, 0);
+ g_test_trap_subprocess ("/misc/fatal-log-handler/subprocess/critical-fail", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*CRITICAL*g_str_has_prefix*");
g_test_trap_assert_stderr_unmatched ("*CRITICAL*Test passing*");
@@ -612,34 +629,41 @@ test_expected_messages_unexpected_extra_warning (void)
static void
test_expected_messages (void)
{
- g_test_trap_subprocess ("/misc/expected-messages/subprocess/warning", 0, 0);
+ g_test_trap_subprocess ("/misc/expected-messages/subprocess/warning", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*This is a * warning*");
g_test_trap_assert_stderr_unmatched ("*should not be reached*");
- g_test_trap_subprocess ("/misc/expected-messages/subprocess/expect-warning", 0, 0);
+ g_test_trap_subprocess ("/misc/expected-messages/subprocess/expect-warning", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr_unmatched ("*This is a * warning*");
g_test_trap_assert_stderr ("*should not be reached*");
- g_test_trap_subprocess ("/misc/expected-messages/subprocess/wrong-warning", 0, 0);
+ g_test_trap_subprocess ("/misc/expected-messages/subprocess/wrong-warning", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr_unmatched ("*should not be reached*");
g_test_trap_assert_stderr ("*GLib-CRITICAL*Did not see expected message testing-CRITICAL*should not be
*WARNING*This is a * warning*");
- g_test_trap_subprocess ("/misc/expected-messages/subprocess/expected", 0, 0);
+ g_test_trap_subprocess ("/misc/expected-messages/subprocess/expected", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stderr ("");
- g_test_trap_subprocess ("/misc/expected-messages/subprocess/null-domain", 0, 0);
+ g_test_trap_subprocess ("/misc/expected-messages/subprocess/null-domain", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stderr ("");
- g_test_trap_subprocess ("/misc/expected-messages/subprocess/extra-warning", 0, 0);
+ g_test_trap_subprocess ("/misc/expected-messages/subprocess/extra-warning", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stderr ("");
- g_test_trap_subprocess ("/misc/expected-messages/subprocess/unexpected-extra-warning", 0, 0);
+ g_test_trap_subprocess ("/misc/expected-messages/subprocess/unexpected-extra-warning", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*GLib:ERROR*Did not see expected message testing-CRITICAL*nope*");
}
@@ -718,7 +742,8 @@ test_dash_p_child_sub_child (void)
static void
test_dash_p (void)
{
- g_test_trap_subprocess ("/misc/dash-p/subprocess/hidden", 0, 0);
+ g_test_trap_subprocess ("/misc/dash-p/subprocess/hidden", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stdout ("*Test /misc/dash-p/subprocess/hidden ran*");
g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden/sub ran*");
@@ -726,7 +751,8 @@ test_dash_p (void)
g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden/sub/subprocess ran*");
g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/child*");
- g_test_trap_subprocess ("/misc/dash-p/subprocess/hidden/sub", 0, 0);
+ g_test_trap_subprocess ("/misc/dash-p/subprocess/hidden/sub", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stdout ("*Test /misc/dash-p/subprocess/hidden/sub ran*");
g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden ran*");
@@ -734,7 +760,8 @@ test_dash_p (void)
g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden/subprocess ran*");
g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/child*");
- g_test_trap_subprocess ("/misc/dash-p/child", 0, 0);
+ g_test_trap_subprocess ("/misc/dash-p/child", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stdout ("*Test /misc/dash-p/child ran*");
g_test_trap_assert_stdout ("*Test /misc/dash-p/child/sub ran*");
@@ -742,7 +769,8 @@ test_dash_p (void)
g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/child/subprocess ran*");
g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden*");
- g_test_trap_subprocess ("/misc/dash-p/child/sub", 0, 0);
+ g_test_trap_subprocess ("/misc/dash-p/child/sub", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stdout ("*Test /misc/dash-p/child/sub ran*");
g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/child ran*");
@@ -761,7 +789,7 @@ test_nonfatal (void)
g_print ("The End\n");
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*assertion failed*4 == 5*");
g_test_trap_assert_stdout ("*The End*");
@@ -800,7 +828,7 @@ test_fail (void)
subprocess_fail ();
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
}
@@ -822,7 +850,7 @@ test_incomplete (void)
subprocess_incomplete ();
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
/* An incomplete test represents functionality that is known not to be
* implemented yet (an expected failure), so it does not cause test
* failure; but it does count as the test having been skipped, which
@@ -839,7 +867,7 @@ test_subprocess_timed_out (void)
g_usleep (1000000);
return;
}
- g_test_trap_subprocess (NULL, 50000, 0);
+ g_test_trap_subprocess (NULL, 50000, G_TEST_SUBPROCESS_DEFAULT);
g_assert_true (g_test_trap_reached_timeout ());
}
diff --git a/glib/tests/thread-pool.c b/glib/tests/thread-pool.c
index 5c70815318..23ee27ee3d 100644
--- a/glib/tests/thread-pool.c
+++ b/glib/tests/thread-pool.c
@@ -108,7 +108,7 @@ test_create_first_pool (gconstpointer shared_first)
if (!g_test_subprocess ())
{
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
return;
}
diff --git a/glib/tests/utils.c b/glib/tests/utils.c
index 6318e19161..b732b79b09 100644
--- a/glib/tests/utils.c
+++ b/glib/tests/utils.c
@@ -523,7 +523,7 @@ test_debug (void)
g_assert_cmpint (res, ==, 0);
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stderr ("*Supported debug values: key1 key2 key3 all help*");
}
@@ -553,7 +553,7 @@ test_codeset2 (void)
g_assert_cmpstr (c, ==, "UTF-8");
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
}
@@ -956,7 +956,8 @@ test_aligned_mem (void)
if (g_test_undefined ()) \
{ \
g_test_message (msg); \
- g_test_trap_subprocess ("/utils/aligned-mem/subprocess/" #name, 0, 0); \
+ g_test_trap_subprocess ("/utils/aligned-mem/subprocess/" #name, 0, \
+ G_TEST_SUBPROCESS_DEFAULT); \
g_test_trap_assert_failed (); \
} \
} while (0)
@@ -1024,7 +1025,7 @@ test_atexit (void)
g_atexit (atexit_func);
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_passed ();
g_test_trap_assert_stdout ("*atexit called*");
}
diff --git a/glib/tests/win32.c b/glib/tests/win32.c
index 1219973112..31816574d2 100644
--- a/glib/tests/win32.c
+++ b/glib/tests/win32.c
@@ -99,7 +99,8 @@ test_veh_crash_access_violation (void)
{
g_unsetenv ("G_DEBUGGER");
/* Run a test that crashes */
- g_test_trap_subprocess ("/win32/subprocess/access_violation", 0, 0);
+ g_test_trap_subprocess ("/win32/subprocess/access_violation", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
}
@@ -108,7 +109,8 @@ test_veh_crash_illegal_instruction (void)
{
g_unsetenv ("G_DEBUGGER");
/* Run a test that crashes */
- g_test_trap_subprocess ("/win32/subprocess/illegal_instruction", 0, 0);
+ g_test_trap_subprocess ("/win32/subprocess/illegal_instruction", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
}
@@ -125,7 +127,8 @@ test_veh_debug (void)
g_setenv ("G_DEBUGGER_OLD_CONSOLE", "1", TRUE);
g_free (command);
/* Run a test that crashes and runs a debugger */
- g_test_trap_subprocess ("/win32/subprocess/debuggee", 0, 0);
+ g_test_trap_subprocess ("/win32/subprocess/debuggee", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("Debugger invoked, attaching to*");
}
diff --git a/gobject/tests/param.c b/gobject/tests/param.c
index 787c2d8f0d..ac3e171d64 100644
--- a/gobject/tests/param.c
+++ b/gobject/tests/param.c
@@ -750,7 +750,7 @@ test_param_invalid_name (gconstpointer test_data)
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*CRITICAL*g_param_spec_is_valid_name (name)*");
}
@@ -1395,7 +1395,8 @@ test_param_implement (void)
test_path = g_strdup_printf ("/param/implement/subprocess/%d-%d-%d-%d",
change_this_flag, change_this_type,
use_this_flag, use_this_type);
- g_test_trap_subprocess (test_path, G_TIME_SPAN_SECOND, 0);
+ g_test_trap_subprocess (test_path, G_TIME_SPAN_SECOND,
+ G_TEST_SUBPROCESS_DEFAULT);
g_free (test_path);
/* We want to ensure that any flags mismatch problems are reported first. */
diff --git a/gobject/tests/properties.c b/gobject/tests/properties.c
index 447a7cf04a..da467c2fee 100644
--- a/gobject/tests/properties.c
+++ b/gobject/tests/properties.c
@@ -582,7 +582,7 @@ properties_testv_with_invalid_property_type (void)
g_object_unref (test_obj);
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*WARNING*foo*gint*gchararray*");
}
@@ -620,7 +620,7 @@ properties_testv_with_invalid_property_names (void)
g_object_unref (test_obj);
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*CRITICAL*g_object_new_is_valid_property*boo*");
}
diff --git a/gobject/tests/signals.c b/gobject/tests/signals.c
index e4be41575f..e3648cfad9 100644
--- a/gobject/tests/signals.c
+++ b/gobject/tests/signals.c
@@ -1640,7 +1640,7 @@ test_lookup_invalid (void)
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*WARNING*unable to look up invalid signal name*");
}
@@ -1757,7 +1757,7 @@ test_signals_invalid_name (gconstpointer test_data)
return;
}
- g_test_trap_subprocess (NULL, 0, 0);
+ g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*CRITICAL*g_signal_is_valid_name (signal_name)*");
}
diff --git a/gobject/tests/testing.c b/gobject/tests/testing.c
index 5c7e663bf0..929ed07fdb 100644
--- a/gobject/tests/testing.c
+++ b/gobject/tests/testing.c
@@ -52,7 +52,8 @@ test_assert_finalize_object (void)
g_assert_finalize_object (obj);
- g_test_trap_subprocess ("/assert/finalize_object/subprocess/bad", 0, 0);
+ g_test_trap_subprocess ("/assert/finalize_object/subprocess/bad", 0,
+ G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*g_assert_finalize_object:*'weak_pointer' should be NULL*");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]