diff options
author | Mathias Stearn <mathias@10gen.com> | 2017-03-06 14:30:21 -0500 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2017-06-13 17:15:28 -0400 |
commit | c11900912d97df148a6970a3ec1e27d093923a0a (patch) | |
tree | 2dbfc3a1116e1b37cf793252ed3a6af0f1623cfc /src/mongo/util/itoa_test.cpp | |
parent | 93d9e27c64b95d4ff601baaf84a3b10a565be778 (diff) | |
download | mongo-c11900912d97df148a6970a3ec1e27d093923a0a.tar.gz |
SERVER-27193 Use ItoA to handle integer cases in StringBuilder
Diffstat (limited to 'src/mongo/util/itoa_test.cpp')
-rw-r--r-- | src/mongo/util/itoa_test.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
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<std::uint32_t>::max()).size()); + ASSERT_EQ(ItoA::kBufSize - 1, std::to_string(std::numeric_limits<std::uint64_t>::max()).size()); - for (auto testCase : {1u, - 12u, - 133u, - 1446u, - 17789u, - 192923u, - 2389489u, - 29313479u, - 1928127389u, - std::numeric_limits<std::uint32_t>::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<std::uint64_t>::max() - 1, + std::numeric_limits<std::uint64_t>::max()}) { ItoA itoa{testCase}; ASSERT_EQ(std::to_string(testCase), StringData(itoa)); } |