diff options
author | Matthias Clasen <mclasen@redhat.com> | 2016-12-28 08:53:22 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2016-12-28 18:57:55 -0500 |
commit | 1ae7240932cd1be164c5dc94f8767afa541f1e83 (patch) | |
tree | 322700689717e8ed5ddd2423111c88c6aef77743 /testsuite | |
parent | a3e2fc2df6ed9e896aa553a3acc1a5c363914d09 (diff) | |
download | gtk+-no-init-args.tar.gz |
Update callersno-init-args
Adapt all our tests and examples to the new initialization api.
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/a11y/derive.c | 2 | ||||
-rw-r--r-- | testsuite/gdk/Makefile.am | 4 | ||||
-rw-r--r-- | testsuite/gdk/cairo.c | 4 | ||||
-rw-r--r-- | testsuite/gdk/cursor.c | 4 | ||||
-rw-r--r-- | testsuite/gdk/display.c | 10 | ||||
-rw-r--r-- | testsuite/gdk/encoding.c | 4 | ||||
-rw-r--r-- | testsuite/gdk/keysyms.c | 4 | ||||
-rw-r--r-- | testsuite/gdk/rectangle.c | 4 | ||||
-rw-r--r-- | testsuite/gdk/seat.c | 4 | ||||
-rw-r--r-- | testsuite/gtk/accessible.c | 2 | ||||
-rw-r--r-- | testsuite/gtk/cssprovider.c | 2 | ||||
-rw-r--r-- | testsuite/gtk/displayclose.c | 11 | ||||
-rw-r--r-- | testsuite/gtk/firefox-stylecontext.c | 6 | ||||
-rw-r--r-- | testsuite/gtk/gtkmenu.c | 2 | ||||
-rw-r--r-- | testsuite/gtk/revealer-size.c | 2 | ||||
-rw-r--r-- | testsuite/gtk/scrolledwindow.c | 2 | ||||
-rw-r--r-- | testsuite/gtk/stylecontext.c | 2 |
17 files changed, 34 insertions, 35 deletions
diff --git a/testsuite/a11y/derive.c b/testsuite/a11y/derive.c index 6ecb47cf1d..b9e4d4d41c 100644 --- a/testsuite/a11y/derive.c +++ b/testsuite/a11y/derive.c @@ -62,7 +62,7 @@ int main (int argc, char *argv[]) GtkWidget *widget; GtkAccessible *accessible; - gtk_init (NULL, NULL); + gtk_init (); widget = GTK_WIDGET (g_object_new (my_button_get_type (), NULL)); accessible = GTK_ACCESSIBLE (gtk_widget_get_accessible (widget)); diff --git a/testsuite/gdk/Makefile.am b/testsuite/gdk/Makefile.am index b8cbca3e12..03cb577468 100644 --- a/testsuite/gdk/Makefile.am +++ b/testsuite/gdk/Makefile.am @@ -5,13 +5,13 @@ NULL= noinst_PROGRAMS = $(TEST_PROGS) AM_CPPFLAGS = \ - $(GDK_DEP_CFLAGS) \ + $(GTK_DEP_CFLAGS) \ -I$(top_srcdir) \ -I$(top_builddir)/gdk \ $(NULL) LDADD = \ - $(GDK_DEP_LIBS) \ + $(GTK_DEP_LIBS) \ $(top_builddir)/gtk/libgtk-4.la \ $(NULL) diff --git a/testsuite/gdk/cairo.c b/testsuite/gdk/cairo.c index 77be879c97..071ca33767 100644 --- a/testsuite/gdk/cairo.c +++ b/testsuite/gdk/cairo.c @@ -1,4 +1,4 @@ -#include <gdk/gdk.h> +#include <gtk/gtk.h> static void test_set_source_big_pixbuf (void) @@ -32,7 +32,7 @@ int main (int argc, char *argv[]) { g_test_init (&argc, &argv, NULL); - gdk_init (&argc, &argv); + gtk_init (); g_test_add_func ("/drawing/set-source-big-pixbuf", test_set_source_big_pixbuf); diff --git a/testsuite/gdk/cursor.c b/testsuite/gdk/cursor.c index 5ae3bc064e..ec2997a600 100644 --- a/testsuite/gdk/cursor.c +++ b/testsuite/gdk/cursor.c @@ -1,4 +1,4 @@ -#include <gdk/gdk.h> +#include <gtk/gtk.h> static char *cursor_names[] = { "none", @@ -76,7 +76,7 @@ main (int argc, char *argv[]) char *test_name; g_test_init (&argc, &argv, NULL); - gdk_init (NULL, NULL); + gtk_init (); for (i = 0; i < G_N_ELEMENTS (cursor_names); i++) { diff --git a/testsuite/gdk/display.c b/testsuite/gdk/display.c index 297c8e8ae4..c5b3b1641a 100644 --- a/testsuite/gdk/display.c +++ b/testsuite/gdk/display.c @@ -1,6 +1,6 @@ #include <stdlib.h> -#include <gdk/gdk.h> +#include <gtk/gtk.h> static void test_unset_display_subprocess1 (void) @@ -9,7 +9,7 @@ test_unset_display_subprocess1 (void) g_unsetenv ("DISPLAY"); - g_assert (!gdk_init_check (NULL, NULL)); + g_assert (!gtk_init_check ()); manager = gdk_display_manager_get (); g_assert (manager != NULL); g_assert (gdk_display_manager_get_default_display (manager) == NULL); @@ -20,7 +20,7 @@ test_unset_display_subprocess2 (void) { g_unsetenv ("DISPLAY"); - gdk_init (NULL, NULL); + gtk_init (); } static void @@ -41,7 +41,7 @@ test_bad_display_subprocess1 (void) g_setenv ("DISPLAY", "poo", TRUE); - g_assert (!gdk_init_check (NULL, NULL)); + g_assert (!gtk_init_check ()); manager = gdk_display_manager_get (); g_assert (manager != NULL); g_assert (gdk_display_manager_get_default_display (manager) == NULL); @@ -51,7 +51,7 @@ static void test_bad_display_subprocess2 (void) { g_setenv ("DISPLAY", "poo", TRUE); - gdk_init (NULL, NULL); + gtk_init (); } static void diff --git a/testsuite/gdk/encoding.c b/testsuite/gdk/encoding.c index 6ae96095d6..016d1cee28 100644 --- a/testsuite/gdk/encoding.c +++ b/testsuite/gdk/encoding.c @@ -1,4 +1,4 @@ -#include <gdk/gdk.h> +#include <gtk/gtk.h> #ifdef GDK_WINDOWING_X11 #include <gdk/x11/gdkx.h> #endif @@ -38,7 +38,7 @@ int main (int argc, char *argv[]) { g_test_init (&argc, &argv, NULL); - gdk_init (&argc, &argv); + gtk_init (); g_test_add_func ("/encoding/to-text-list", test_to_text_list); diff --git a/testsuite/gdk/keysyms.c b/testsuite/gdk/keysyms.c index 7d786f557c..dc94faec23 100644 --- a/testsuite/gdk/keysyms.c +++ b/testsuite/gdk/keysyms.c @@ -1,5 +1,5 @@ #include <locale.h> -#include <gdk/gdk.h> +#include <gtk/gtk.h> static void test_keysyms_basic (void) @@ -59,7 +59,7 @@ int main (int argc, char *argv[]) setlocale (LC_ALL, ""); g_test_init (&argc, &argv, NULL); - gdk_init (&argc, &argv); + gtk_init (); g_test_add_func ("/keysyms/basic", test_keysyms_basic); g_test_add_func ("/keysyms/void", test_keysyms_void); diff --git a/testsuite/gdk/rectangle.c b/testsuite/gdk/rectangle.c index 6089ff6ba3..1b9cbe9135 100644 --- a/testsuite/gdk/rectangle.c +++ b/testsuite/gdk/rectangle.c @@ -1,4 +1,4 @@ -#include <gdk/gdk.h> +#include <gtk/gtk.h> static void test_rectangle_equal (void) @@ -70,7 +70,7 @@ main (int argc, char *argv[]) { g_test_init (&argc, &argv, NULL); - gdk_init (NULL, NULL); + gtk_init (); g_test_bug_base ("http://bugzilla.gnome.org/"); diff --git a/testsuite/gdk/seat.c b/testsuite/gdk/seat.c index 326b70dc89..8fadb82a6f 100644 --- a/testsuite/gdk/seat.c +++ b/testsuite/gdk/seat.c @@ -1,4 +1,4 @@ -#include <gdk/gdk.h> +#include <gtk/gtk.h> static void test_list_seats (void) @@ -109,7 +109,7 @@ main (int argc, char *argv[]) { g_test_init (&argc, &argv, NULL); - gdk_init (NULL, NULL); + gtk_init (); g_test_bug_base ("http://bugzilla.gnome.org/"); diff --git a/testsuite/gtk/accessible.c b/testsuite/gtk/accessible.c index cdf3253730..7f5a034b94 100644 --- a/testsuite/gtk/accessible.c +++ b/testsuite/gtk/accessible.c @@ -24,7 +24,7 @@ main (int argc, char *argv[]) const GType *tp; guint i, n; - gtk_init (&argc, &argv); + gtk_init (); tp = gtk_test_list_all_types (&n); diff --git a/testsuite/gtk/cssprovider.c b/testsuite/gtk/cssprovider.c index 0272c6b9fd..3c3fbff765 100644 --- a/testsuite/gtk/cssprovider.c +++ b/testsuite/gtk/cssprovider.c @@ -65,7 +65,7 @@ test_section_load_nonexisting_file (void) int main (int argc, char *argv[]) { - gtk_init (NULL, NULL); + gtk_init (); g_test_init (&argc, &argv, NULL); g_test_add_func ("/cssprovider/section-in-load-from-data", test_section_in_load_from_data); diff --git a/testsuite/gtk/displayclose.c b/testsuite/gtk/displayclose.c index 39fd794e92..60f90f8f49 100644 --- a/testsuite/gtk/displayclose.c +++ b/testsuite/gtk/displayclose.c @@ -6,14 +6,17 @@ main (int argc, char **argv) const gchar *display_name; GdkDisplay *display; GtkWidget *win, *but; + gboolean has_display; g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL); - if (!gtk_parse_args (&argc, &argv)) - return 1; + gdk_set_allowed_backends ("x11"); + display_name = g_getenv ("DISPLAY"); + g_unsetenv ("DISPLAY"); + has_display = gtk_init_check (); + g_assert (!has_display); - display_name = gdk_get_display_arg_name(); - display = gdk_display_open(display_name); + display = gdk_display_open (display_name); if (!display) return 1; diff --git a/testsuite/gtk/firefox-stylecontext.c b/testsuite/gtk/firefox-stylecontext.c index 86dc1ee5f0..f02cb3aaf5 100644 --- a/testsuite/gtk/firefox-stylecontext.c +++ b/testsuite/gtk/firefox-stylecontext.c @@ -53,11 +53,7 @@ test_init_of_theme (void) int main (int argc, char *argv[]) { - /* If gdk_init() is called before gtk_init() the GTK code takes - * a different path (why?) - */ - gdk_init (NULL, NULL); - gtk_init (NULL, NULL); + gtk_init (); g_test_init (&argc, &argv, NULL); g_test_add_func ("/style/init_of_theme", test_init_of_theme); diff --git a/testsuite/gtk/gtkmenu.c b/testsuite/gtk/gtkmenu.c index e2667ba135..c17d50aa75 100644 --- a/testsuite/gtk/gtkmenu.c +++ b/testsuite/gtk/gtkmenu.c @@ -422,7 +422,7 @@ test_bind_menu (void) GRand *rand; gint i; - gtk_init (0, 0); + gtk_init (); rand = g_rand_new_with_seed (g_test_rand_int ()); model = random_menu_new (rand, TOP_ORDER); diff --git a/testsuite/gtk/revealer-size.c b/testsuite/gtk/revealer-size.c index 8c09a49125..cc1708ab67 100644 --- a/testsuite/gtk/revealer-size.c +++ b/testsuite/gtk/revealer-size.c @@ -128,7 +128,7 @@ slide_up_no_animations () int main (int argc, char **argv) { - gtk_init (&argc, &argv); + gtk_init (); g_test_init (&argc, &argv, NULL); g_test_add_func ("/sizing/revealer/slide_right_animations", slide_right_animations); diff --git a/testsuite/gtk/scrolledwindow.c b/testsuite/gtk/scrolledwindow.c index b62b32393d..f960c38339 100644 --- a/testsuite/gtk/scrolledwindow.c +++ b/testsuite/gtk/scrolledwindow.c @@ -125,7 +125,7 @@ min_max_content_height (void) int main (int argc, char **argv) { - gtk_init (&argc, &argv); + gtk_init (); g_test_init (&argc, &argv, NULL); g_test_add_func ("/sizing/scrolledwindow/min_content_width", min_content_width); diff --git a/testsuite/gtk/stylecontext.c b/testsuite/gtk/stylecontext.c index 57a8dd53c6..b66d91739b 100644 --- a/testsuite/gtk/stylecontext.c +++ b/testsuite/gtk/stylecontext.c @@ -508,7 +508,7 @@ test_style_priorities_three_context_higher (PrioritiesFixture *f, int main (int argc, char *argv[]) { - gtk_init (NULL, NULL); + gtk_init (); g_test_init (&argc, &argv, NULL); g_test_add_func ("/style/parse/selectors", test_parse_selectors); |