diff options
author | Maria van Keulen <maria@mongodb.com> | 2017-03-07 12:00:08 -0500 |
---|---|---|
committer | Maria van Keulen <maria@mongodb.com> | 2017-03-07 12:00:08 -0500 |
commit | 589a5c169ced8f6e9ddcd3d182ae1b75db6b7d79 (patch) | |
tree | c7a090ffdd56a91ae677e2492c61b820af44f964 /src/mongo/dbtests/dbhelper_tests.cpp | |
parent | 3cba97198638df3750e3b455e2ad57af7ee536ae (diff) | |
download | mongo-589a5c169ced8f6e9ddcd3d182ae1b75db6b7d79.tar.gz |
SERVER-27938 Rename all OperationContext variables to opCtx
This commit is an automated rename of all whole word instances of txn,
_txn, and txnPtr to opCtx, _opCtx, and opCtxPtr, respectively in all
.cpp and .h files in src/mongo.
Diffstat (limited to 'src/mongo/dbtests/dbhelper_tests.cpp')
-rw-r--r-- | src/mongo/dbtests/dbhelper_tests.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mongo/dbtests/dbhelper_tests.cpp b/src/mongo/dbtests/dbhelper_tests.cpp index fd0835ea4a2..0d2255ebea9 100644 --- a/src/mongo/dbtests/dbhelper_tests.cpp +++ b/src/mongo/dbtests/dbhelper_tests.cpp @@ -60,9 +60,9 @@ public: RemoveRange() : _min(4), _max(8) {} void run() { - const ServiceContext::UniqueOperationContext txnPtr = cc().makeOperationContext(); - OperationContext& txn = *txnPtr; - DBDirectClient client(&txn); + const ServiceContext::UniqueOperationContext opCtxPtr = cc().makeOperationContext(); + OperationContext& opCtx = *opCtxPtr; + DBDirectClient client(&opCtx); for (int i = 0; i < 10; ++i) { client.insert(ns, BSON("_id" << i)); @@ -70,18 +70,18 @@ public: { // Remove _id range [_min, _max). - ScopedTransaction transaction(&txn, MODE_IX); - Lock::DBLock lk(txn.lockState(), nsToDatabaseSubstring(ns), MODE_X); - OldClientContext ctx(&txn, ns); + ScopedTransaction transaction(&opCtx, MODE_IX); + Lock::DBLock lk(opCtx.lockState(), nsToDatabaseSubstring(ns), MODE_X); + OldClientContext ctx(&opCtx, ns); KeyRange range(ns, BSON("_id" << _min), BSON("_id" << _max), BSON("_id" << 1)); mongo::WriteConcernOptions dummyWriteConcern; Helpers::removeRange( - &txn, range, BoundInclusion::kIncludeStartKeyOnly, dummyWriteConcern); + &opCtx, range, BoundInclusion::kIncludeStartKeyOnly, dummyWriteConcern); } // Check that the expected documents remain. - ASSERT_BSONOBJ_EQ(expected(), docs(&txn)); + ASSERT_BSONOBJ_EQ(expected(), docs(&opCtx)); } private: @@ -96,8 +96,8 @@ private: return bab.arr(); } - BSONArray docs(OperationContext* txn) const { - DBDirectClient client(txn); + BSONArray docs(OperationContext* opCtx) const { + DBDirectClient client(opCtx); unique_ptr<DBClientCursor> cursor = client.query(ns, Query().hint(BSON("_id" << 1))); BSONArrayBuilder bab; while (cursor->more()) { |