summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorPhilippe Normand <philn@igalia.com>2018-06-08 18:10:59 +0100
committerPhilippe Normand <philn@igalia.com>2018-06-08 18:41:54 +0100
commit2f181df1cf3d1738c112e06d31ccfb83c11d4f2a (patch)
treef189ae8b0665e263bf47484bec5549557162d99e /testsuite
parent542ad4fdc579e689e3e0486e45f4ba7b0c6ee433 (diff)
downloadgtk+-2f181df1cf3d1738c112e06d31ccfb83c11d4f2a.tar.gz
gtkmain: Add gtk_get_main_thread()
This utility function can be useful to know which thread was initialized for GTK+.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gtk/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/testsuite/gtk/main.c b/testsuite/gtk/main.c
index dc5e249069..727ae032bb 100644
--- a/testsuite/gtk/main.c
+++ b/testsuite/gtk/main.c
@@ -4,9 +4,15 @@
static void
test_init (void)
{
+ GThread *self = g_thread_self ();
+
g_assert (gtk_is_initialized () == FALSE);
+ g_assert (gtk_get_main_thread () == NULL);
+
g_assert (gtk_init_check ());
g_assert (gtk_is_initialized () == TRUE);
+
+ g_assert (gtk_get_main_thread () == self);
}
int