summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/documentsourcetests.cpp
diff options
context:
space:
mode:
authorQingyang Chen <qingyang.chen@10gen.com>2015-06-16 16:16:12 -0400
committerQingyang Chen <qingyang.chen@10gen.com>2015-06-22 13:17:31 -0400
commit3f6f66daac840fe2b2dc26eeeacbf015479567df (patch)
tree3b8f907c22f9ec41f1a72d1ea71f1dff8376a77d /src/mongo/dbtests/documentsourcetests.cpp
parent1e786585ae83e55e13016a6761a121b502c887f8 (diff)
downloadmongo-3f6f66daac840fe2b2dc26eeeacbf015479567df.tar.gz
SERVER-16889 query subsystem CanonicalQuery::canonicalize use StatusWith<unique_ptr> for ownership transfer
Diffstat (limited to 'src/mongo/dbtests/documentsourcetests.cpp')
-rw-r--r--src/mongo/dbtests/documentsourcetests.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mongo/dbtests/documentsourcetests.cpp b/src/mongo/dbtests/documentsourcetests.cpp
index 834e38ddaed..53f92a09aeb 100644
--- a/src/mongo/dbtests/documentsourcetests.cpp
+++ b/src/mongo/dbtests/documentsourcetests.cpp
@@ -51,6 +51,7 @@ using std::shared_ptr;
using std::map;
using std::set;
using std::string;
+using std::unique_ptr;
using std::vector;
static const char* const ns = "unittests.documentsourcetests";
@@ -178,11 +179,12 @@ protected:
_exec.reset();
OldClientWriteContext ctx(&_opCtx, ns);
- CanonicalQuery* cq;
- uassertStatusOK(CanonicalQuery::canonicalize(ns, /*query=*/BSONObj(), &cq));
+ auto statusWithCQ = CanonicalQuery::canonicalize(ns, /*query=*/BSONObj());
+ uassertStatusOK(statusWithCQ.getStatus());
+ unique_ptr<CanonicalQuery> cq = std::move(statusWithCQ.getValue());
PlanExecutor* execBare;
- uassertStatusOK(
- getExecutor(&_opCtx, ctx.getCollection(), cq, PlanExecutor::YIELD_MANUAL, &execBare));
+ uassertStatusOK(getExecutor(
+ &_opCtx, ctx.getCollection(), cq.release(), PlanExecutor::YIELD_MANUAL, &execBare));
_exec.reset(execBare);
_exec->saveState();
@@ -296,7 +298,7 @@ public:
private:
int _value;
- mutable stdx::mutex _mutex;
+ mutable mongo::mutex _mutex;
mutable stdx::condition_variable _condition;
};