From 23fa62e44a09be6969cfc55399323bd22dbd6421 Mon Sep 17 00:00:00 2001 From: Mikhail Baranov Date: Wed, 29 May 2024 17:22:40 +0200 Subject: [PATCH] MovStats: fmt --- src/internal_modules/roc_core/mov_stats.h | 1 - src/tests/roc_core/test_mov_stats.cpp | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/internal_modules/roc_core/mov_stats.h b/src/internal_modules/roc_core/mov_stats.h index ece7bb12d..6271acd4c 100644 --- a/src/internal_modules/roc_core/mov_stats.h +++ b/src/internal_modules/roc_core/mov_stats.h @@ -46,7 +46,6 @@ template class MovStats { , curr_max_(T(0)) , queue_min_(arena, win_len + 1) , curr_min_(T(0)) { - if (win_len == 0) { roc_panic("mov stats: window length must be greater than 0"); } diff --git a/src/tests/roc_core/test_mov_stats.cpp b/src/tests/roc_core/test_mov_stats.cpp index 21f26a814..4b74c6e9f 100644 --- a/src/tests/roc_core/test_mov_stats.cpp +++ b/src/tests/roc_core/test_mov_stats.cpp @@ -53,17 +53,17 @@ TEST(movstats, single_pass) { double target_avg = 0; double target_var = 0; for (size_t i = 0; i < n; i++) { - x[i] = int64_t (i * n); + x[i] = int64_t(i * n); stats.add(x[i]); target_avg = target_var = 0; for (size_t j = 0; j <= i; ++j) { target_avg += double(x[j]); } - target_avg /= double(i+1); + target_avg /= double(i + 1); for (size_t j = 0; j <= i; ++j) { target_var += (double)(x[j] - target_avg) * (double)(x[j] - target_avg); } - target_var = sqrt(target_var / double (i + 1)); + target_var = sqrt(target_var / double(i + 1)); LONGS_EQUAL((int64_t)target_avg, stats.mov_avg()); LONGS_EQUAL((int64_t)target_var, stats.mov_var()); }