aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests/sid_t_test.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2016-10-31 14:30:52 -0700
committerMartin Braun <martin.braun@ettus.com>2016-11-08 08:02:22 -0800
commit99c2730bc9db270560671f2d7d173768465ed51f (patch)
treebc4df495734a075ebe2f7917cf67dec6fb7d8177 /host/tests/sid_t_test.cpp
parent218f4b0b63927110df9dbbaa8353c346eee2d98a (diff)
downloaduhd-99c2730bc9db270560671f2d7d173768465ed51f.tar.gz
uhd-99c2730bc9db270560671f2d7d173768465ed51f.tar.bz2
uhd-99c2730bc9db270560671f2d7d173768465ed51f.zip
Remove all boost:: namespace prefix for uint32_t, int32_t etc. (fixed-width types)
- Also removes all references to boost/cstdint.hpp and replaces it with stdint.h (The 'correct' replacement would be <cstdint>, but not all of our compilers support that).
Diffstat (limited to 'host/tests/sid_t_test.cpp')
-rw-r--r--host/tests/sid_t_test.cpp128
1 files changed, 64 insertions, 64 deletions
diff --git a/host/tests/sid_t_test.cpp b/host/tests/sid_t_test.cpp
index 31eb4b458..2043398a1 100644
--- a/host/tests/sid_t_test.cpp
+++ b/host/tests/sid_t_test.cpp
@@ -24,22 +24,22 @@
using uhd::sid_t;
BOOST_AUTO_TEST_CASE(test_sid_t) {
- boost::uint32_t sid_value = 0x01020310;
+ uint32_t sid_value = 0x01020310;
sid_t sid(sid_value);
BOOST_CHECK_EQUAL(sid.is_set(), true);
BOOST_CHECK_EQUAL(sid.to_pp_string(), "1.2>3.16");
BOOST_CHECK_EQUAL(sid.to_pp_string_hex(), "01:02>03:10");
- BOOST_CHECK_EQUAL(sid.get_src(), (boost::uint32_t)0x0102);
- BOOST_CHECK_EQUAL(sid.get_dst(), (boost::uint32_t)0x0310);
- BOOST_CHECK_EQUAL(sid.get_src_addr(), (boost::uint32_t)0x01);
- BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (boost::uint32_t)0x02);
- BOOST_CHECK_EQUAL(sid.get_dst_addr(), (boost::uint32_t)0x03);
- BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (boost::uint32_t)0x10);
+ BOOST_CHECK_EQUAL(sid.get_src(), (uint32_t)0x0102);
+ BOOST_CHECK_EQUAL(sid.get_dst(), (uint32_t)0x0310);
+ BOOST_CHECK_EQUAL(sid.get_src_addr(), (uint32_t)0x01);
+ BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (uint32_t)0x02);
+ BOOST_CHECK_EQUAL(sid.get_dst_addr(), (uint32_t)0x03);
+ BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (uint32_t)0x10);
BOOST_CHECK_EQUAL(sid == sid, true);
BOOST_CHECK_EQUAL(sid == sid_value, true);
- boost::uint32_t check_sid_val = (boost::uint32_t) sid;
+ uint32_t check_sid_val = (uint32_t) sid;
BOOST_CHECK_EQUAL(check_sid_val, sid_value);
std::stringstream ss_dec;
@@ -64,92 +64,92 @@ BOOST_AUTO_TEST_CASE(test_sid_t) {
}
BOOST_AUTO_TEST_CASE(test_sid_t_set) {
- boost::uint32_t sid_value = 0x0;
+ uint32_t sid_value = 0x0;
sid_t sid(sid_value);
sid.set(0x01020304);
- BOOST_CHECK_EQUAL(sid.get(), (boost::uint32_t)0x01020304);
- BOOST_CHECK_EQUAL(sid.get_src_addr(),(boost::uint32_t)0x01);
- BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (boost::uint32_t)0x02);
- BOOST_CHECK_EQUAL(sid.get_dst_addr(), (boost::uint32_t)0x03);
- BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (boost::uint32_t)0x04);
- BOOST_CHECK_EQUAL(sid.get_dst_xbarport(), (boost::uint32_t)0x0);
- BOOST_CHECK_EQUAL(sid.get_dst_blockport(), (boost::uint32_t)0x4);
+ BOOST_CHECK_EQUAL(sid.get(), (uint32_t)0x01020304);
+ BOOST_CHECK_EQUAL(sid.get_src_addr(),(uint32_t)0x01);
+ BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (uint32_t)0x02);
+ BOOST_CHECK_EQUAL(sid.get_dst_addr(), (uint32_t)0x03);
+ BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (uint32_t)0x04);
+ BOOST_CHECK_EQUAL(sid.get_dst_xbarport(), (uint32_t)0x0);
+ BOOST_CHECK_EQUAL(sid.get_dst_blockport(), (uint32_t)0x4);
sid.set_src_addr(0x0a);
- BOOST_CHECK_EQUAL(sid.get(), (boost::uint32_t)0x0a020304);
- BOOST_CHECK_EQUAL(sid.get_src_addr(), (boost::uint32_t)0x0a);
- BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (boost::uint32_t)0x02);
- BOOST_CHECK_EQUAL(sid.get_dst_addr(), (boost::uint32_t)0x03);
- BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (boost::uint32_t)0x04);
+ BOOST_CHECK_EQUAL(sid.get(), (uint32_t)0x0a020304);
+ BOOST_CHECK_EQUAL(sid.get_src_addr(), (uint32_t)0x0a);
+ BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (uint32_t)0x02);
+ BOOST_CHECK_EQUAL(sid.get_dst_addr(), (uint32_t)0x03);
+ BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (uint32_t)0x04);
sid.set_src_endpoint(0x0b);
- BOOST_CHECK_EQUAL(sid.get(), (boost::uint32_t)0x0a0b0304);
- BOOST_CHECK_EQUAL(sid.get_src_addr(), (boost::uint32_t)0x0a);
- BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (boost::uint32_t)0x0b);
- BOOST_CHECK_EQUAL(sid.get_dst_addr(), (boost::uint32_t)0x03);
- BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (boost::uint32_t)0x04);
+ BOOST_CHECK_EQUAL(sid.get(), (uint32_t)0x0a0b0304);
+ BOOST_CHECK_EQUAL(sid.get_src_addr(), (uint32_t)0x0a);
+ BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (uint32_t)0x0b);
+ BOOST_CHECK_EQUAL(sid.get_dst_addr(), (uint32_t)0x03);
+ BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (uint32_t)0x04);
sid.set_dst_addr(0x0c);
- BOOST_CHECK_EQUAL(sid.get(), (boost::uint32_t)0x0a0b0c04);
- BOOST_CHECK_EQUAL(sid.get_src_addr(), (boost::uint32_t)0x0a);
- BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (boost::uint32_t)0x0b);
- BOOST_CHECK_EQUAL(sid.get_dst_addr(), (boost::uint32_t)0x0c);
- BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (boost::uint32_t)0x04);
+ BOOST_CHECK_EQUAL(sid.get(), (uint32_t)0x0a0b0c04);
+ BOOST_CHECK_EQUAL(sid.get_src_addr(), (uint32_t)0x0a);
+ BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (uint32_t)0x0b);
+ BOOST_CHECK_EQUAL(sid.get_dst_addr(), (uint32_t)0x0c);
+ BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (uint32_t)0x04);
sid.set_dst_endpoint(0x0d);
- BOOST_CHECK_EQUAL(sid.get(), (boost::uint32_t)0x0a0b0c0d);
- BOOST_CHECK_EQUAL(sid.get_src_addr(), (boost::uint32_t)0x0a);
- BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (boost::uint32_t)0x0b);
- BOOST_CHECK_EQUAL(sid.get_dst_addr(), (boost::uint32_t)0x0c);
- BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (boost::uint32_t)0x0d);
+ BOOST_CHECK_EQUAL(sid.get(), (uint32_t)0x0a0b0c0d);
+ BOOST_CHECK_EQUAL(sid.get_src_addr(), (uint32_t)0x0a);
+ BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (uint32_t)0x0b);
+ BOOST_CHECK_EQUAL(sid.get_dst_addr(), (uint32_t)0x0c);
+ BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (uint32_t)0x0d);
sid.set_dst_xbarport(0xb);
- BOOST_CHECK_EQUAL(sid.get(), (boost::uint32_t)0x0a0b0cbd);
- BOOST_CHECK_EQUAL(sid.get_src_addr(), (boost::uint32_t)0x0a);
- BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (boost::uint32_t)0x0b);
- BOOST_CHECK_EQUAL(sid.get_dst_addr(), (boost::uint32_t)0x0c);
- BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (boost::uint32_t)0xbd);
+ BOOST_CHECK_EQUAL(sid.get(), (uint32_t)0x0a0b0cbd);
+ BOOST_CHECK_EQUAL(sid.get_src_addr(), (uint32_t)0x0a);
+ BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (uint32_t)0x0b);
+ BOOST_CHECK_EQUAL(sid.get_dst_addr(), (uint32_t)0x0c);
+ BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (uint32_t)0xbd);
sid.set_dst_blockport(0xc);
- BOOST_CHECK_EQUAL(sid.get(), (boost::uint32_t)0x0a0b0cbc);
- BOOST_CHECK_EQUAL(sid.get_src_addr(), (boost::uint32_t)0x0a);
- BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (boost::uint32_t)0x0b);
- BOOST_CHECK_EQUAL(sid.get_dst_addr(), (boost::uint32_t)0x0c);
- BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (boost::uint32_t)0xbc);
+ BOOST_CHECK_EQUAL(sid.get(), (uint32_t)0x0a0b0cbc);
+ BOOST_CHECK_EQUAL(sid.get_src_addr(), (uint32_t)0x0a);
+ BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (uint32_t)0x0b);
+ BOOST_CHECK_EQUAL(sid.get_dst_addr(), (uint32_t)0x0c);
+ BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (uint32_t)0xbc);
sid_t flipped_sid = sid.reversed();
- BOOST_CHECK_EQUAL(flipped_sid.get(), (boost::uint32_t)0x0cbc0a0b);
+ BOOST_CHECK_EQUAL(flipped_sid.get(), (uint32_t)0x0cbc0a0b);
// In-place
sid.reverse();
- BOOST_CHECK_EQUAL(sid.get(), (boost::uint32_t)0x0cbc0a0b);
+ BOOST_CHECK_EQUAL(sid.get(), (uint32_t)0x0cbc0a0b);
}
BOOST_AUTO_TEST_CASE(test_sid_t_from_str) {
sid_t sid("1.2>3.4");
- BOOST_CHECK_EQUAL(sid.get_src_addr(), (boost::uint32_t)1);
- BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (boost::uint32_t)2);
- BOOST_CHECK_EQUAL(sid.get_dst_addr(), (boost::uint32_t)3);
- BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (boost::uint32_t)4);
+ BOOST_CHECK_EQUAL(sid.get_src_addr(), (uint32_t)1);
+ BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (uint32_t)2);
+ BOOST_CHECK_EQUAL(sid.get_dst_addr(), (uint32_t)3);
+ BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (uint32_t)4);
sid = "01:02>03:10";
- BOOST_CHECK_EQUAL(sid.get_src_addr(), (boost::uint32_t)1);
- BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (boost::uint32_t)2);
- BOOST_CHECK_EQUAL(sid.get_dst_addr(), (boost::uint32_t)3);
- BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (boost::uint32_t)16);
+ BOOST_CHECK_EQUAL(sid.get_src_addr(), (uint32_t)1);
+ BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (uint32_t)2);
+ BOOST_CHECK_EQUAL(sid.get_dst_addr(), (uint32_t)3);
+ BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (uint32_t)16);
sid = "01:06/03:10";
- BOOST_CHECK_EQUAL(sid.get_src_addr(), (boost::uint32_t)1);
- BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (boost::uint32_t)6);
- BOOST_CHECK_EQUAL(sid.get_dst_addr(), (boost::uint32_t)3);
- BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (boost::uint32_t)16);
+ BOOST_CHECK_EQUAL(sid.get_src_addr(), (uint32_t)1);
+ BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (uint32_t)6);
+ BOOST_CHECK_EQUAL(sid.get_dst_addr(), (uint32_t)3);
+ BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (uint32_t)16);
sid = "01:02:04:10";
- BOOST_CHECK_EQUAL(sid.get_src_addr(), (boost::uint32_t)1);
- BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (boost::uint32_t)2);
- BOOST_CHECK_EQUAL(sid.get_dst_addr(), (boost::uint32_t)4);
- BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (boost::uint32_t)16);
+ BOOST_CHECK_EQUAL(sid.get_src_addr(), (uint32_t)1);
+ BOOST_CHECK_EQUAL(sid.get_src_endpoint(), (uint32_t)2);
+ BOOST_CHECK_EQUAL(sid.get_dst_addr(), (uint32_t)4);
+ BOOST_CHECK_EQUAL(sid.get_dst_endpoint(), (uint32_t)16);
BOOST_REQUIRE_THROW(sid_t fail_sid("foobar"), uhd::value_error);
BOOST_REQUIRE_THROW(sid_t fail_sid("01:02:03:4"), uhd::value_error);