mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
test-execute: simplify condition
tests is always a static array, it cannot be NULL.
This commit is contained in:
@@ -782,7 +782,6 @@ typedef struct test_entry {
|
||||
#define entry(x) {x, #x}
|
||||
|
||||
static int run_tests(UnitFileScope scope, const test_entry tests[], char **patterns) {
|
||||
const test_entry *test = NULL;
|
||||
_cleanup_(manager_freep) Manager *m = NULL;
|
||||
int r;
|
||||
|
||||
@@ -795,7 +794,7 @@ static int run_tests(UnitFileScope scope, const test_entry tests[], char **patte
|
||||
assert_se(r >= 0);
|
||||
assert_se(manager_startup(m, NULL, NULL) >= 0);
|
||||
|
||||
for (test = tests; test && test->f; test++)
|
||||
for (const test_entry *test = tests; test->f; test++)
|
||||
if (strv_fnmatch_or_empty(patterns, test->name, FNM_NOESCAPE))
|
||||
test->f(m);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user