diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2017-12-14 18:31:59 -0500 |
---|---|---|
committer | Billy Donahue <billy.donahue@mongodb.com> | 2018-01-16 16:59:45 -0500 |
commit | a8561f9a3775083eaf17e648850791a2cbd37893 (patch) | |
tree | b8c03bf13d71d1a2aea1206c5153104016219b52 /src/mongo/unittest | |
parent | f2af0ad889f1cfca7a311d53912c5b808500ea77 (diff) | |
download | mongo-a8561f9a3775083eaf17e648850791a2cbd37893.tar.gz |
SERVER-32070 remove stdx::bind (final patch)
Diffstat (limited to 'src/mongo/unittest')
-rw-r--r-- | src/mongo/unittest/unittest.h | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/mongo/unittest/unittest.h b/src/mongo/unittest/unittest.h index 1913e7a9197..b20cb81c93e 100644 --- a/src/mongo/unittest/unittest.h +++ b/src/mongo/unittest/unittest.h @@ -383,14 +383,20 @@ public: add<T>(demangleName(typeid(T))); } - template <class T, typename A> + template <class T, class A> void add(const A& a) { - add(demangleName(typeid(T)), stdx::bind(&Suite::runTestObjectWithArg<T, A>, a)); + add(demangleName(typeid(T)), [a] { + T testObj(a); + testObj.run(); + }); } template <class T> void add(const std::string& name) { - add(name, &Suite::runTestObject<T>); + add(name, [] { + T testObj; + testObj.run(); + }); } void add(const std::string& name, const TestFunction& testFn); @@ -416,18 +422,6 @@ private: // TODO(C++11): Make this hold unique_ptrs. typedef std::vector<std::shared_ptr<TestHolder>> TestHolderList; - template <typename T> - static void runTestObject() { - T testObj; - testObj.run(); - } - - template <typename T, typename A> - static void runTestObjectWithArg(const A& a) { - T testObj(a); - testObj.run(); - } - std::string _name; TestHolderList _tests; bool _ran; |