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 <pwithnall@gnome.org>
This commit is contained in:
Philip Withnall 2023-12-05 15:58:45 +00:00
parent c40fa821b8
commit e646c631b2

View File

@ -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;