aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-01-15 15:04:03 -0800
committerBrent Stapleton <brent.stapleton@ettus.com>2019-01-18 09:37:12 -0800
commit7fab6b807ef5b86c97577170b7b5fdc667e3fa20 (patch)
tree0cdb0ab0711599d36f192c77a6129abbf235ad73 /host/tests
parent11c7e561fc29b56ade8ae6ec549b21c533540e8a (diff)
downloaduhd-7fab6b807ef5b86c97577170b7b5fdc667e3fa20.tar.gz
uhd-7fab6b807ef5b86c97577170b7b5fdc667e3fa20.tar.bz2
uhd-7fab6b807ef5b86c97577170b7b5fdc667e3fa20.zip
math: Replace boost::*::{lcm,gcd}() with portable versions
Boost changed the lcm() and gcd() functions in Boost 1.67. This creates portable UHD versions to be used instead. They use various Boost versions under the hood conditionally.
Diffstat (limited to 'host/tests')
-rw-r--r--host/tests/math_test.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/host/tests/math_test.cpp b/host/tests/math_test.cpp
index 575cfe071..4714f6625 100644
--- a/host/tests/math_test.cpp
+++ b/host/tests/math_test.cpp
@@ -9,8 +9,12 @@
#include <stdint.h>
#include <boost/test/unit_test.hpp>
-// We need an empty test
-BOOST_AUTO_TEST_CASE(test_)
+BOOST_AUTO_TEST_CASE(test_lcm)
{
- BOOST_CHECK_EQUAL(true, true);
+ BOOST_CHECK_EQUAL(uhd::math::lcm<int>(2, 3), 6);
+}
+
+BOOST_AUTO_TEST_CASE(test_gcd)
+{
+ BOOST_CHECK_EQUAL(uhd::math::gcd<int>(6, 15), 3);
}