From 910e782aa5d8329c5e8b2531cf0116052e8a187e Mon Sep 17 00:00:00 2001 From: Andy Schwerin Date: Tue, 24 May 2016 16:34:45 -0400 Subject: SERVER-23905 Unify lifetime management for LockState on OperationContexts into OperationContext. This change also moves responsibility for registering OperationContexts to Clients into ServiceContext::makeOperationContext. --- .../sorted_data_interface_test_rollback.cpp | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/mongo/db/storage/sorted_data_interface_test_rollback.cpp') diff --git a/src/mongo/db/storage/sorted_data_interface_test_rollback.cpp b/src/mongo/db/storage/sorted_data_interface_test_rollback.cpp index c99627bf4d1..fe980b0f129 100644 --- a/src/mongo/db/storage/sorted_data_interface_test_rollback.cpp +++ b/src/mongo/db/storage/sorted_data_interface_test_rollback.cpp @@ -44,12 +44,12 @@ TEST(SortedDataInterface, InsertWithoutCommit) { const std::unique_ptr sorted(harnessHelper->newSortedDataInterface(true)); { - const std::unique_ptr opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT(sorted->isEmpty(opCtx.get())); } { - const std::unique_ptr opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); { WriteUnitOfWork uow(opCtx.get()); ASSERT_OK(sorted->insert(opCtx.get(), key1, loc1, false)); @@ -58,12 +58,12 @@ TEST(SortedDataInterface, InsertWithoutCommit) { } { - const std::unique_ptr opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT(sorted->isEmpty(opCtx.get())); } { - const std::unique_ptr opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); { WriteUnitOfWork uow(opCtx.get()); ASSERT_OK(sorted->insert(opCtx.get(), key2, loc1, false)); @@ -73,7 +73,7 @@ TEST(SortedDataInterface, InsertWithoutCommit) { } { - const std::unique_ptr opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT(sorted->isEmpty(opCtx.get())); } } @@ -86,12 +86,12 @@ TEST(SortedDataInterface, UnindexWithoutCommit) { const std::unique_ptr sorted(harnessHelper->newSortedDataInterface(false)); { - const std::unique_ptr opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT(sorted->isEmpty(opCtx.get())); } { - const std::unique_ptr opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); { WriteUnitOfWork uow(opCtx.get()); ASSERT_OK(sorted->insert(opCtx.get(), key1, loc1, true)); @@ -101,12 +101,12 @@ TEST(SortedDataInterface, UnindexWithoutCommit) { } { - const std::unique_ptr opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT_EQUALS(2, sorted->numEntries(opCtx.get())); } { - const std::unique_ptr opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); { WriteUnitOfWork uow(opCtx.get()); sorted->unindex(opCtx.get(), key2, loc2, true); @@ -116,12 +116,12 @@ TEST(SortedDataInterface, UnindexWithoutCommit) { } { - const std::unique_ptr opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT_EQUALS(2, sorted->numEntries(opCtx.get())); } { - const std::unique_ptr opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); { WriteUnitOfWork uow(opCtx.get()); ASSERT_OK(sorted->insert(opCtx.get(), key3, loc3, true)); @@ -130,12 +130,12 @@ TEST(SortedDataInterface, UnindexWithoutCommit) { } { - const std::unique_ptr opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT_EQUALS(3, sorted->numEntries(opCtx.get())); } { - const std::unique_ptr opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); { WriteUnitOfWork uow(opCtx.get()); sorted->unindex(opCtx.get(), key1, loc1, true); @@ -147,7 +147,7 @@ TEST(SortedDataInterface, UnindexWithoutCommit) { } { - const std::unique_ptr opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT_EQUALS(3, sorted->numEntries(opCtx.get())); } } -- cgit v1.2.1