]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2025] simplify concatenating strings (minor)
authorAndrei Pavel <andrei@isc.org>
Tue, 10 Aug 2021 13:19:41 +0000 (16:19 +0300)
committerAndrei Pavel <andrei@isc.org>
Mon, 16 Aug 2021 15:33:26 +0000 (15:33 +0000)
15 files changed:
src/bin/dhcp4/tests/dhcp4_test_utils.cc
src/bin/dhcp6/tests/dhcp6_test_utils.cc
src/hooks/dhcp/high_availability/tests/ha_service_unittest.cc
src/lib/asiolink/tests/interval_timer_unittest.cc
src/lib/cql/testutils/cql_schema.cc
src/lib/dhcp/option6_client_fqdn.cc
src/lib/dhcp/pkt_filter_lpf.cc
src/lib/dhcpsrv/parsers/base_network_parser.cc
src/lib/dhcpsrv/parsers/dhcp_parsers.cc
src/lib/dhcpsrv/tests/alloc_engine_utils.cc
src/lib/dhcpsrv/tests/srv_config_unittest.cc
src/lib/dns/tests/master_loader_unittest.cc
src/lib/hooks/hooks_config.cc
src/lib/mysql/testutils/mysql_schema.cc
src/lib/pgsql/pgsql_connection.cc

