mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-29 21:18:02 +00:00
[#2025] simplify concatenating strings (minor)
This commit is contained in:
parent
bb46888356
commit
76cc84f8d9
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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";
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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") << ", "
|
||||
|
@ -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));
|
||||
|
@ -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 << ")");
|
||||
}
|
||||
|
||||
|
@ -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 << ")");
|
||||
}
|
||||
|
||||
|
@ -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 << ")";
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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(),
|
||||
|
@ -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 << ")");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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 ";
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user