summaryrefslogtreecommitdiff
path: root/tests/stdlib_test.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2017-12-19 16:11:37 -0800
committerElliott Hughes <enh@google.com>2017-12-19 16:11:37 -0800
commitf61a06e5981c8359a42493d6e53b1eca453a1dbe (patch)
tree0a7d2f095c100edf1788becfa91e32028fd6162a /tests/stdlib_test.cpp
parent9dc37b9439063df2b0db6d1b3a37b491bc3cd427 (diff)
Use std::to_string instead of std::stringstream.
Bug: N/A Test: ran tests Change-Id: Ifeb7cf9517bcc05459e7ce316eb7604042510935
Diffstat (limited to 'tests/stdlib_test.cpp')
-rw-r--r--tests/stdlib_test.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/stdlib_test.cpp b/tests/stdlib_test.cpp
index e429de6a9..93877f335 100644
--- a/tests/stdlib_test.cpp
+++ b/tests/stdlib_test.cpp
@@ -33,7 +33,7 @@
#include <sys/wait.h>
#include <limits>
-#include <sstream>
+#include <string>
// The random number generator tests all set the seed, get four values, reset the seed and check
// that they get the first two values repeated, and then reset the seed and check two more values
@@ -678,7 +678,7 @@ static void CheckStrToInt(T fn(const char* s, char** end, int base)) {
if (std::numeric_limits<T>::is_signed) {
// Minimum (such as -128).
- std::string min{(std::stringstream{} << std::numeric_limits<T>::min()).str()};
+ std::string min{std::to_string(std::numeric_limits<T>::min())};
ASSERT_EQ(std::numeric_limits<T>::min(), fn(min.c_str(), &end_p, 0));
// Too negative (such as -129).
min.back() = (min.back() + 1);
@@ -688,7 +688,7 @@ static void CheckStrToInt(T fn(const char* s, char** end, int base)) {
}
// Maximum (such as 127).
- std::string max{(std::stringstream{} << std::numeric_limits<T>::max()).str()};
+ std::string max{std::to_string(std::numeric_limits<T>::max())};
ASSERT_EQ(std::numeric_limits<T>::max(), fn(max.c_str(), &end_p, 0));
// Too positive (such as 128).
max.back() = (max.back() + 1);