diff options
author | Brent Stapleton <brent.stapleton@ettus.com> | 2019-01-14 10:35:25 -0800 |
---|---|---|
committer | Brent Stapleton <brent.stapleton@ettus.com> | 2019-01-16 11:40:23 -0800 |
commit | 967be2a4e82b1a125b26bb72a60318a4fb2b50c4 (patch) | |
tree | 8a24954b54d1546dc8049a17e485adb0a605f74f /host/tests/sensors_test.cpp | |
parent | aafe4e8b742a0e21d3818f21f34e3c8613132530 (diff) | |
download | uhd-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/sensors_test.cpp')
-rw-r--r-- | host/tests/sensors_test.cpp | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/host/tests/sensors_test.cpp b/host/tests/sensors_test.cpp index 2136ca13b..925f1a711 100644 --- a/host/tests/sensors_test.cpp +++ b/host/tests/sensors_test.cpp @@ -4,20 +4,16 @@ // SPDX-License-Identifier: GPL-3.0-or-later // -#include <boost/test/unit_test.hpp> #include <uhd/types/sensors.hpp> +#include <boost/test/unit_test.hpp> #include <map> #include <string> using uhd::sensor_value_t; -BOOST_AUTO_TEST_CASE(test_sensor_bool) { - auto sensor_bool = sensor_value_t( - "bool_sensor", - true, - "true_unit", - "false_unit" - ); +BOOST_AUTO_TEST_CASE(test_sensor_bool) +{ + auto sensor_bool = sensor_value_t("bool_sensor", true, "true_unit", "false_unit"); BOOST_CHECK(sensor_bool.to_bool()); BOOST_CHECK_EQUAL(sensor_bool.unit, "true_unit"); @@ -34,11 +30,12 @@ BOOST_AUTO_TEST_CASE(test_sensor_bool) { } -BOOST_AUTO_TEST_CASE(test_sensor_real) { - const double sens_val = 2.25; +BOOST_AUTO_TEST_CASE(test_sensor_real) +{ + const double sens_val = 2.25; const std::string sens_units = "floats"; - const std::string sens_name = "real_sensor"; - auto sensor_real = sensor_value_t(sens_name, sens_val, sens_units); + const std::string sens_name = "real_sensor"; + auto sensor_real = sensor_value_t(sens_name, sens_val, sens_units); BOOST_CHECK_EQUAL(sensor_real.to_real(), sens_val); BOOST_CHECK_EQUAL(sensor_real.unit, sens_units); @@ -54,11 +51,12 @@ BOOST_AUTO_TEST_CASE(test_sensor_real) { BOOST_CHECK_EQUAL(sensor_real2.unit, sens_units); } -BOOST_AUTO_TEST_CASE(test_sensor_int) { - const int sens_val = 5; +BOOST_AUTO_TEST_CASE(test_sensor_int) +{ + const int sens_val = 5; const std::string sens_units = "ints"; - const std::string sens_name = "int_sensor"; - auto sensor_int = sensor_value_t(sens_name, sens_val, sens_units); + const std::string sens_name = "int_sensor"; + auto sensor_int = sensor_value_t(sens_name, sens_val, sens_units); BOOST_CHECK_EQUAL(sensor_int.to_int(), sens_val); BOOST_CHECK_EQUAL(sensor_int.unit, sens_units); @@ -74,11 +72,12 @@ BOOST_AUTO_TEST_CASE(test_sensor_int) { BOOST_CHECK_EQUAL(sensor_int2.unit, sens_units); } -BOOST_AUTO_TEST_CASE(test_sensor_string) { - const std::string sens_val = "foo"; +BOOST_AUTO_TEST_CASE(test_sensor_string) +{ + const std::string sens_val = "foo"; const std::string sens_units = "strings"; - const std::string sens_name = "str_sensor"; - auto sensor_str = sensor_value_t(sens_name, sens_val, sens_units); + const std::string sens_name = "str_sensor"; + auto sensor_str = sensor_value_t(sens_name, sens_val, sens_units); BOOST_CHECK_EQUAL(sensor_str.value, sens_val); BOOST_CHECK_EQUAL(sensor_str.unit, sens_units); @@ -97,6 +96,4 @@ BOOST_AUTO_TEST_CASE(test_sensor_string) { BOOST_CHECK_EQUAL(sensor_str2.value, sensor_str3.value); BOOST_CHECK_EQUAL(sensor_str2.unit, sensor_str3.unit); BOOST_CHECK_EQUAL(sensor_str2.type, sensor_str3.type); - } - |