aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests/math_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/tests/math_test.cpp')
-rw-r--r--host/tests/math_test.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/host/tests/math_test.cpp b/host/tests/math_test.cpp
index 4714f6625..bff6fc16f 100644
--- a/host/tests/math_test.cpp
+++ b/host/tests/math_test.cpp
@@ -6,7 +6,6 @@
//
#include <uhd/utils/math.hpp>
-#include <stdint.h>
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_CASE(test_lcm)
@@ -18,3 +17,13 @@ BOOST_AUTO_TEST_CASE(test_gcd)
{
BOOST_CHECK_EQUAL(uhd::math::gcd<int>(6, 15), 3);
}
+
+BOOST_AUTO_TEST_CASE(test_interp)
+{
+ const double x0 = 1.0, x1 = 2.0;
+ const double y0 = 2.0, y1 = 4.0;
+ const double x = 1.5;
+ const double y_exp = 3.0;
+
+ BOOST_CHECK_EQUAL(uhd::math::linear_interp<double>(x, x0, y0, x1, y1), y_exp);
+}