Bug 579050 Allow making selected critical and warning messages non-fatal

Implement g_test_log_set_fatal_handler which is a function similar to
g_log_set_default_handler but for use in unit tests where certain
errors have to be ignored because it is not possible to fix or avoid
them otherwise. A unit test is added.
This commit is contained in:
Christian Dywan
2009-09-10 16:40:11 +02:00
committed by Christian Dywan
parent 4b1217b7e0
commit 278ac0a45d
5 changed files with 97 additions and 2 deletions

View File

@@ -1122,6 +1122,7 @@ test_case_run (GTestCase *tc)
void *fixture;
g_test_log (G_TEST_LOG_START_CASE, test_run_name, NULL, 0, NULL);
test_run_forks = 0;
g_test_log_set_fatal_handler (NULL, NULL);
g_timer_start (test_run_timer);
fixture = tc->fixture_size ? g_malloc0 (tc->fixture_size) : tc->test_data;
test_run_seed (test_run_seedstr);