Files
MapLibreParticleLab/test/math/wrap.test.cpp
Bart Louwers 550f64be22 core: rename mbgl namespace to mln (#4487)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-08-14 23:25:20 +02:00

27 lines
555 B
C++

#include <mbgl/test/util.hpp>
#include <mbgl/util/constants.hpp>
#include <mbgl/math/wrap.hpp>
using namespace mln;
TEST(Math, WrapHigherValue) {
ASSERT_DOUBLE_EQ(4.0, util::wrap(16.0, 0.0, 12.0));
}
TEST(Math, WrapLowerValue) {
ASSERT_DOUBLE_EQ(9.0, util::wrap(-3.0, 0.0, 12.0));
}
TEST(Math, WrapInRangeValue) {
ASSERT_DOUBLE_EQ(4.0, util::wrap(4.0, 0.0, 12.0));
}
TEST(Math, WrapMaxValue) {
ASSERT_DOUBLE_EQ(0.0, util::wrap(12.0, 0.0, 12.0));
}
TEST(Math, WrapMinValue) {
ASSERT_DOUBLE_EQ(0.0, util::wrap(0.0, 0.0, 12.0));
}