tests: Switch some assertions around

In general, we should aim to always check a `GError` before checking a
boolean, since the error message from the `GError` gives us a lot more
information about failure, which helps with debugging.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2019-11-05 10:19:36 +00:00
parent a9900b774a
commit a86c994255

View File

@ -49,20 +49,20 @@ test_to_file (void)
filename = g_test_get_filename (G_TEST_DIST, "bookmarks", "valid-01.xbel", NULL);
res = g_bookmark_file_load_from_file (bookmark, filename, &error);
g_assert_true (res);
g_assert_no_error (error);
g_assert_true (res);
res = g_bookmark_file_to_file (bookmark, "out.xbel", &error);
g_assert_true (res);
g_assert_no_error (error);
g_assert_true (res);
res = g_file_get_contents (filename, &in, NULL, &error);
g_assert_true (res);
g_assert_no_error (error);
g_assert_true (res);
res = g_file_get_contents ("out.xbel", &out, NULL, &error);
g_assert_true (res);
g_assert_no_error (error);
g_assert_true (res);
remove ("out.xbel");
g_assert_cmpstr (in, ==, out);