summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2021-09-16 21:49:50 +0200
committerBenjamin Otte <otte@redhat.com>2021-09-16 23:59:37 +0200
commitb6d3561f4a2d8d722db6c5715cdc003023167fe9 (patch)
treef8208c45ab3ce7805fcbc461634a0eb3bce96e87
parent01944d57b7a339a174722eb32e4cd53d525b3594 (diff)
downloadgtk+-b6d3561f4a2d8d722db6c5715cdc003023167fe9.tar.gz
testsuite: Be more verbose in texture-threads test
The test randomly fails on CI, so try to be more helpful in debugging them.
-rw-r--r--testsuite/gdk/texture-threads.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/gdk/texture-threads.c b/testsuite/gdk/texture-threads.c
index e4587b12a1..58f631c482 100644
--- a/testsuite/gdk/texture-threads.c
+++ b/testsuite/gdk/texture-threads.c
@@ -11,6 +11,7 @@ ensure_texture_access (GdkTexture *texture)
guint32 pixel = 0;
float float_pixel[4] = { INFINITY, INFINITY, INFINITY, INFINITY };
+ g_test_message ("Checking texture access in thread %p...", g_thread_self());
/* Just to be sure */
g_assert_cmpint (gdk_texture_get_width (texture), ==, 1);
g_assert_cmpint (gdk_texture_get_height (texture), ==, 1);
@@ -25,6 +26,8 @@ ensure_texture_access (GdkTexture *texture)
g_assert_cmpfloat (float_pixel[1], ==, 0.0);
g_assert_cmpfloat (float_pixel[2], ==, 0.0);
g_assert_cmpfloat (float_pixel[3], ==, 1.0);
+
+ g_test_message ("...done in thread %p", g_thread_self());
}
static void
@@ -43,8 +46,18 @@ texture_download_thread (GTask *task,
gpointer unused,
GCancellable *cancellable)
{
+ g_test_message ("Starting thread %p.", g_thread_self());
+ /* not sure this can happen, but if it does, we
+ * should clear_current() here. */
+ g_assert_null (gdk_gl_context_get_current ());
+
ensure_texture_access (GDK_TEXTURE (texture));
+ /* Makes sure the GL context is still NULL, because all the
+ * GL stuff should have happened in the main thread. */
+ g_assert_null (gdk_gl_context_get_current ());
+ g_test_message ("Returning from thread %p.", g_thread_self());
+
g_task_return_boolean (task, TRUE);
}