diff options
Diffstat (limited to 'host/tests')
-rw-r--r-- | host/tests/fp_compare_epsilon_test.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/host/tests/fp_compare_epsilon_test.cpp b/host/tests/fp_compare_epsilon_test.cpp index 3aa973d3e..56cdd03e8 100644 --- a/host/tests/fp_compare_epsilon_test.cpp +++ b/host/tests/fp_compare_epsilon_test.cpp @@ -258,3 +258,13 @@ BOOST_AUTO_TEST_CASE(double_greaterthanequals_operators) BOOST_CHECK(charlie >= alpha); BOOST_CHECK(double(alpha._value + 3.0008) >= alpha); } + +BOOST_AUTO_TEST_CASE(frequency_comparison) +{ + // Delta comparison + BOOST_CHECK(uhd::math::frequencies_are_equal( + 1e9, 1e9 + uhd::math::FREQ_COMPARISON_DELTA_HZ / 10)); + // Epsilon comparison below 1 mHz + BOOST_CHECK( + freq_compare_epsilon(1e9) == (1e9 + uhd::math::FREQ_COMPARE_EPSILON / 10)); +} |