g_assert_cmpstr ("foo", <, "fzz");
g_assert_cmpstr ("fzz", >, "faa");
g_assert_cmpstr ("fzz", ==, "fzz");
+
}
/* test g_test_timer* API */
}
static void
-test_log_handler (void)
+test_fatal_log_handler (void)
{
g_test_log_set_fatal_handler (fatal_handler, NULL);
- g_str_has_prefix (NULL, "file://");
- g_critical ("Test passing");
+ if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR))
+ {
+ g_str_has_prefix (NULL, "file://");
+ g_critical ("Test passing");
+ exit (0);
+ }
+ g_test_trap_assert_passed ();
g_test_log_set_fatal_handler (NULL, NULL);
- if (g_test_trap_fork (0, 0))
+ if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR))
g_error ("Test failing");
g_test_trap_assert_failed ();
- if (g_test_trap_fork (0, 0))
+ if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR))
g_str_has_prefix (NULL, "file://");
g_test_trap_assert_failed ();
}
g_test_add_func ("/forking/patterns", test_fork_patterns);
if (g_test_slow())
g_test_add_func ("/forking/timeout", test_fork_timeout);
- g_test_add_func ("/misc/log-handler", test_log_handler);
+ g_test_add_func ("/misc/fatal-log-handler", test_fatal_log_handler);
return g_test_run();
}