This repository has been archived on 2020-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Files
Indoor/tests/math/TestMovingAVG.cpp
FrankE ec86b07c43 new geo functions
changed the walkers
added moving average
fixed the interpolator
new test-cases
2016-01-30 19:49:18 +01:00

22 lines
368 B
C++

#ifdef WITH_TESTS
#include "../Tests.h"
#include "../../math/MovingAVG.h"
TEST(MovingAVG, add) {
MovingAVG<float> avg(3);
avg.add(1); ASSERT_EQ(1, avg.get());
avg.add(1); ASSERT_EQ(1, avg.get());
avg.add(1); ASSERT_EQ(1, avg.get());
avg.add(4); ASSERT_EQ(2, avg.get());
avg.add(4); ASSERT_EQ(3, avg.get());
avg.add(4); ASSERT_EQ(4, avg.get());
}
#endif