diff options
author | Juan Gu <juan.gu@mongodb.com> | 2022-08-19 20:30:18 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-08-19 21:28:53 +0000 |
commit | 50ce932ad0e2542e9238d968d3f7ce1a163f5b42 (patch) | |
tree | 934a1db2a509590ec05d1887d5d16841160ca96e | |
parent | bd3a4efde0c07c5760111607d268383a83a6bce4 (diff) | |
download | mongo-50ce932ad0e2542e9238d968d3f7ce1a163f5b42.tar.gz |
SERVER-68830 did some tidy clang fixes
-rw-r--r-- | .clang-tidy | 2 | ||||
-rw-r--r-- | src/mongo/base/clonable_ptr_test.cpp | 7 | ||||
-rw-r--r-- | src/mongo/bson/bsonobjbuilder.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/concurrency/fast_map_noalloc_test.cpp | 14 | ||||
-rw-r--r-- | src/mongo/unittest/golden_test.cpp | 1 | ||||
-rw-r--r-- | src/mongo/unittest/golden_test_base.cpp | 1 |
6 files changed, 9 insertions, 18 deletions
diff --git a/.clang-tidy b/.clang-tidy index ea5badd8c12..06ba2c49431 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,3 +1,3 @@ -Checks: '-*,bugprone-unused-raii,bugprone-use-after-move,readability-const-return-type,readability-avoid-const-params-in-decls' +Checks: '-*,bugprone-unused-raii,bugprone-use-after-move,readability-const-return-type,readability-avoid-const-params-in-decls,boost-use-to-string' WarningsAsErrors: '*' HeaderFilterRegex: '(mongo/.*|build/.*)' diff --git a/src/mongo/base/clonable_ptr_test.cpp b/src/mongo/base/clonable_ptr_test.cpp index 4c4bfff3d35..62dd8c5e9c0 100644 --- a/src/mongo/base/clonable_ptr_test.cpp +++ b/src/mongo/base/clonable_ptr_test.cpp @@ -35,7 +35,6 @@ #include "mongo/unittest/unittest.h" -#include <boost/lexical_cast.hpp> namespace { @@ -144,8 +143,8 @@ public: static CloningFunctionType getCloningFunction() { return [calls = 0](const FunctorWithDynamicStateClonable& c) mutable { - return std::make_unique<FunctorWithDynamicStateClonable>( - c.data + boost::lexical_cast<std::string>(++calls)); + return std::make_unique<FunctorWithDynamicStateClonable>(c.data + + std::to_string(++calls)); }; } }; @@ -933,7 +932,7 @@ public: void consumeText(const std::string&) override {} std::string produceText() override { - return root + boost::lexical_cast<std::string>(++generation); + return root + std::to_string(++generation); } }; diff --git a/src/mongo/bson/bsonobjbuilder.cpp b/src/mongo/bson/bsonobjbuilder.cpp index 953a95687ea..859b5c8b5a7 100644 --- a/src/mongo/bson/bsonobjbuilder.cpp +++ b/src/mongo/bson/bsonobjbuilder.cpp @@ -30,8 +30,6 @@ #include "mongo/db/jsobj.h" -#include <boost/lexical_cast.hpp> - #include "mongo/bson/timestamp.h" #include "mongo/logv2/log.h" diff --git a/src/mongo/db/concurrency/fast_map_noalloc_test.cpp b/src/mongo/db/concurrency/fast_map_noalloc_test.cpp index 7cd80e9c510..3357b560815 100644 --- a/src/mongo/db/concurrency/fast_map_noalloc_test.cpp +++ b/src/mongo/db/concurrency/fast_map_noalloc_test.cpp @@ -27,7 +27,6 @@ * it in the license file. */ -#include <boost/lexical_cast.hpp> #include <string> #include "mongo/db/concurrency/fast_map_noalloc.h" @@ -95,8 +94,7 @@ TEST(FastMapNoAlloc, FindAndRemove) { TestFastMapNoAlloc map; for (int i = 0; i < 6; i++) { - map.insert(ResourceId(RESOURCE_COLLECTION, i)) - ->initNew(i, "Item" + boost::lexical_cast<std::string>(i)); + map.insert(ResourceId(RESOURCE_COLLECTION, i))->initNew(i, "Item" + std::to_string(i)); } for (int i = 0; i < 6; i++) { @@ -104,7 +102,7 @@ TEST(FastMapNoAlloc, FindAndRemove) { ASSERT_EQUALS(i, map.find(ResourceId(RESOURCE_COLLECTION, i))->id); - ASSERT_EQUALS("Item" + boost::lexical_cast<std::string>(i), + ASSERT_EQUALS("Item" + std::to_string(i), map.find(ResourceId(RESOURCE_COLLECTION, i))->value); } @@ -138,17 +136,15 @@ TEST(FastMapNoAlloc, RemoveAll) { stdx::unordered_map<ResourceId, TestStruct> checkMap; for (int i = 1; i <= 6; i++) { - map.insert(ResourceId(RESOURCE_COLLECTION, i)) - ->initNew(i, "Item" + boost::lexical_cast<std::string>(i)); + map.insert(ResourceId(RESOURCE_COLLECTION, i))->initNew(i, "Item" + std::to_string(i)); - checkMap[ResourceId(RESOURCE_COLLECTION, i)].initNew( - i, "Item" + boost::lexical_cast<std::string>(i)); + checkMap[ResourceId(RESOURCE_COLLECTION, i)].initNew(i, "Item" + std::to_string(i)); } TestFastMapNoAlloc::Iterator it = map.begin(); while (!it.finished()) { ASSERT_EQUALS(it->id, checkMap[it.key()].id); - ASSERT_EQUALS("Item" + boost::lexical_cast<std::string>(it->id), checkMap[it.key()].value); + ASSERT_EQUALS("Item" + std::to_string(it->id), checkMap[it.key()].value); checkMap.erase(it.key()); it.remove(); diff --git a/src/mongo/unittest/golden_test.cpp b/src/mongo/unittest/golden_test.cpp index d6c5692d72f..aedffcf279e 100644 --- a/src/mongo/unittest/golden_test.cpp +++ b/src/mongo/unittest/golden_test.cpp @@ -33,7 +33,6 @@ #include <boost/iostreams/device/file_descriptor.hpp> #include <boost/iostreams/stream.hpp> #include <boost/iostreams/stream_buffer.hpp> -#include <boost/lexical_cast.hpp> #include <boost/program_options.hpp> #include <fmt/format.h> #include <fmt/ostream.h> diff --git a/src/mongo/unittest/golden_test_base.cpp b/src/mongo/unittest/golden_test_base.cpp index 0a2ae8eee9b..67b1ee62077 100644 --- a/src/mongo/unittest/golden_test_base.cpp +++ b/src/mongo/unittest/golden_test_base.cpp @@ -32,7 +32,6 @@ #include <boost/iostreams/device/file_descriptor.hpp> #include <boost/iostreams/stream.hpp> #include <boost/iostreams/stream_buffer.hpp> -#include <boost/lexical_cast.hpp> #include <boost/optional/optional_io.hpp> #include <boost/program_options.hpp> #include <fmt/format.h> |