diff options
-rw-r--r-- | tests/test-throttle.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/test-throttle.c b/tests/test-throttle.c index 0e7c7e0..3e208a8 100644 --- a/tests/test-throttle.c +++ b/tests/test-throttle.c @@ -222,6 +222,8 @@ static void set_cfg_value(bool is_max, int index, int value) { if (is_max) { cfg.buckets[index].max = value; + /* If max is set, avg should never be 0 */ + cfg.buckets[index].avg = MAX(cfg.buckets[index].avg, 1); } else { cfg.buckets[index].avg = value; } |