diff options
author | Philip Withnall <philip@tecnocode.co.uk> | 2017-08-20 20:48:14 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2017-08-20 21:16:41 +0100 |
commit | b0d49cf834138d3c2a54a7e647cfcb972b617b3a (patch) | |
tree | db97bf65028ad30337644055bd1d47f56ee8a5ad /libappstream-glib/as-self-test.c | |
parent | b4fff5c46940c1393807a9b9f7f74a4170bba819 (diff) | |
download | appstream-glib-b0d49cf834138d3c2a54a7e647cfcb972b617b3a.tar.gz |
libappstream-glib/self-test: Add some additional checks
A few more assertions in the tests, as suggested by Coverity, covering
return values which aren’t currently checked.
Coverity CIDs: 1454186, 1454188
Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
Diffstat (limited to 'libappstream-glib/as-self-test.c')
-rw-r--r-- | libappstream-glib/as-self-test.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libappstream-glib/as-self-test.c b/libappstream-glib/as-self-test.c index 4006145..fe1987d 100644 --- a/libappstream-glib/as-self-test.c +++ b/libappstream-glib/as-self-test.c @@ -227,7 +227,7 @@ as_test_monitor_dir_func (void) /* rename the file */ cnt_added = cnt_removed = cnt_changed = 0; - g_rename (tmpfile, tmpfile_new); + g_assert_cmpint (g_rename (tmpfile, tmpfile_new), ==, 0); as_test_loop_run_with_timeout (2000); as_test_loop_quit (); g_assert_cmpint (cnt_added, ==, 1); @@ -2194,6 +2194,8 @@ as_test_app_validate_file_bad_func (void) /* again, harder */ probs2 = as_app_validate (app, AS_APP_VALIDATE_FLAG_STRICT, &error); + g_assert_no_error (error); + g_assert (probs2 != NULL); as_test_app_validate_check (probs2, AS_PROBLEM_KIND_TAG_INVALID, "XML data contains unknown tag"); g_assert_cmpint (probs2->len, ==, 41); |