diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-09-28 11:45:33 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2016-09-28 16:34:22 +0200 |
commit | 3f3fc7b7723698e44427e2a14a2f4906832800bf (patch) | |
tree | 5acadfa4d77817c41f612c89c93925a149cbcfc0 /test/math/wrap.test.cpp | |
parent | a8b007daa0e85ea4b1a4898fd591d55d0117cc85 (diff) | |
download | qtlocation-mapboxgl-3f3fc7b7723698e44427e2a14a2f4906832800bf.tar.gz |
[test] add .test.cpp suffix to test case files
Diffstat (limited to 'test/math/wrap.test.cpp')
-rw-r--r-- | test/math/wrap.test.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/math/wrap.test.cpp b/test/math/wrap.test.cpp new file mode 100644 index 0000000000..9ec1c6ef0c --- /dev/null +++ b/test/math/wrap.test.cpp @@ -0,0 +1,26 @@ +#include <mbgl/test/util.hpp> + +#include <mbgl/util/constants.hpp> +#include <mbgl/math/wrap.hpp> + +using namespace mbgl; + +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)); +}
\ No newline at end of file |