]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[master] Replace std::to_string in unit tests
authorThomas Markwalder <tmark@isc.org>
Wed, 14 Mar 2018 13:53:34 +0000 (09:53 -0400)
committerThomas Markwalder <tmark@isc.org>
Wed, 14 Mar 2018 13:53:34 +0000 (09:53 -0400)
    Circumvents a build issue under FreeBSD 11 which appears to
    dislike std::to_string.

src/bin/dhcp4/tests/get_config_unittest.cc
src/bin/dhcp6/tests/get_config_unittest.cc

index 77f622c0459df8391d25bf1bc0f6b9a29a11551e..e80514bdf3829b1eb4ae33917976e47be8dd8131 100644 (file)
@@ -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<size_t>& n) {
-        return std::to_string(n.param);
+        std::ostringstream ss;
+        ss << static_cast<size_t>(n.param);
+        return (ss.str());
     }
 };
 
index 36a54a330b129cf5a4796c6eb76fa91edf8674a8..687414d7e175b91ceea0f0bb4e167a0ad4616a36 100644 (file)
@@ -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<size_t>& n) {
-        return to_string(n.param);
+        std::ostringstream ss;
+        ss << static_cast<size_t>(n.param);
+        return (ss.str());
     }
 };