summaryrefslogtreecommitdiff
path: root/src/test/test-strv.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-03-16 22:32:23 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-03-19 08:33:33 +0900
commitde010b0b2e50cf0b3837ce350b116bc92605f67a (patch)
tree226685fbb97461692562035501ebc21a314f718c /src/test/test-strv.c
parent80a226b26b5e00a2ef9e85d1321da44cd14d051b (diff)
downloadsystemd-de010b0b2e50cf0b3837ce350b116bc92605f67a.tar.gz
strv: make iterator in STRV_FOREACH() declaread in the loop
This also avoids multiple evaluations in STRV_FOREACH_BACKWARDS()
Diffstat (limited to 'src/test/test-strv.c')
-rw-r--r--src/test/test-strv.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/src/test/test-strv.c b/src/test/test-strv.c
index 94581fc832..ae3e2798c2 100644
--- a/src/test/test-strv.c
+++ b/src/test/test-strv.c
@@ -204,7 +204,6 @@ static void test_strv_unquote_one(const char *quoted, char **list) {
_cleanup_strv_free_ char **s;
_cleanup_free_ char *j;
unsigned i = 0;
- char **t;
int r;
log_info("/* %s */", __func__);
@@ -446,7 +445,6 @@ TEST(strv_split_colon_pairs) {
TEST(strv_split_newlines) {
unsigned i = 0;
- char **s;
_cleanup_strv_free_ char **l = NULL;
const char str[] = "one\ntwo\nthree";
@@ -619,7 +617,6 @@ TEST(strv_extendf) {
TEST(strv_foreach) {
_cleanup_strv_free_ char **a;
unsigned i = 0;
- char **check;
a = strv_new("one", "two", "three");
assert_se(a);
@@ -631,7 +628,6 @@ TEST(strv_foreach) {
TEST(strv_foreach_backwards) {
_cleanup_strv_free_ char **a;
unsigned i = 2;
- char **check;
a = strv_new("one", "two", "three");
@@ -649,7 +645,6 @@ TEST(strv_foreach_backwards) {
TEST(strv_foreach_pair) {
_cleanup_strv_free_ char **a = NULL;
- char **x, **y;
a = strv_new("pair_one", "pair_one",
"pair_two", "pair_two",