From f3ada5828e3d17fbc4904aad2f8340a5cd50cffb Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 17 Jun 2011 15:06:13 -0500 Subject: Hide a warning that is happening on GTK 3 and breaking the test --- tests/test-gtk-parser.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/test-gtk-parser.c') diff --git a/tests/test-gtk-parser.c b/tests/test-gtk-parser.c index b66b46a..87b0a7f 100644 --- a/tests/test-gtk-parser.c +++ b/tests/test-gtk-parser.c @@ -55,9 +55,23 @@ const gchar * test_parser_children_builder = "" ""; +/* Checks the log level to let warnings not stop the program */ +static gboolean +test_parser_children_log_handler (const gchar * domain, GLogLevelFlags level, const gchar * message, gpointer user_data) +{ + if (level & (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_MESSAGE | G_LOG_LEVEL_INFO | G_LOG_LEVEL_DEBUG)) { + return FALSE; + } + + return TRUE; +} + /* Ensure the parser can find children */ static void test_parser_children (void) { + /* Hide GTK errors */ + g_test_log_set_fatal_handler(test_parser_children_log_handler, NULL); + GtkBuilder * builder = gtk_builder_new(); g_assert(builder != NULL); -- cgit v1.2.3