aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-07-08 12:11:27 -0700
committerJosh Blum <josh@joshknows.com>2011-07-08 12:11:27 -0700
commit60933a242cce0b1ec45e9f948e3da9ab72b2fd90 (patch)
treebb89f8a0392d12255987a65fa88a3f921a3a87d5 /host
parent948a5fd05285f602292f9b8ed9a2a5734f127d75 (diff)
downloaduhd-60933a242cce0b1ec45e9f948e3da9ab72b2fd90.tar.gz
uhd-60933a242cce0b1ec45e9f948e3da9ab72b2fd90.tar.bz2
uhd-60933a242cce0b1ec45e9f948e3da9ab72b2fd90.zip
uhd: added unit test for properties subtree
Diffstat (limited to 'host')
-rw-r--r--host/tests/property_test.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/host/tests/property_test.cpp b/host/tests/property_test.cpp
index 4c1aa046c..04d3a831c 100644
--- a/host/tests/property_test.cpp
+++ b/host/tests/property_test.cpp
@@ -157,3 +157,19 @@ BOOST_AUTO_TEST_CASE(test_prop_tree){
BOOST_CHECK(not tree->exists("/test/prop1"));
}
+
+BOOST_AUTO_TEST_CASE(test_prop_subtree){
+ uhd::property_tree::sptr tree = uhd::property_tree::make();
+ tree->create<int>("/subdir1/subdir2");
+
+ uhd::property_tree::sptr subtree1 = tree->subtree("/");
+ const std::vector<std::string> tree_dirs1 = tree->list("/");
+ const std::vector<std::string> subtree1_dirs = subtree1->list("");
+ BOOST_CHECK_EQUAL_COLLECTIONS(tree_dirs1.begin(), tree_dirs1.end(), subtree1_dirs.begin(), subtree1_dirs.end());
+
+ uhd::property_tree::sptr subtree2 = subtree1->subtree("subdir1");
+ const std::vector<std::string> tree_dirs2 = tree->list("/subdir1");
+ const std::vector<std::string> subtree2_dirs = subtree2->list("");
+ BOOST_CHECK_EQUAL_COLLECTIONS(tree_dirs2.begin(), tree_dirs2.end(), subtree2_dirs.begin(), subtree2_dirs.end());
+
+}