From: Yu Watanabe Date: Sat, 3 Sep 2022 15:02:38 +0000 (+0900) Subject: test: check returned values are always initialized on success X-Git-Tag: v252-rc1~262^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F24550%2Fhead;p=thirdparty%2Fsystemd.git test: check returned values are always initialized on success --- diff --git a/src/test/test-bootspec.c b/src/test/test-bootspec.c index 3c645a3e799..67fa8beea91 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);