diff options
author | Josh Blum <josh@joshknows.com> | 2011-11-07 18:47:29 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-11-07 18:47:29 -0800 |
commit | e219ad10a6e86cd4edc748f2218e01a9890e108c (patch) | |
tree | 372f2e426781de9885889bec6aa98697006268ec /host/tests/ranges_test.cpp | |
parent | 8ff8f206d317e8d9c026fef9228a80edc241f9d4 (diff) | |
parent | 11f1390bbde65c60f45962acb128cac1ce21e474 (diff) | |
download | uhd-e219ad10a6e86cd4edc748f2218e01a9890e108c.tar.gz uhd-e219ad10a6e86cd4edc748f2218e01a9890e108c.tar.bz2 uhd-e219ad10a6e86cd4edc748f2218e01a9890e108c.zip |
Merge branch 'uhd_next'
Diffstat (limited to 'host/tests/ranges_test.cpp')
-rw-r--r-- | host/tests/ranges_test.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/host/tests/ranges_test.cpp b/host/tests/ranges_test.cpp index 5f6de4645..85bb4c3c4 100644 --- a/host/tests/ranges_test.cpp +++ b/host/tests/ranges_test.cpp @@ -55,3 +55,16 @@ BOOST_AUTO_TEST_CASE(test_ranges_clip){ BOOST_CHECK_CLOSE(mr.clip(50.9, false), 50.9, tolerance); BOOST_CHECK_CLOSE(mr.clip(50.9, true), 51.0, tolerance); } + +BOOST_AUTO_TEST_CASE(test_ranges_clip2){ + meta_range_t mr; + mr.push_back(range_t(1.)); + mr.push_back(range_t(2.)); + mr.push_back(range_t(3.)); + + BOOST_CHECK_CLOSE(mr.clip(2., true), 2., tolerance); + BOOST_CHECK_CLOSE(mr.clip(0., true), 1., tolerance); + BOOST_CHECK_CLOSE(mr.clip(1.2, true), 1., tolerance); + BOOST_CHECK_CLOSE(mr.clip(3.1, true), 3., tolerance); + BOOST_CHECK_CLOSE(mr.clip(4., true), 3., tolerance); +} |