index 1ae11ad888f1c037caa566d57a4913f12c0df2a0..c16df94e3acc4ab2c67c68eb4fc4a731c292006d 100644 (file)
@@ -46,7 +46,7 @@ BaseServerTest::BaseServerTest()
 BaseServerTest::~BaseServerTest() {
     // Remove default lease file.
     std::ostringstream s2;
-    s2 << CfgMgr::instance().getDataDir() << "/" << "kea-leases4.csv";
+    s2 << CfgMgr::instance().getDataDir() << "/kea-leases4.csv";
     static_cast<void>(::remove(s2.str().c_str()));
 
     // Revert to original data directory.
index 7c132a75675af669f8dc36d9df2f86481d283b7c..670a65edbb7afa2d89606e3082d14772b33b9a47 100644 (file)
@@ -44,7 +44,7 @@ BaseServerTest::~BaseServerTest() {
 
     // Remove default lease file.
     std::ostringstream s2;
-    s2 << CfgMgr::instance().getDataDir() << "/" << "kea-leases6.csv";
+    s2 << CfgMgr::instance().getDataDir() << "/kea-leases6.csv";
     static_cast<void>(::remove(s2.str().c_str()));
 
     // Revert to original data directory.
index 99588dd8cf75fd78fb887d921d9d7e9c8911fe0d..23f6655c2f5d867ad7199d34424056fde9990c20 100644 (file)
@@ -5010,7 +5010,7 @@ public:
         EXPECT_EQ(final_state.state_, service_->getCurrState())
             << "expected transition to the '"
             << service_->getStateLabel(final_state.state_)
-            << "' state" << ", but transitioned to the '"
+            << "' state, but transitioned to the '"
             << service_->getStateLabel(service_->getCurrState())
             << "' state";
     }
index 95dfaf7f3179360c79dfe4dfdd482046bd1146e0..5b21b77848b779a67fd3ff8c9886ac0f292cd7d7 100644 (file)
@@ -184,7 +184,7 @@ TEST_F(IntervalTimerTest, startIntervalTimer) {
     // Allow 1% of clock skew
     EXPECT_TRUE(test_runtime >= boost::posix_time::milliseconds(99)) <<
                 "test runtime " << test_runtime.total_milliseconds() <<
-                "msec " << ">= 100";
+                "msec >= 100";
 }
 
 TEST_F(IntervalTimerTest, destructIntervalTimer) {
index ca4b244f0894c6c2b2aaa89c0b33305465c14685..dc525ec87b495754a280c13cd921c595ef755154 100644 (file)
@@ -80,7 +80,7 @@ bool wipeCqlData(bool show_err) {
     std::ostringstream version;
     version << CQL_SCHEMA_VERSION_MAJOR  << "." << CQL_SCHEMA_VERSION_MINOR;
 
-    cmd << "cql/wipe_data.sh" << " " << version.str()
+    cmd << "cql/wipe_data.sh " << version.str()
         << " -u keatest -p keatest -k keatest --request-timeout=6000";
 
     if (!show_err) {
index 65b0c1b6ecc9072124e35abe418e332d1f70d69b..f1ed563b6a8471edaabb45a12475451cdeee90cf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2021 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -427,7 +427,7 @@ std::string
 Option6ClientFqdn::toText(int indent) const {
     std::ostringstream stream;
     std::string in(indent, ' '); // base indentation
-    stream << in  << "type=" << type_ << "(CLIENT_FQDN)" << ", "
+    stream << in  << "type=" << type_ << "(CLIENT_FQDN), "
            << "flags: ("
            << "N=" << (getFlag(FLAG_N) ? "1" : "0") << ", "
            << "O=" << (getFlag(FLAG_O) ? "1" : "0") << ", "
index ca700c47cf8a0784384311f881c74357721d187e..791e8635d27fb657b172194620d5218f36dcc2d7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2020 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2021 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -206,7 +206,7 @@ PktFilterLPF::openSocket(Iface& iface,
         close(fallback);
         isc_throw(SocketConfigError, "failed to set SO_NONBLOCK option on the"
                   " LPF socket '" << sock << "' to interface '"
-                  << iface.getName() << "'" << ", reason: " << errmsg);
+                  << iface.getName() << "', reason: " << errmsg);
     }
 
     return (SocketInfo(addr, port, sock, fallback));
index 8441c701742fd11aed414372a87efee577723aaf..88f5886169db81f016a666790ecf0fa9b1ad09f8 100644 (file)
@@ -62,7 +62,7 @@ BaseNetworkParser::parseCommon(const ConstElementPtr& network_data,
     if (has_renew) {
         renew = getInteger(network_data, "renew-timer");
         if (renew < 0) {
-            isc_throw(DhcpConfigError, "the value of renew-timer" << " ("
+            isc_throw(DhcpConfigError, "the value of renew-timer ("
                       << renew << ") must be a positive number");
         }
         network->setT1(renew);
@@ -71,15 +71,15 @@ BaseNetworkParser::parseCommon(const ConstElementPtr& network_data,
     if (has_rebind) {
         rebind = getInteger(network_data, "rebind-timer");
         if (rebind < 0) {
-            isc_throw(DhcpConfigError, "the value of rebind-timer" << " ("
+            isc_throw(DhcpConfigError, "the value of rebind-timer ("
                       << rebind << ") must be a positive number");
         }
         network->setT2(rebind);
     }
 
     if (has_renew && has_rebind && (renew > rebind)) {
-        isc_throw(DhcpConfigError, "the value of renew-timer" << " (" << renew
-                  << ") is greater than the value of rebind-timer" << " ("
+        isc_throw(DhcpConfigError, "the value of renew-timer (" << renew
+                  << ") is greater than the value of rebind-timer ("
                   << rebind << ")");
     }
 
index 36903d6895c485ae46ff225fc1b52e26829f049c..5e0bcc8a45225fab78d382b21acd8203019fdd7f 100644 (file)
@@ -199,7 +199,7 @@ OptionDefParser::parse(ConstElementPtr option_def) {
         // Arrays can't be used together with sub-options.
         if (array_type) {
             isc_throw(DhcpConfigError, "option '" << space << "."
-                      << "name" << "', comprising an array of data"
+                      << name << "', comprising an array of data"
                       << " fields may not encapsulate any option space ("
                       << option_def->getPosition() << ")");
 
@@ -770,8 +770,8 @@ Subnet4ConfigParser::initSubnet(data::ConstElementPtr params,
     }
 
     if (has_renew && has_rebind && (renew > rebind)) {
-        isc_throw(DhcpConfigError, "the value of renew-timer" << " (" << renew
-                  << ") is greater than the value of rebind-timer" << " ("
+        isc_throw(DhcpConfigError, "the value of renew-timer (" << renew
+                  << ") is greater than the value of rebind-timer ("
                   << rebind << ")");
     }
 
@@ -1272,8 +1272,8 @@ Subnet6ConfigParser::initSubnet(data::ConstElementPtr params,
     }
 
     if (has_renew && has_rebind && (renew > rebind)) {
-        isc_throw(DhcpConfigError, "the value of renew-timer" << " (" << renew
-                  << ") is greater than the value of rebind-timer" << " ("
+        isc_throw(DhcpConfigError, "the value of renew-timer (" << renew
+                  << ") is greater than the value of rebind-timer ("
                   << rebind << ")");
     }
 
index 2ca911578e063ca53de2bf3f32c99b6317b3e6f3..daa85e574bf3db31df8ab2e81ea2313ab7931021 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2020 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2021 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -49,7 +49,7 @@ bool testStatistics(const std::string& stat_name, const int64_t exp_value,
             if (observation->getInteger().first != exp_value) {
                 ADD_FAILURE()
                     << "value of the observed statistics '"
-                    << name << "' " << "("
+                    << name << "' ("
                     << observation->getInteger().first << ") "
                     << "doesn't match expected value (" << exp_value << ")";
             }
index b4cac7d43d2440b28c8112491725081a50a75e4a..7c2663f79fd8fd22a823f1c835ec0695631c0818 100644 (file)
@@ -142,7 +142,7 @@ void
 SrvConfigTest::addSubnet4(const unsigned int index) {
     if (index >= TEST_SUBNETS_NUM) {
         FAIL() << "Subnet index " << index << "out of range (0.."
-               << TEST_SUBNETS_NUM << "): " << "unable to add IPv4 subnet";
+               << TEST_SUBNETS_NUM << "): unable to add IPv4 subnet";
     }
     // std::advance is not available for this iterator.
     auto it = test_subnets4_.begin();
@@ -156,7 +156,7 @@ void
 SrvConfigTest::addSubnet6(const unsigned int index) {
     if (index >= TEST_SUBNETS_NUM) {
         FAIL() << "Subnet index " << index << "out of range (0.."
-               << TEST_SUBNETS_NUM << "): " << "unable to add IPv6 subnet";
+               << TEST_SUBNETS_NUM << "): unable to add IPv6 subnet";
     }
     // std::advance is not available for this iterator.
     auto it = test_subnets6_.begin();
index 544e48e1314ee9afd3b8f534516de60b49df8863..74300d3171f600ffd537a7ec2471a7a4ca1fac0c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2020 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2021 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -1317,7 +1317,8 @@ TEST_F(MasterLoaderTest, ttlOverflow) {
     stringstream zone_stream;
     zone_stream << "example.org. IN SOA . . 0 0 0 0 2147483648\n";
     zone_stream << "$TTL 3600\n"; // reset to an in-range value
-    zone_stream << "$TTL 2147483649\n" << "a.example.org. IN A 192.0.2.1\n";
+    zone_stream << "$TTL 2147483649\n";
+    zone_stream << "a.example.org. IN A 192.0.2.1\n";
     zone_stream << "$TTL 3600\n"; // reset to an in-range value
     zone_stream << "b.example.org. 2147483650 IN A 192.0.2.2\n";
     setLoader(zone_stream, Name("example.org."), RRClass::IN(),
index ce0e268561799468dcd06dbc67db4949a6efb325..c6bf9a2268a6bb227e702735ae2edbf736c2d54a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2021 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -47,7 +47,7 @@ HooksConfig::verifyLibraries(const Element::Position& position) const {
         isc_throw(InvalidHooksLibraries,
                   "hooks libraries failed to validate - "
                   "library or libraries in error are: "
-                  << error_list << "(" << position << ")");
+                  << error_list << " (" << position << ")");
     }
 }
 
index d75b43d9224c4b9e796fb4c9b0df4c11edd7a276..ddded67fdcd25fac8b1be2124a53e84c0573263d 100644 (file)
@@ -52,7 +52,7 @@ bool wipeMySQLData(bool show_err) {
     std::ostringstream version;
     version << MYSQL_SCHEMA_VERSION_MAJOR  << "." << MYSQL_SCHEMA_VERSION_MINOR;
 
-    cmd << "mysql/wipe_data.sh" << " " << version.str()
+    cmd << "mysql/wipe_data.sh " << version.str()
         << " -N -B --user=keatest --password=keatest keatest";
     if (!show_err) {
         cmd << " 2>/dev/null ";
index b3b48bdb2a6196ecae7e5dbb1ab5d2fae1241b9f..046e4d928ab5f01a708b87b2343b68b9e9587424 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2016-2020 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2021 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -349,7 +349,7 @@ PgSqlConnection::checkStatementError(const PgSqlResult& r,
 
         // Apparently it wasn't fatal, so we throw with a helpful message.
         const char* error_message = PQerrorMessage(conn_);
-        isc_throw(DbOperationError, "Statement exec failed:" << " for: "
+        isc_throw(DbOperationError, "Statement exec failed for: "
                   << statement.name << ", status: " << s
                   << "sqlstate:[ " << (sqlstate ? sqlstate : "<null>")
                   << " ], reason: " << error_message);