[gtk+] testsuite: Fix up icontheme test
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] testsuite: Fix up icontheme test
- Date: Mon, 29 Feb 2016 02:44:51 +0000 (UTC)
commit b1d691dbfd9a778197fe0995f15a0520d5928a63
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Feb 28 15:36:14 2016 -0500
testsuite: Fix up icontheme test
This test was relying on GtkIconTheme using g_print for
debug spew. Adapt it to use g_logv instead.
testsuite/gtk/icontheme.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/testsuite/gtk/icontheme.c b/testsuite/gtk/icontheme.c
index 7fcb160..f61b5f1 100644
--- a/testsuite/gtk/icontheme.c
+++ b/testsuite/gtk/icontheme.c
@@ -123,7 +123,10 @@ assert_icon_lookup_fails (const char *icon_name,
static GList *lookups = NULL;
static void
-print_func (const gchar *string)
+log_func (const gchar *log_domain,
+ GLogLevelFlags log_level,
+ const gchar *string,
+ gpointer user_data)
{
if (g_str_has_prefix (string, "\tlookup name: "))
{
@@ -141,7 +144,6 @@ assert_lookup_order (const char *icon_name,
...)
{
guint debug_flags;
- GPrintFunc old_print_func;
va_list args;
const gchar *s;
GtkIconInfo *info;
@@ -149,10 +151,10 @@ assert_lookup_order (const char *icon_name,
debug_flags = gtk_get_debug_flags ();
gtk_set_debug_flags (debug_flags | GTK_DEBUG_ICONTHEME);
- old_print_func = g_set_print_handler (print_func);
+ g_log_set_handler ("Gtk", G_LOG_LEVEL_MESSAGE, log_func, NULL);
g_assert (lookups == NULL);
-
+
info = gtk_icon_theme_lookup_icon (get_test_icontheme (FALSE), icon_name, size, flags);
if (info)
g_object_unref (info);
@@ -173,7 +175,7 @@ assert_lookup_order (const char *icon_name,
g_list_free_full (lookups, g_free);
lookups = NULL;
- g_set_print_handler (old_print_func);
+ g_log_set_handler ("Gtk", G_LOG_LEVEL_MESSAGE, g_log_default_handler, NULL);
gtk_set_debug_flags (debug_flags);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]