mirror of
https://github.com/systemd/systemd.git
synced 2024-12-24 09:33:32 +08:00
test-execute: simplify condition
tests is always a static array, it cannot be NULL.
This commit is contained in:
parent
459c41b9e2
commit
f90d2d7bf1
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user