summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/record_store_test_truncate.cpp
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@mongodb.com>2016-05-24 16:34:45 -0400
committerAndy Schwerin <schwerin@mongodb.com>2016-06-03 12:48:38 -0400
commit910e782aa5d8329c5e8b2531cf0116052e8a187e (patch)
tree8c7b17d5808ffaf4b8b9c4ff6a973e34d4b851eb /src/mongo/db/storage/record_store_test_truncate.cpp
parent0b5cbbadf49da830f20fba6e779b7278f211e394 (diff)
downloadmongo-910e782aa5d8329c5e8b2531cf0116052e8a187e.tar.gz
SERVER-23905 Unify lifetime management for LockState on OperationContexts into OperationContext.
This change also moves responsibility for registering OperationContexts to Clients into ServiceContext::makeOperationContext.
Diffstat (limited to 'src/mongo/db/storage/record_store_test_truncate.cpp')
-rw-r--r--src/mongo/db/storage/record_store_test_truncate.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mongo/db/storage/record_store_test_truncate.cpp b/src/mongo/db/storage/record_store_test_truncate.cpp
index 8f29c838705..bb485c9ade8 100644
--- a/src/mongo/db/storage/record_store_test_truncate.cpp
+++ b/src/mongo/db/storage/record_store_test_truncate.cpp
@@ -48,12 +48,12 @@ TEST(RecordStoreTestHarness, TruncateEmpty) {
unique_ptr<RecordStore> rs(harnessHelper->newNonCappedRecordStore());
{
- unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext());
+ ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext());
ASSERT_EQUALS(0, rs->numRecords(opCtx.get()));
}
{
- unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext());
+ ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext());
{
WriteUnitOfWork uow(opCtx.get());
ASSERT_OK(rs->truncate(opCtx.get()));
@@ -62,7 +62,7 @@ TEST(RecordStoreTestHarness, TruncateEmpty) {
}
{
- unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext());
+ ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext());
ASSERT_EQUALS(0, rs->numRecords(opCtx.get()));
}
}
@@ -74,13 +74,13 @@ TEST(RecordStoreTestHarness, TruncateNonEmpty) {
unique_ptr<RecordStore> rs(harnessHelper->newNonCappedRecordStore());
{
- unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext());
+ ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext());
ASSERT_EQUALS(0, rs->numRecords(opCtx.get()));
}
int nToInsert = 10;
for (int i = 0; i < nToInsert; i++) {
- unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext());
+ ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext());
{
stringstream ss;
ss << "record " << i;
@@ -95,12 +95,12 @@ TEST(RecordStoreTestHarness, TruncateNonEmpty) {
}
{
- unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext());
+ ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext());
ASSERT_EQUALS(nToInsert, rs->numRecords(opCtx.get()));
}
{
- unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext());
+ ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext());
{
WriteUnitOfWork uow(opCtx.get());
ASSERT_OK(rs->truncate(opCtx.get()));
@@ -109,7 +109,7 @@ TEST(RecordStoreTestHarness, TruncateNonEmpty) {
}
{
- unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext());
+ ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext());
ASSERT_EQUALS(0, rs->numRecords(opCtx.get()));
}
}