diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2019-03-27 12:21:37 -0400 |
---|---|---|
committer | Billy Donahue <billy.donahue@mongodb.com> | 2019-03-28 10:13:21 -0400 |
commit | f922827d45ce752e148185dfa3a785f7c9cf29fd (patch) | |
tree | b3ae7fdba18d9ef3384af6e0d009d091e5df14a3 /src/mongo/unittest | |
parent | f2f422d92b639edba0a10d40a43803723cb15baf (diff) | |
download | mongo-f922827d45ce752e148185dfa3a785f7c9cf29fd.tar.gz |
SERVER-40357 expand all calls to MONGO_DISALLOW_COPYING
produced by:
hits="$(git grep -n MONGO_DISALLOW_COPYING | cut -d: -f1 )"
for f in "$hits"; do
sed -i.orig '
s/^\( *\)MONGO_DISALLOW_COPYING(\(.*\));/\1\2(const \2\&) = delete;\n\1\2\& operator=(const \2\&) = delete;/;
' $f
done
Diffstat (limited to 'src/mongo/unittest')
-rw-r--r-- | src/mongo/unittest/barrier.h | 4 | ||||
-rw-r--r-- | src/mongo/unittest/death_test.h | 4 | ||||
-rw-r--r-- | src/mongo/unittest/task_executor_proxy.h | 4 | ||||
-rw-r--r-- | src/mongo/unittest/temp_dir.h | 4 | ||||
-rw-r--r-- | src/mongo/unittest/unittest.h | 12 |
5 files changed, 16 insertions, 12 deletions
diff --git a/src/mongo/unittest/barrier.h b/src/mongo/unittest/barrier.h index 4003df90d9b..6b3d102fc6f 100644 --- a/src/mongo/unittest/barrier.h +++ b/src/mongo/unittest/barrier.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/stdx/condition_variable.h" #include "mongo/stdx/mutex.h" @@ -42,7 +41,8 @@ namespace unittest { * All threads are unblocked when the counter reaches zero and the counter is reset. */ class Barrier { - MONGO_DISALLOW_COPYING(Barrier); + Barrier(const Barrier&) = delete; + Barrier& operator=(const Barrier&) = delete; public: /** diff --git a/src/mongo/unittest/death_test.h b/src/mongo/unittest/death_test.h index 7cbcdb1f768..c6bdb1a937a 100644 --- a/src/mongo/unittest/death_test.h +++ b/src/mongo/unittest/death_test.h @@ -32,7 +32,6 @@ #include <memory> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/stdx/memory.h" #include "mongo/unittest/unittest.h" @@ -90,7 +89,8 @@ namespace mongo { namespace unittest { class DeathTestImpl : public Test { - MONGO_DISALLOW_COPYING(DeathTestImpl); + DeathTestImpl(const DeathTestImpl&) = delete; + DeathTestImpl& operator=(const DeathTestImpl&) = delete; protected: explicit DeathTestImpl(stdx::function<std::unique_ptr<Test>()> makeTest); diff --git a/src/mongo/unittest/task_executor_proxy.h b/src/mongo/unittest/task_executor_proxy.h index f4860692f38..436c3a72216 100644 --- a/src/mongo/unittest/task_executor_proxy.h +++ b/src/mongo/unittest/task_executor_proxy.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/executor/task_executor.h" namespace mongo { @@ -39,7 +38,8 @@ namespace unittest { * Proxy for the executor::TaskExecutor interface used for testing. */ class TaskExecutorProxy : public executor::TaskExecutor { - MONGO_DISALLOW_COPYING(TaskExecutorProxy); + TaskExecutorProxy(const TaskExecutorProxy&) = delete; + TaskExecutorProxy& operator=(const TaskExecutorProxy&) = delete; public: /** diff --git a/src/mongo/unittest/temp_dir.h b/src/mongo/unittest/temp_dir.h index f12673159c7..17fbc82e1e5 100644 --- a/src/mongo/unittest/temp_dir.h +++ b/src/mongo/unittest/temp_dir.h @@ -31,7 +31,6 @@ #include <string> -#include "mongo/base/disallow_copying.h" namespace mongo { namespace unittest { @@ -40,7 +39,8 @@ namespace unittest { * An RAII temporary directory that deletes itself and all contents files on scope exit. */ class TempDir { - MONGO_DISALLOW_COPYING(TempDir); + TempDir(const TempDir&) = delete; + TempDir& operator=(const TempDir&) = delete; public: /** diff --git a/src/mongo/unittest/unittest.h b/src/mongo/unittest/unittest.h index 7144944389a..204443b9708 100644 --- a/src/mongo/unittest/unittest.h +++ b/src/mongo/unittest/unittest.h @@ -290,7 +290,8 @@ typedef stdx::function<void(void)> TestFunction; * contain lists of these. */ class TestHolder { - MONGO_DISALLOW_COPYING(TestHolder); + TestHolder(const TestHolder&) = delete; + TestHolder& operator=(const TestHolder&) = delete; public: TestHolder(const std::string& name, const TestFunction& fn) : _name(name), _fn(fn) {} @@ -313,7 +314,8 @@ private: * by the TEST() macro. */ class Test { - MONGO_DISALLOW_COPYING(Test); + Test(const Test&) = delete; + Test& operator=(const Test&) = delete; public: Test(); @@ -337,7 +339,8 @@ protected: */ template <typename T> class RegistrationAgent { - MONGO_DISALLOW_COPYING(RegistrationAgent); + RegistrationAgent(const RegistrationAgent&) = delete; + RegistrationAgent& operator=(const RegistrationAgent&) = delete; public: RegistrationAgent(const std::string& suiteName, const std::string& testName); @@ -409,7 +412,8 @@ private: * approach is deprecated. */ class Suite { - MONGO_DISALLOW_COPYING(Suite); + Suite(const Suite&) = delete; + Suite& operator=(const Suite&) = delete; public: Suite(const std::string& name); |