diff options
author | Andy Schwerin <schwerin@mongodb.com> | 2014-05-15 19:28:57 -0400 |
---|---|---|
committer | Andy Schwerin <schwerin@mongodb.com> | 2014-05-16 16:01:50 -0400 |
commit | 995c04a16090511692c67a3555bdb61b5a387fa1 (patch) | |
tree | d60126db86cff5ca377152bb6a6c4e0439c9d932 /src/mongo/db/range_deleter_test.cpp | |
parent | 864d86ad02e3de2149b4f80949d66a03cff061d1 (diff) | |
download | mongo-995c04a16090511692c67a3555bdb61b5a387fa1.tar.gz |
SERVER-13882 Replace boost::function with stdx::function and boost::bind with stdx::bind.
Diffstat (limited to 'src/mongo/db/range_deleter_test.cpp')
-rw-r--r-- | src/mongo/db/range_deleter_test.cpp | 71 |
1 files changed, 42 insertions, 29 deletions
diff --git a/src/mongo/db/range_deleter_test.cpp b/src/mongo/db/range_deleter_test.cpp index 5ae950a606b..10c0b16acec 100644 --- a/src/mongo/db/range_deleter_test.cpp +++ b/src/mongo/db/range_deleter_test.cpp @@ -26,7 +26,6 @@ * it in the license file. */ -#include <boost/bind.hpp> #include <boost/thread.hpp> #include <string> @@ -34,11 +33,11 @@ #include "mongo/db/range_deleter.h" #include "mongo/db/range_deleter_mock_env.h" #include "mongo/db/range_deleter_stats.h" +#include "mongo/stdx/functional.h" #include "mongo/unittest/unittest.h" namespace { - using boost::bind; using std::string; using mongo::BSONObj; @@ -138,6 +137,17 @@ namespace { ASSERT_FALSE(env->deleteOccured()); } + static void rangeDeleterDeleteNow(RangeDeleter* deleter, + OperationContext* txn, + const std::string& ns, + const BSONObj& min, + const BSONObj& max, + const BSONObj& shardKeyPattern, + bool secondaryThrottle, + std::string* errMsg) { + deleter->deleteNow(txn, ns, min, max, shardKeyPattern, secondaryThrottle, errMsg); + } + // Should not start delete if the set of cursors that were open when the // deleteNow method is called is still open. TEST(ImmediateDelete, ShouldWaitCursor) { @@ -149,15 +159,16 @@ namespace { env->addCursorId(ns, 345); string errMsg; - boost::thread deleterThread = boost::thread(boost::bind(&RangeDeleter::deleteNow, - &deleter, - noTxn, - ns, - BSON("x" << 0), - BSON("x" << 10), - BSON("x" << 1), - true, - &errMsg)); + boost::thread deleterThread = boost::thread(mongo::stdx::bind( + rangeDeleterDeleteNow, + &deleter, + noTxn, + ns, + BSON("x" << 0), + BSON("x" << 10), + BSON("x" << 1), + true, + &errMsg)); env->waitForNthGetCursor(1u); @@ -199,15 +210,16 @@ namespace { env->addCursorId(ns, 345); string errMsg; - boost::thread deleterThread = boost::thread(boost::bind(&RangeDeleter::deleteNow, - &deleter, - noTxn, - ns, - BSON("x" << 0), - BSON("x" << 10), - BSON("x" << 1), - true, - &errMsg)); + boost::thread deleterThread = boost::thread(mongo::stdx::bind( + rangeDeleterDeleteNow, + &deleter, + noTxn, + ns, + BSON("x" << 0), + BSON("x" << 10), + BSON("x" << 1), + true, + &errMsg)); env->waitForNthGetCursor(1u); @@ -441,15 +453,16 @@ namespace { env->pauseDeletes(); string delErrMsg; - boost::thread deleterThread = boost::thread(boost::bind(&RangeDeleter::deleteNow, - &deleter, - noTxn, - ns, - BSON("x" << 64), - BSON("x" << 70), - BSON("x" << 1), - true, - &delErrMsg)); + boost::thread deleterThread = boost::thread(mongo::stdx::bind( + rangeDeleterDeleteNow, + &deleter, + noTxn, + ns, + BSON("x" << 64), + BSON("x" << 70), + BSON("x" << 1), + true, + &delErrMsg)); env->waitForNthPausedDelete(1u); |