Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Mar 31, 2022
1 parent bbf8a43 commit ee30e3b
Showing 1 changed file with 10 additions and 21 deletions.
31 changes: 10 additions & 21 deletions test/test_defined_units.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ SPDX-License-Identifier: BSD-3-Clause

TEST(unit_string_definitions, si_vector_length)
{
for (std::size_t ii = 0;
ii < units::defined_unit_strings_si.size();
++ii) {
for (std::size_t ii = 0; ii < units::defined_unit_strings_si.size(); ++ii) {
EXPECT_TRUE(units::defined_unit_strings_si[ii].first != nullptr) << ii;
if (units::defined_unit_strings_si[ii].first == nullptr) {
break;
Expand All @@ -36,15 +34,12 @@ TEST(unit_string_definitions, customary_vector)
TEST(unit_string_definitions, si_duplicates)
{
std::map<std::string, units::precise_unit> testMap;
for (const auto &ustring: units::defined_unit_strings_si) {
for (const auto& ustring : units::defined_unit_strings_si) {
if (ustring.first == nullptr) {
continue;
}
auto res = testMap.emplace(
ustring.first,
ustring.second);
EXPECT_TRUE(res.second) << "duplicate si unit string "
<< ustring.first;
auto res = testMap.emplace(ustring.first, ustring.second);
EXPECT_TRUE(res.second) << "duplicate si unit string " << ustring.first;
}
}

Expand All @@ -55,12 +50,8 @@ TEST(unit_string_definitions, customary_duplicates)
if (ustring.first == nullptr) {
continue;
}
auto res = testMap.emplace(
ustring.first,
ustring.second);
EXPECT_TRUE(res.second)
<< "duplicate unit string "
<< ustring.first;
auto res = testMap.emplace(ustring.first, ustring.second);
EXPECT_TRUE(res.second) << "duplicate unit string " << ustring.first;
}
}

Expand All @@ -71,14 +62,12 @@ TEST(unit_string_definitions, combined_duplicates)
if (ustring.first == nullptr) {
continue;
}
auto res = testMap.emplace(
ustring.first, ustring.second);
EXPECT_TRUE(res.second) << "duplicate si unit string "
<< ustring.first;
auto res = testMap.emplace(ustring.first, ustring.second);
EXPECT_TRUE(res.second) << "duplicate si unit string " << ustring.first;
}

for (std::size_t ii = 0; ii < units::defined_unit_strings_customary.size(); ++ii)
{
for (std::size_t ii = 0; ii < units::defined_unit_strings_customary.size();
++ii) {
if (units::defined_unit_strings_customary[ii].first == nullptr) {
continue;
}
Expand Down

0 comments on commit ee30e3b

Please sign in to comment.