From c11900912d97df148a6970a3ec1e27d093923a0a Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Mon, 6 Mar 2017 14:30:21 -0500 Subject: SERVER-27193 Use ItoA to handle integer cases in StringBuilder --- src/mongo/util/itoa_test.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/mongo/util/itoa_test.cpp') diff --git a/src/mongo/util/itoa_test.cpp b/src/mongo/util/itoa_test.cpp index b5158bb1fa5..0956d632cde 100644 --- a/src/mongo/util/itoa_test.cpp +++ b/src/mongo/util/itoa_test.cpp @@ -40,18 +40,19 @@ namespace { using namespace mongo; TEST(ItoA, StringDataEquality) { - ASSERT_EQ(ItoA::kBufSize - 1, std::to_string(std::numeric_limits::max()).size()); + ASSERT_EQ(ItoA::kBufSize - 1, std::to_string(std::numeric_limits::max()).size()); - for (auto testCase : {1u, - 12u, - 133u, - 1446u, - 17789u, - 192923u, - 2389489u, - 29313479u, - 1928127389u, - std::numeric_limits::max()}) { + for (auto testCase : {uint64_t(1), + uint64_t(12), + uint64_t(133), + uint64_t(1446), + uint64_t(17789), + uint64_t(192923), + uint64_t(2389489), + uint64_t(29313479), + uint64_t(1928127389), + std::numeric_limits::max() - 1, + std::numeric_limits::max()}) { ItoA itoa{testCase}; ASSERT_EQ(std::to_string(testCase), StringData(itoa)); } -- cgit v1.2.1