aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-06-17 15:06:13 -0500
committerTed Gould <ted@gould.cx>2011-06-17 15:06:13 -0500
commitf3ada5828e3d17fbc4904aad2f8340a5cd50cffb (patch)
tree80051f11626a51e2d4b9c0ef10bf93b98138da41 /tests
parent658dc9eb5dded69d4f1c6b4a251cc666a58ad6de (diff)
downloadlibdbusmenu-f3ada5828e3d17fbc4904aad2f8340a5cd50cffb.tar.gz
libdbusmenu-f3ada5828e3d17fbc4904aad2f8340a5cd50cffb.tar.bz2
libdbusmenu-f3ada5828e3d17fbc4904aad2f8340a5cd50cffb.zip
Hide a warning that is happening on GTK 3 and breaking the test
Diffstat (limited to 'tests')
-rw-r--r--tests/test-gtk-parser.c14
1 files changed, 14 insertions, 0 deletions
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 =
"</object>"
"</interface>";
+/* 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);