summaryrefslogtreecommitdiff
path: root/src/mongo/db/range_deleter_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/range_deleter_test.cpp')
-rw-r--r--src/mongo/db/range_deleter_test.cpp34
1 files changed, 14 insertions, 20 deletions
diff --git a/src/mongo/db/range_deleter_test.cpp b/src/mongo/db/range_deleter_test.cpp
index 3db312b7f98..29034535e44 100644
--- a/src/mongo/db/range_deleter_test.cpp
+++ b/src/mongo/db/range_deleter_test.cpp
@@ -41,24 +41,11 @@
#include "mongo/unittest/unittest.h"
#include "mongo/util/scopeguard.h"
+namespace mongo {
namespace {
using std::string;
-using mongo::BSONObj;
-using mongo::CursorId;
-using mongo::DeletedRange;
-using mongo::FieldParser;
-using mongo::KeyRange;
-using mongo::Notification;
-using mongo::OperationContext;
-using mongo::RangeDeleter;
-using mongo::RangeDeleterMockEnv;
-using mongo::RangeDeleterOptions;
-using mongo::MakeGuard;
-
-namespace stdx = mongo::stdx;
-
OperationContext* const noTxn = NULL; // MockEnv doesn't need txn XXX SERVER-13931
// Capped sleep interval is 640 mSec, Nyquist frequency is 1280 mSec => round up to 2 sec.
@@ -188,9 +175,12 @@ TEST(ImmediateDelete, ShouldWaitCursor) {
KeyRange(ns, BSON("x" << 0), BSON("x" << 10), BSON("x" << 1)));
deleterOption.waitForOpenCursors = true;
- stdx::packaged_task<void()> deleterTask(
- [&] { deleter.deleteNow(noTxn, deleterOption, &errMsg); });
- stdx::future<void> deleterFuture = deleterTask.get_future();
+ // VS2013 Doesn't support future<void>, so fake it with a bool.
+ stdx::packaged_task<bool()> deleterTask([&] {
+ deleter.deleteNow(noTxn, deleterOption, &errMsg);
+ return true;
+ });
+ stdx::future<bool> deleterFuture = deleterTask.get_future();
stdx::thread deleterThread(std::move(deleterTask));
auto guard = MakeGuard([&] {
@@ -243,9 +233,12 @@ TEST(ImmediateDelete, StopWhileWaitingCursor) {
KeyRange(ns, BSON("x" << 0), BSON("x" << 10), BSON("x" << 1)));
deleterOption.waitForOpenCursors = true;
- stdx::packaged_task<void()> deleterTask(
- [&] { deleter.deleteNow(noTxn, deleterOption, &errMsg); });
- stdx::future<void> deleterFuture = deleterTask.get_future();
+ // VS2013 Doesn't support future<void>, so fake it with a bool.
+ stdx::packaged_task<bool()> deleterTask([&] {
+ deleter.deleteNow(noTxn, deleterOption, &errMsg);
+ return true;
+ });
+ stdx::future<bool> deleterFuture = deleterTask.get_future();
stdx::thread deleterThread(std::move(deleterTask));
auto join_thread_guard = MakeGuard([&] { deleterThread.join(); });
@@ -370,3 +363,4 @@ TEST(MixedDeletes, MultipleDeletes) {
}
} // unnamed namespace
+} // namespace mongo