From: Thomas Markwalder Date: Wed, 14 Mar 2018 13:53:34 +0000 (-0400) Subject: [master] Replace std::to_string in unit tests X-Git-Tag: kea5574_base~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8af66965cb441b9202a0adc8a1dd06c8ee022a02;p=thirdparty%2Fkea.git [master] Replace std::to_string in unit tests Circumvents a build issue under FreeBSD 11 which appears to dislike std::to_string. --- diff --git a/src/bin/dhcp4/tests/get_config_unittest.cc b/src/bin/dhcp4/tests/get_config_unittest.cc index 77f622c045..e80514bdf3 100644 --- a/src/bin/dhcp4/tests/get_config_unittest.cc +++ b/src/bin/dhcp4/tests/get_config_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2017-2018 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 @@ -7123,7 +7123,9 @@ TEST_P(Dhcp4GetConfigTest, run) { class IntToString { public: std::string operator()(const testing::TestParamInfo& n) { - return std::to_string(n.param); + std::ostringstream ss; + ss << static_cast(n.param); + return (ss.str()); } }; diff --git a/src/bin/dhcp6/tests/get_config_unittest.cc b/src/bin/dhcp6/tests/get_config_unittest.cc index 36a54a330b..687414d7e1 100644 --- a/src/bin/dhcp6/tests/get_config_unittest.cc +++ b/src/bin/dhcp6/tests/get_config_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2017-2018 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 @@ -6685,7 +6685,9 @@ TEST_P(Dhcp6GetConfigTest, run) { class IntToString { public: std::string operator()(const testing::TestParamInfo& n) { - return to_string(n.param); + std::ostringstream ss; + ss << static_cast(n.param); + return (ss.str()); } };