uhd/host/tests/math_test.cpp

21 lines
422 B
C++
Raw Normal View History

2014-10-23 16:07:07 +00:00
//
// Copyright 2014 Ettus Research LLC
// Copyright 2018 Ettus Research, a National Instruments Company
2014-10-23 16:07:07 +00:00
//
// SPDX-License-Identifier: GPL-3.0-or-later
2014-10-23 16:07:07 +00:00
//
#include <uhd/utils/math.hpp>
#include <stdint.h>
#include <boost/test/unit_test.hpp>
2014-10-23 16:07:07 +00:00
BOOST_AUTO_TEST_CASE(test_lcm)
{
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);
2014-10-23 16:07:07 +00:00
}