aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests/eeprom_utils_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/eeprom_utils_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/eeprom_utils_test.cpp')
-rw-r--r--host/tests/eeprom_utils_test.cpp46
1 files changed, 21 insertions, 25 deletions
diff --git a/host/tests/eeprom_utils_test.cpp b/host/tests/eeprom_utils_test.cpp
index 4407ad4e4..728b4b8b6 100644
--- a/host/tests/eeprom_utils_test.cpp
+++ b/host/tests/eeprom_utils_test.cpp
@@ -4,15 +4,19 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
-#include <boost/test/unit_test.hpp>
#include <uhdlib/utils/eeprom_utils.hpp>
#include <boost/assign/list_of.hpp>
+#include <boost/test/unit_test.hpp>
using namespace boost::assign;
-class upper_case_char {
+class upper_case_char
+{
public:
- upper_case_char(char ch) {value = ch;}
+ upper_case_char(char ch)
+ {
+ value = ch;
+ }
static upper_case_char from_string(std::string str)
{
return upper_case_char(toupper(str[0]));
@@ -21,36 +25,28 @@ public:
{
return std::string(1, value);
}
+
private:
char value;
};
BOOST_AUTO_TEST_CASE(test_eeprom_duplicate_check)
{
- const uhd::dict<std::string,std::string> curr_eeprom = map_list_of
- ("0","A")
- ("1","B")
- ("2","C")
- ;
- const uhd::dict<std::string,std::string> new_eeprom_no_dups = map_list_of
- ("0","d")
- ("1","e")
- ;
- const uhd::dict<std::string,std::string> new_eeprom_dups_in_curr = map_list_of
- ("0","b")
- ;
- const uhd::dict<std::string,std::string> new_eeprom_dups_in_new = map_list_of
- ("0","c")
- ("1","c")
- ;
- const uhd::dict<std::string,std::string> new_eeprom_dups_in_both = map_list_of
- ("0","b")
- ("1","B")
- ;
- const std::vector<std::string> keys = {"0","1","2"};
+ const uhd::dict<std::string, std::string> curr_eeprom =
+ map_list_of("0", "A")("1", "B")("2", "C");
+ const uhd::dict<std::string, std::string> new_eeprom_no_dups =
+ map_list_of("0", "d")("1", "e");
+ const uhd::dict<std::string, std::string> new_eeprom_dups_in_curr =
+ map_list_of("0", "b");
+ const uhd::dict<std::string, std::string> new_eeprom_dups_in_new =
+ map_list_of("0", "c")("1", "c");
+ const uhd::dict<std::string, std::string> new_eeprom_dups_in_both =
+ map_list_of("0", "b")("1", "B");
+ const std::vector<std::string> keys = {"0", "1", "2"};
BOOST_CHECK_EQUAL(check_for_duplicates<upper_case_char>(
- "TEST", new_eeprom_no_dups, curr_eeprom, "Test Value", keys), false);
+ "TEST", new_eeprom_no_dups, curr_eeprom, "Test Value", keys),
+ false);
BOOST_CHECK(check_for_duplicates<upper_case_char>(
"TEST", new_eeprom_dups_in_curr, curr_eeprom, "Test Value", keys));
BOOST_CHECK(check_for_duplicates<upper_case_char>(