1 /* ADG - Automatic Drawing Generation
2 * Copyright (C) 2010 Nicola Fontana <ntd at entidi.it>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
21 #include "test-internal.h"
25 null_handler(const gchar
*log_domain
, GLogLevelFlags log_level
,
26 const gchar
*message
, gpointer user_data
)
32 test_init(int *p_argc
, char **p_argv
[])
35 g_test_init(p_argc
, p_argv
, NULL
);
37 /* Shut up all the library messages apart G_LOG_LEVEL_ERROR
38 * (always fatal by design): on my opinion a failing test
39 * is a test that ends unexpectedly, not the one properly
40 * reacting to invalid values.
42 * For some unknown reason, g_log_set_fatal_mask("adg", 0)
43 * does not work: the domain seems to be ignored. A better
44 * way would be to use g_test_log_set_fatal_handler() and
45 * provide a callback that ignores the "adg" domain (I've
46 * tested this approach and it works) but that function
47 * will pull in a glib-2.22 dependency... */
48 g_log_set_always_fatal(0);
49 g_log_set_default_handler(null_handler
, NULL
);