From e646c631b2f864d5fb28949af8dee1b053bad56e Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 5 Dec 2023 15:58:45 +0000 Subject: [PATCH] tests: Assert there no errors first in gdbus-test-codegen Before checking the properties of `*_proxy`, assert that there were no errors in constructing the proxy first. Otherwise the property checks will crash on `NULL` pointer dereferences. The test is still intermittently buggy somewhere, but at least this commit will cause a relevant error message to be printed on failure. Signed-off-by: Philip Withnall --- gio/tests/gdbus-test-codegen.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gio/tests/gdbus-test-codegen.c b/gio/tests/gdbus-test-codegen.c index 31de7f14e..9c84ea65c 100644 --- a/gio/tests/gdbus-test-codegen.c +++ b/gio/tests/gdbus-test-codegen.c @@ -1395,8 +1395,8 @@ check_proxies_in_thread (gpointer user_data) "/bar", NULL, /* GCancellable* */ &error); - check_bar_proxy (bar_proxy, thread_loop); g_assert_no_error (error); + check_bar_proxy (bar_proxy, thread_loop); g_object_unref (bar_proxy); error = NULL; @@ -1406,8 +1406,8 @@ check_proxies_in_thread (gpointer user_data) "/bat", NULL, /* GCancellable* */ &error); - check_bat_proxy (bat_proxy, thread_loop); g_assert_no_error (error); + check_bat_proxy (bat_proxy, thread_loop); g_object_unref (bat_proxy); error = NULL; @@ -1417,8 +1417,8 @@ check_proxies_in_thread (gpointer user_data) "/authorize", NULL, /* GCancellable* */ &error); - check_authorize_proxy (authorize_proxy, thread_loop); g_assert_no_error (error); + check_authorize_proxy (authorize_proxy, thread_loop); g_object_unref (authorize_proxy); error = NULL;