summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2021-12-21 14:24:03 -0500
committerColin Walters <walters@verbum.org>2021-12-21 15:14:34 -0500
commitd2f5a0476f37973d2027029662f41413d2d8e243 (patch)
tree6f671a7849560f578420fe60b99246a804873b7e
parent27c14f2be63e959d486fd9d91231e493f27739ba (diff)
downloadostree-d2f5a0476f37973d2027029662f41413d2d8e243.tar.gz
tests: Fix clang-analyzer not seeing through `g_error()`
Basically due to the glib structured logging rework we lost the `noreturn` attribute on `g_error()`. This is fixed in glib as of https://gitlab.gnome.org/GNOME/glib/-/commit/f97ff20adf4eb7b952dd83e2c13046fe9e282f50 But we might as well just throw an error here.
-rw-r--r--tests/test-commit-sign-sh-ext.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test-commit-sign-sh-ext.c b/tests/test-commit-sign-sh-ext.c
index dee22573..6dc287d9 100644
--- a/tests/test-commit-sign-sh-ext.c
+++ b/tests/test-commit-sign-sh-ext.c
@@ -80,26 +80,26 @@ run (GError **error)
if (ostree_repo_signature_verify_commit_data (repo, "origin", commit_bytes, detached_meta_bytes,
OSTREE_REPO_VERIFY_FLAGS_NO_GPG | OSTREE_REPO_VERIFY_FLAGS_NO_SIGNAPI,
&verify_report, error))
- g_error ("Should not have validated");
+ return glnx_throw (error, "Should not have validated");
assert_error_contains (error, "No commit verification types enabled");
// No signatures
g_autoptr(GBytes) empty = g_bytes_new_static ("", 0);
if (ostree_repo_signature_verify_commit_data (repo, "origin", commit_bytes, empty, 0,
&verify_report, error))
- g_error ("Should not have validated");
+ return glnx_throw (error, "Should not have validated");
assert_error_contains (error, "no signatures found");
// No such remote
if (ostree_repo_signature_verify_commit_data (repo, "nosuchremote", commit_bytes, detached_meta_bytes, 0,
&verify_report, error))
- g_error ("Should not have validated");
+ return glnx_throw (error, "Should not have validated");
assert_error_contains (error, "Remote \"nosuchremote\" not found");
// Corrupted commit
g_autoptr(GBytes) corrupted_commit = corrupt (commit_bytes);
if (ostree_repo_signature_verify_commit_data (repo, "origin", corrupted_commit, detached_meta_bytes, 0,
&verify_report, error))
- g_error ("Should not have validated");
+ return glnx_throw (error, "Should not have validated");
assert_error_contains (error, "BAD signature");
return TRUE;