mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
Simplify subprocesses in tests
Use the new way of running tests in a subprocess without registering extra 'subprocess' test cases where appropriate.
This commit is contained in:
@@ -117,19 +117,18 @@ my_infanticide_object_class_init (MyInfanticideObjectClass *klass)
|
||||
object_class->constructor = my_infanticide_object_constructor;
|
||||
}
|
||||
|
||||
static void
|
||||
test_object_constructor_infanticide_subprocess (void)
|
||||
{
|
||||
g_object_new (my_infanticide_object_get_type (), NULL);
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
static void
|
||||
test_object_constructor_infanticide (void)
|
||||
{
|
||||
g_test_bug ("661576");
|
||||
|
||||
g_test_trap_subprocess ("/object/constructor/infanticide/subprocess", 0, 0);
|
||||
if (g_test_subprocess ())
|
||||
{
|
||||
g_object_new (my_infanticide_object_get_type (), NULL);
|
||||
g_assert_not_reached ();
|
||||
return;
|
||||
}
|
||||
g_test_trap_subprocess (NULL, 0, 0);
|
||||
g_test_trap_assert_failed ();
|
||||
g_test_trap_assert_stderr ("*finalized while still in-construction*");
|
||||
g_test_trap_assert_stderr_unmatched ("*reached*");
|
||||
@@ -145,7 +144,6 @@ main (int argc, char *argv[])
|
||||
|
||||
g_test_add_func ("/object/constructor/singleton", test_object_constructor_singleton);
|
||||
g_test_add_func ("/object/constructor/infanticide", test_object_constructor_infanticide);
|
||||
g_test_add_func ("/object/constructor/infanticide/subprocess", test_object_constructor_infanticide_subprocess);
|
||||
|
||||
return g_test_run ();
|
||||
}
|
||||
|
Reference in New Issue
Block a user