aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests
diff options
context:
space:
mode:
Diffstat (limited to 'host/tests')
-rw-r--r--host/tests/ranges_test.cpp9
-rw-r--r--host/tests/subdev_spec_test.cpp8
2 files changed, 17 insertions, 0 deletions
diff --git a/host/tests/ranges_test.cpp b/host/tests/ranges_test.cpp
index 85bb4c3c4..49607b9a3 100644
--- a/host/tests/ranges_test.cpp
+++ b/host/tests/ranges_test.cpp
@@ -68,3 +68,12 @@ BOOST_AUTO_TEST_CASE(test_ranges_clip2){
BOOST_CHECK_CLOSE(mr.clip(3.1, true), 3., tolerance);
BOOST_CHECK_CLOSE(mr.clip(4., true), 3., tolerance);
}
+
+BOOST_AUTO_TEST_CASE(test_ranges_compare){
+ range_t range(1);
+ range_t n_range(1);
+ range_t d_range(2);
+
+ BOOST_CHECK(range == n_range);
+ BOOST_CHECK(range != d_range);
+}
diff --git a/host/tests/subdev_spec_test.cpp b/host/tests/subdev_spec_test.cpp
index 2c4747fa9..81f86380b 100644
--- a/host/tests/subdev_spec_test.cpp
+++ b/host/tests/subdev_spec_test.cpp
@@ -27,6 +27,11 @@ BOOST_AUTO_TEST_CASE(test_subdevice_spec){
sd_spec.push_back(uhd::usrp::subdev_spec_pair_t("A", "AB"));
sd_spec.push_back(uhd::usrp::subdev_spec_pair_t("B", "AB"));
+ //create a subdev_spec with something different
+ uhd::usrp::subdev_spec_t diff_sd_spec;
+ diff_sd_spec.push_back(uhd::usrp::subdev_spec_pair_t("B", "BA"));
+ diff_sd_spec.push_back(uhd::usrp::subdev_spec_pair_t("B", "BA"));
+
//convert to and from args string
std::cout << "Pretty Print: " << std::endl << sd_spec.to_pp_string();
std::string markup_str = sd_spec.to_string();
@@ -40,5 +45,8 @@ BOOST_AUTO_TEST_CASE(test_subdevice_spec){
for (size_t i = 0; i < sd_spec.size(); i++){
BOOST_CHECK_EQUAL(sd_spec.at(i).db_name, new_sd_spec.at(i).db_name);
BOOST_CHECK_EQUAL(sd_spec.at(i).sd_name, new_sd_spec.at(i).sd_name);
+
+ BOOST_CHECK(sd_spec.at(i) == new_sd_spec.at(i));
+ BOOST_CHECK(sd_spec.at(i) != diff_sd_spec.at(i));
}
}