mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-13 21:06:17 +01:00
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:
parent
a9900b774a
commit
a86c994255
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user