summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-09-03 17:02:38 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-09-03 17:02:38 +0200
commitb488c59c9fa06e7ec4108469f042e6f8d3751db2 (patch)
tree3f64259fed7285edeed92bbdc79d27ae39f253e4
parentbootspec: shorten code a bit (diff)
downloadsystemd-b488c59c9fa06e7ec4108469f042e6f8d3751db2.tar.xz
systemd-b488c59c9fa06e7ec4108469f042e6f8d3751db2.zip
test: check returned values are always initialized on success
-rw-r--r--src/test/test-bootspec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/test/test-bootspec.c b/src/test/test-bootspec.c
index 3c645a3e79..67fa8beea9 100644
--- a/src/test/test-bootspec.c
+++ b/src/test/test-bootspec.c
@@ -95,9 +95,12 @@ TEST_RET(bootspec_sort) {
static void test_extract_tries_one(const char *fname, int ret, const char *stripped, unsigned tries_left, unsigned tries_done) {
_cleanup_free_ char *p = NULL;
- unsigned l = UINT_MAX, d = UINT_MAX;
+ unsigned l, d;
assert_se(boot_filename_extract_tries(fname, &p, &l, &d) == ret);
+ if (ret < 0)
+ return;
+
assert_se(streq_ptr(p, stripped));
assert_se(l == tries_left);
assert_se(d == tries_done);