summaryrefslogtreecommitdiff
path: root/tests/test-doc-portal.c
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2016-01-27 22:54:21 +0100
committerSimon McVittie <smcv@debian.org>2016-01-29 00:21:49 +0100
commitea4d6018370ca8b9e63c4beeae58dbc6308c742a (patch)
tree8106ede530cf586b08573167e51c9ed0e3c8635d /tests/test-doc-portal.c
parent3a70dcf430e1ddf2b67b8f615e12edc1c8050f41 (diff)
downloadxdg-app-ea4d6018370ca8b9e63c4beeae58dbc6308c742a.tar.gz
Consistently call g_assert_no_error before other assertions
If a call fails, an assertion message that contains the error domain, code and message is a lot more useful than reporting that an assertion like "reply != NULL" failed. Signed-off-by: Simon McVittie <smcv@debian.org>
Diffstat (limited to 'tests/test-doc-portal.c')
-rw-r--r--tests/test-doc-portal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test-doc-portal.c b/tests/test-doc-portal.c
index dbd9c4d..f98eb92 100644
--- a/tests/test-doc-portal.c
+++ b/tests/test-doc-portal.c
@@ -98,8 +98,8 @@ export_file (const char *path, gboolean unique)
NULL,
&error);
g_object_unref (fd_list);
- g_assert (reply != NULL);
g_assert_no_error (error);
+ g_assert (reply != NULL);
g_variant_get (reply, "(s)", &doc_id);
g_assert (doc_id != NULL);
@@ -233,8 +233,8 @@ main (int argc, char **argv)
g_setenv ("XDG_RUNTIME_DIR", outdir, TRUE);
g_spawn_command_line_sync (DOC_PORTAL " -d", NULL, NULL, &exit_status, &error);
- g_assert_cmpint (exit_status, ==, 0);
g_assert_no_error (error);
+ g_assert_cmpint (exit_status, ==, 0);
session_bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
g_assert_no_error (error);