tests: Avoid g_test_expect_message

Instead of using g_test_expect_message, just ignore the warning.
This commit is contained in:
Matthias Clasen 2016-08-06 17:10:43 -04:00
parent 64521345b9
commit 1306f780ab

View File

@ -1049,6 +1049,15 @@ specific_bug_77977 (void)
g_object_unref (tree_store);
}
static GLogWriterOutput
log_writer_drop_warnings (GLogLevelFlags log_level,
const GLogField *fields,
gsize n_fields,
gpointer user_data)
{
return G_LOG_WRITER_HANDLED;
}
static void
specific_bug_698396 (void)
{
@ -1059,9 +1068,9 @@ specific_bug_698396 (void)
tree_store = gtk_tree_store_new (1, G_TYPE_STRING);
g_test_expect_message ("Gtk", G_LOG_LEVEL_WARNING, "*Cannot reorder*");
g_log_set_writer_func (log_writer_drop_warnings, NULL, NULL);
gtk_tree_store_reorder (tree_store, NULL, new_order);
g_test_assert_expected_messages ();
g_log_set_writer_func (g_log_writer_default, NULL, NULL);
g_object_unref (tree_store);
}