aboutsummaryrefslogtreecommitdiffstats
path: root/host/test
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-06-24 20:29:11 -0700
committerJosh Blum <josh@joshknows.com>2010-06-24 20:29:11 -0700
commit51cb8da5837adacbc626ee20aa58264e1b4b7a78 (patch)
treef83bd594377bcafd7e42b92be82ccc157f6e888c /host/test
parentfadd3a44a84e061412accd35c1c97db820190df8 (diff)
downloaduhd-51cb8da5837adacbc626ee20aa58264e1b4b7a78.tar.gz
uhd-51cb8da5837adacbc626ee20aa58264e1b4b7a78.tar.bz2
uhd-51cb8da5837adacbc626ee20aa58264e1b4b7a78.zip
uhd: reworked time_spec_t to be more flexible: arithmetic, comparison operators...
Replaced nsecs with fractional seconds in units of seconds. Replaced nsecs and secs members with public function members. time_spec_t has a more diverse set of constructors and methods. It can handle the cases where frac secs are greater than 1 second.
Diffstat (limited to 'host/test')
-rw-r--r--host/test/vrt_test.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/host/test/vrt_test.cpp b/host/test/vrt_test.cpp
index 3e596164c..3776e33aa 100644
--- a/host/test/vrt_test.cpp
+++ b/host/test/vrt_test.cpp
@@ -66,8 +66,8 @@ static void pack_and_unpack(
}
BOOST_CHECK_EQUAL(metadata.has_time_spec, metadata_out.has_time_spec);
if (metadata.has_time_spec and metadata_out.has_time_spec){
- BOOST_CHECK_EQUAL(metadata.time_spec.secs, metadata_out.time_spec.secs);
- BOOST_CHECK_EQUAL(metadata.time_spec.nsecs, metadata_out.time_spec.nsecs);
+ BOOST_CHECK_EQUAL(metadata.time_spec.get_full_secs(), metadata_out.time_spec.get_full_secs());
+ BOOST_CHECK_EQUAL(metadata.time_spec.get_frac_secs(), metadata_out.time_spec.get_frac_secs());
}
}
@@ -86,8 +86,7 @@ BOOST_AUTO_TEST_CASE(test_with_sid){
BOOST_AUTO_TEST_CASE(test_with_time_spec){
uhd::tx_metadata_t metadata;
metadata.has_time_spec = true;
- metadata.time_spec.secs = 7;
- metadata.time_spec.nsecs = 2000;
+ metadata.time_spec = uhd::time_spec_t(7, 0.2);
pack_and_unpack(metadata, 500, 3);
}
@@ -96,7 +95,6 @@ BOOST_AUTO_TEST_CASE(test_with_sid_and_time_spec){
metadata.has_stream_id = true;
metadata.stream_id = 2;
metadata.has_time_spec = true;
- metadata.time_spec.secs = 5;
- metadata.time_spec.nsecs = 1000;
+ metadata.time_spec = uhd::time_spec_t(5, 0.1);
pack_and_unpack(metadata, 600, 4);
}