aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests/graph_search_test.cpp
diff options
context:
space:
mode:
authorBrent Stapleton <brent.stapleton@ettus.com>2019-01-14 10:35:25 -0800
committerBrent Stapleton <brent.stapleton@ettus.com>2019-01-16 11:40:23 -0800
commit967be2a4e82b1a125b26bb72a60318a4fb2b50c4 (patch)
tree8a24954b54d1546dc8049a17e485adb0a605f74f /host/tests/graph_search_test.cpp
parentaafe4e8b742a0e21d3818f21f34e3c8613132530 (diff)
downloaduhd-967be2a4e82b1a125b26bb72a60318a4fb2b50c4.tar.gz
uhd-967be2a4e82b1a125b26bb72a60318a4fb2b50c4.tar.bz2
uhd-967be2a4e82b1a125b26bb72a60318a4fb2b50c4.zip
uhd: mpm: apply clang-format to all files
Applying formatting changes to all .cpp and .hpp files in the following directories: ``` find host/examples/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/tests/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/lib/usrp/dboard/neon/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/lib/usrp/dboard/magnesium/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/lib/usrp/device3/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/lib/usrp/mpmd/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/lib/usrp/x300/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/utils/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find mpm/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file ``` Also formatted host/include/, except Cpp03 was used as a the language standard instead of Cpp11. ``` sed -i 's/ Cpp11/ Cpp03/g' .clang-format find host/include/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file ``` Formatting style was designated by the .clang-format file.
Diffstat (limited to 'host/tests/graph_search_test.cpp')
-rw-r--r--host/tests/graph_search_test.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/host/tests/graph_search_test.cpp b/host/tests/graph_search_test.cpp
index 8d35b3b1a..932647d98 100644
--- a/host/tests/graph_search_test.cpp
+++ b/host/tests/graph_search_test.cpp
@@ -17,7 +17,7 @@ class result_node : public test_node
public:
typedef boost::shared_ptr<result_node> sptr;
- result_node(const std::string &test_id) : test_node(test_id) {};
+ result_node(const std::string& test_id) : test_node(test_id){};
}; /* class result_node */
@@ -49,12 +49,12 @@ BOOST_AUTO_TEST_CASE(test_simple_downstream_search)
connect_nodes(node_A, node_B1);
// We're still searching for test_node, so any downstream block will match
- std::vector< test_node::sptr > result = node_A->find_downstream_node<test_node>();
+ std::vector<test_node::sptr> result = node_A->find_downstream_node<test_node>();
BOOST_REQUIRE(result.size() == 2);
BOOST_CHECK(
- (result[0]->get_test_id() == "node_B0" and result[1]->get_test_id() == "node_B1") or
- (result[1]->get_test_id() == "node_B0" and result[0]->get_test_id() == "node_B1")
- );
+ (result[0]->get_test_id() == "node_B0" and result[1]->get_test_id() == "node_B1")
+ or (result[1]->get_test_id() == "node_B0"
+ and result[0]->get_test_id() == "node_B1"));
BOOST_CHECK(result[0] == node_B0 or result[0] == node_B1);
}
@@ -69,11 +69,11 @@ BOOST_AUTO_TEST_CASE(test_linear_downstream_search)
connect_nodes(node_B, node_C);
// This time, we search for result_node
- std::vector< result_node::sptr > result = node_A->find_downstream_node<result_node>();
+ std::vector<result_node::sptr> result = node_A->find_downstream_node<result_node>();
std::cout << "size: " << result.size() << std::endl;
BOOST_CHECK_EQUAL(result.size(), 1);
BOOST_CHECK_EQUAL(result[0]->get_test_id(), "node_B");
- for(const result_node::sptr &node: result) {
+ for (const result_node::sptr& node : result) {
std::cout << node->get_test_id() << std::endl;
}
}
@@ -99,9 +99,9 @@ BOOST_AUTO_TEST_CASE(test_multi_iter_downstream_search)
connect_nodes(node_C0, node_D0);
// This time, we search for result_node
- std::vector< result_node::sptr > result = node_A->find_downstream_node<result_node>();
+ std::vector<result_node::sptr> result = node_A->find_downstream_node<result_node>();
BOOST_REQUIRE(result.size() == 4);
- for(const result_node::sptr &node: result) {
+ for (const result_node::sptr& node : result) {
std::cout << node->get_test_id() << std::endl;
}
}
@@ -120,7 +120,8 @@ BOOST_AUTO_TEST_CASE(test_multi_iter_cycle_downstream_search)
// Slightly more complex graph:
connect_nodes(node_A, node_B0);
// This connection goes both ways, causing a cycle
- connect_nodes(node_A, node_B1); connect_nodes(node_B1, node_A);
+ connect_nodes(node_A, node_B1);
+ connect_nodes(node_B1, node_A);
connect_nodes(node_B0, node_C0);
connect_nodes(node_B0, node_C1);
connect_nodes(node_B1, node_C2);
@@ -128,9 +129,9 @@ BOOST_AUTO_TEST_CASE(test_multi_iter_cycle_downstream_search)
connect_nodes(node_C0, node_D0);
// This time, we search for result_node
- std::vector< result_node::sptr > result = node_A->find_downstream_node<result_node>();
+ std::vector<result_node::sptr> result = node_A->find_downstream_node<result_node>();
BOOST_REQUIRE(result.size() == 4);
- for(const result_node::sptr &node: result) {
+ for (const result_node::sptr& node : result) {
std::cout << node->get_test_id() << std::endl;
}
}
@@ -141,9 +142,10 @@ BOOST_AUTO_TEST_CASE(test_mini_cycle_downstream_and_upstream)
MAKE_NODE(node_B);
// Connect them in a loop
- connect_nodes(node_A, node_B); connect_nodes(node_B, node_A);
+ connect_nodes(node_A, node_B);
+ connect_nodes(node_B, node_A);
- std::vector< test_node::sptr > result;
+ std::vector<test_node::sptr> result;
result = node_A->find_downstream_node<test_node>();
BOOST_REQUIRE_EQUAL(result.size(), 1);
BOOST_REQUIRE(result[0] == node_B);