diff options
author | Josh Blum <josh@joshknows.com> | 2013-02-07 01:16:48 -0600 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2013-02-07 01:16:48 -0600 |
commit | 3cb515f73a8c3a1a568b23bd57265c7bfd266c21 (patch) | |
tree | d1a0bdc8364ffae2d59baec88fadb20ab3295236 /host/tests | |
parent | 6e8f39de53f135b246bd8c60b039aef1e917e902 (diff) | |
download | uhd-3cb515f73a8c3a1a568b23bd57265c7bfd266c21.tar.gz uhd-3cb515f73a8c3a1a568b23bd57265c7bfd266c21.tar.bz2 uhd-3cb515f73a8c3a1a568b23bd57265c7bfd266c21.zip |
uhd: added time spec unit test for large tick counts
Diffstat (limited to 'host/tests')
-rw-r--r-- | host/tests/time_spec_test.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/host/tests/time_spec_test.cpp b/host/tests/time_spec_test.cpp index 102b7cda3..139a113af 100644 --- a/host/tests/time_spec_test.cpp +++ b/host/tests/time_spec_test.cpp @@ -97,3 +97,14 @@ BOOST_AUTO_TEST_CASE(test_time_spec_neg_values){ BOOST_CHECK(tsa > tsb); BOOST_CHECK(tsc > tsd); } + +BOOST_AUTO_TEST_CASE(test_time_large_ticks_to_time_spec) +{ + std::cout << "sizeof(time_t) " << sizeof(time_t) << std::endl; + const boost::uint64_t ticks0 = boost::uint64_t(100e6*1360217663.739296); + const uhd::time_spec_t t0 = uhd::time_spec_t::from_ticks(ticks0, 100e6); + std::cout << "t0.get_real_secs() " << t0.get_real_secs() << std::endl; + std::cout << "t0.get_full_secs() " << t0.get_full_secs() << std::endl; + std::cout << "t0.get_frac_secs() " << t0.get_frac_secs() << std::endl; + BOOST_CHECK_EQUAL(t0.get_full_secs(), time_t(1360217663)); +} |