[gtk+] tests: Avoid g_test_expect_message
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] tests: Avoid g_test_expect_message
- Date: Sat, 6 Aug 2016 21:13:38 +0000 (UTC)
commit 1306f780abc1aa928c140107eace3896e43535bb
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Aug 6 17:10:43 2016 -0400
tests: Avoid g_test_expect_message
Instead of using g_test_expect_message, just ignore the warning.
testsuite/gtk/treestore.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/testsuite/gtk/treestore.c b/testsuite/gtk/treestore.c
index e71953f..109b0dc 100644
--- a/testsuite/gtk/treestore.c
+++ b/testsuite/gtk/treestore.c
@@ -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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]