From 967be2a4e82b1a125b26bb72a60318a4fb2b50c4 Mon Sep 17 00:00:00 2001 From: Brent Stapleton Date: Mon, 14 Jan 2019 10:35:25 -0800 Subject: 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. --- host/tests/addr_test.cpp | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) (limited to 'host/tests/addr_test.cpp') diff --git a/host/tests/addr_test.cpp b/host/tests/addr_test.cpp index 9819df1a5..03608d723 100644 --- a/host/tests/addr_test.cpp +++ b/host/tests/addr_test.cpp @@ -5,15 +5,16 @@ // SPDX-License-Identifier: GPL-3.0-or-later // -#include -#include #include +#include #include #include +#include #include #include -BOOST_AUTO_TEST_CASE(test_mac_addr){ +BOOST_AUTO_TEST_CASE(test_mac_addr) +{ std::cout << "Testing mac addr..." << std::endl; const std::string mac_addr_str("00:01:23:45:67:89"); uhd::mac_addr_t mac_addr = uhd::mac_addr_t::from_string(mac_addr_str); @@ -22,39 +23,40 @@ BOOST_AUTO_TEST_CASE(test_mac_addr){ BOOST_CHECK_EQUAL(mac_addr_str, mac_addr.to_string()); } -BOOST_AUTO_TEST_CASE(test_device_addr){ +BOOST_AUTO_TEST_CASE(test_device_addr) +{ std::cout << "Testing device addr..." << std::endl; - //load the device address with something + // load the device address with something uhd::device_addr_t dev_addr; dev_addr["key1"] = "val1"; dev_addr["key1"] = "val1"; dev_addr["key3"] = ""; - //convert to and from args string + // convert to and from args string std::cout << "Pretty Print: " << std::endl << dev_addr.to_pp_string(); std::string args_str = dev_addr.to_string(); std::cout << "Args String: " << args_str << std::endl; uhd::device_addr_t new_dev_addr(args_str); - //they should be the same size + // they should be the same size BOOST_REQUIRE_EQUAL(dev_addr.size(), new_dev_addr.size()); - //the keys should match + // the keys should match std::vector old_dev_addr_keys = dev_addr.keys(); std::vector new_dev_addr_keys = new_dev_addr.keys(); - BOOST_CHECK_EQUAL_COLLECTIONS( - old_dev_addr_keys.begin(), old_dev_addr_keys.end(), - new_dev_addr_keys.begin(), new_dev_addr_keys.end() - ); + BOOST_CHECK_EQUAL_COLLECTIONS(old_dev_addr_keys.begin(), + old_dev_addr_keys.end(), + new_dev_addr_keys.begin(), + new_dev_addr_keys.end()); - //the vals should match + // the vals should match std::vector old_dev_addr_vals = dev_addr.vals(); std::vector new_dev_addr_vals = new_dev_addr.vals(); - BOOST_CHECK_EQUAL_COLLECTIONS( - old_dev_addr_vals.begin(), old_dev_addr_vals.end(), - new_dev_addr_vals.begin(), new_dev_addr_vals.end() - ); + BOOST_CHECK_EQUAL_COLLECTIONS(old_dev_addr_vals.begin(), + old_dev_addr_vals.end(), + new_dev_addr_vals.begin(), + new_dev_addr_vals.end()); uhd::device_addr_t dev_addr_lhs1("key1=val1,key2=val2"); dev_addr_lhs1.update(uhd::device_addr_t("key2=val2x,key3=val3"), false); @@ -64,7 +66,8 @@ BOOST_AUTO_TEST_CASE(test_device_addr){ std::cout << "Merged: " << dev_addr_lhs1.to_string() << std::endl; } -BOOST_AUTO_TEST_CASE(test_dboard_id){ +BOOST_AUTO_TEST_CASE(test_dboard_id) +{ std::cout << "Testing dboard id..." << std::endl; using namespace uhd::usrp; @@ -76,7 +79,8 @@ BOOST_AUTO_TEST_CASE(test_dboard_id){ std::cout << "Pretty Print: " << std::endl << dboard_id_t::none().to_pp_string(); } -BOOST_AUTO_TEST_CASE(test_map_device_addr){ +BOOST_AUTO_TEST_CASE(test_map_device_addr) +{ std::map dev_addr_map; dev_addr_map["key1"] = "val1"; dev_addr_map["key2"] = "val2"; -- cgit v1.2.3