Skip to contentSkip to conversation

test-throttle: don't shadow 'index' variable in do_test_accounting()

PATCH In review Alberto Garcia 2 participants 2 messages Sep 22, 2023 – Sep 29, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test-throttle: don't shadow 'index' variable in do_test_accounting()

Fixes build with -Wshadow=local

---
 tests/unit/test-throttle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/unit/test-throttle.c +1 -1
index cb587e33e7..ac35d65d19 100644
@@ -625,7 +625,7 @@ static bool do_test_accounting(bool is_ops, /* are we testing bps or ops */
     throttle_config_init(&cfg);
 
     for (i = 0; i < 3; i++) {
-        BucketType index = to_test[is_ops][i];
+        index = to_test[is_ops][i];
         cfg.buckets[index].avg = avg;
     }
 
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · Alberto Garcia

Fixes build with -Wshadow=local

---
 tests/unit/test-throttle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/unit/test-throttle.c +0 -0
index cb587e33e7..ac35d65d19 100644

tests/unit/test-throttle.c static bool do_test_accounting(bool is_ops, /* are we testing bps or ops */ · line 630

Quoted 7 lines
tests/unit/test-throttle.c +1 -1
@@ -625,7 +625,7 @@ static bool do_test_accounting(bool is_ops, /* are we testing bps or ops */
     throttle_config_init(&cfg);
 
     for (i = 0; i < 3; i++) {
-        BucketType index = to_test[is_ops][i];
+        index = to_test[is_ops][i];
         cfg.buckets[index].avg = avg;
     }

and queued, thanks!