diff options
author | Andy Schwerin <schwerin@mongodb.com> | 2016-05-24 16:34:45 -0400 |
---|---|---|
committer | Andy Schwerin <schwerin@mongodb.com> | 2016-06-03 12:48:38 -0400 |
commit | 910e782aa5d8329c5e8b2531cf0116052e8a187e (patch) | |
tree | 8c7b17d5808ffaf4b8b9c4ff6a973e34d4b851eb /src/mongo/db/storage/sorted_data_interface_test_unindex.cpp | |
parent | 0b5cbbadf49da830f20fba6e779b7278f211e394 (diff) | |
download | mongo-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/sorted_data_interface_test_unindex.cpp')
-rw-r--r-- | src/mongo/db/storage/sorted_data_interface_test_unindex.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/mongo/db/storage/sorted_data_interface_test_unindex.cpp b/src/mongo/db/storage/sorted_data_interface_test_unindex.cpp index d1101a90d12..1e217651fc4 100644 --- a/src/mongo/db/storage/sorted_data_interface_test_unindex.cpp +++ b/src/mongo/db/storage/sorted_data_interface_test_unindex.cpp @@ -43,12 +43,12 @@ TEST(SortedDataInterface, Unindex) { const std::unique_ptr<SortedDataInterface> sorted(harnessHelper->newSortedDataInterface(false)); { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT(sorted->isEmpty(opCtx.get())); } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); { WriteUnitOfWork uow(opCtx.get()); ASSERT_OK(sorted->insert(opCtx.get(), key1, loc1, true)); @@ -57,12 +57,12 @@ TEST(SortedDataInterface, Unindex) { } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT_EQUALS(1, sorted->numEntries(opCtx.get())); } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); { WriteUnitOfWork uow(opCtx.get()); sorted->unindex(opCtx.get(), key1, loc1, true); @@ -72,7 +72,7 @@ TEST(SortedDataInterface, Unindex) { } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT(sorted->isEmpty(opCtx.get())); } } @@ -83,12 +83,12 @@ TEST(SortedDataInterface, UnindexCompoundKey) { const std::unique_ptr<SortedDataInterface> sorted(harnessHelper->newSortedDataInterface(false)); { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT(sorted->isEmpty(opCtx.get())); } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); { WriteUnitOfWork uow(opCtx.get()); ASSERT_OK(sorted->insert(opCtx.get(), compoundKey1a, loc1, true)); @@ -97,12 +97,12 @@ TEST(SortedDataInterface, UnindexCompoundKey) { } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT_EQUALS(1, sorted->numEntries(opCtx.get())); } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); { WriteUnitOfWork uow(opCtx.get()); sorted->unindex(opCtx.get(), compoundKey1a, loc1, true); @@ -112,7 +112,7 @@ TEST(SortedDataInterface, UnindexCompoundKey) { } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT(sorted->isEmpty(opCtx.get())); } } @@ -123,12 +123,12 @@ TEST(SortedDataInterface, UnindexMultipleDistinct) { const std::unique_ptr<SortedDataInterface> sorted(harnessHelper->newSortedDataInterface(false)); { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT(sorted->isEmpty(opCtx.get())); } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); { WriteUnitOfWork uow(opCtx.get()); ASSERT_OK(sorted->insert(opCtx.get(), key1, loc1, true)); @@ -138,12 +138,12 @@ TEST(SortedDataInterface, UnindexMultipleDistinct) { } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT_EQUALS(2, sorted->numEntries(opCtx.get())); } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); { WriteUnitOfWork uow(opCtx.get()); sorted->unindex(opCtx.get(), key2, loc2, true); @@ -153,12 +153,12 @@ TEST(SortedDataInterface, UnindexMultipleDistinct) { } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT_EQUALS(1, sorted->numEntries(opCtx.get())); } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); { WriteUnitOfWork uow(opCtx.get()); ASSERT_OK(sorted->insert(opCtx.get(), key3, loc3, true)); @@ -167,12 +167,12 @@ TEST(SortedDataInterface, UnindexMultipleDistinct) { } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT_EQUALS(2, sorted->numEntries(opCtx.get())); } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); { WriteUnitOfWork uow(opCtx.get()); sorted->unindex(opCtx.get(), key1, loc1, true); @@ -184,7 +184,7 @@ TEST(SortedDataInterface, UnindexMultipleDistinct) { } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT(sorted->isEmpty(opCtx.get())); } } @@ -195,12 +195,12 @@ TEST(SortedDataInterface, UnindexMultipleSameKey) { const std::unique_ptr<SortedDataInterface> sorted(harnessHelper->newSortedDataInterface(false)); { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT(sorted->isEmpty(opCtx.get())); } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); { WriteUnitOfWork uow(opCtx.get()); ASSERT_OK(sorted->insert(opCtx.get(), key1, loc1, true)); @@ -210,12 +210,12 @@ TEST(SortedDataInterface, UnindexMultipleSameKey) { } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT_EQUALS(2, sorted->numEntries(opCtx.get())); } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); { WriteUnitOfWork uow(opCtx.get()); sorted->unindex(opCtx.get(), key1, loc2, true); @@ -225,12 +225,12 @@ TEST(SortedDataInterface, UnindexMultipleSameKey) { } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT_EQUALS(1, sorted->numEntries(opCtx.get())); } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); { WriteUnitOfWork uow(opCtx.get()); ASSERT_OK(sorted->insert(opCtx.get(), key1, loc3, true /* allow duplicates */)); @@ -239,12 +239,12 @@ TEST(SortedDataInterface, UnindexMultipleSameKey) { } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT_EQUALS(2, sorted->numEntries(opCtx.get())); } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); { WriteUnitOfWork uow(opCtx.get()); sorted->unindex(opCtx.get(), key1, loc1, true); @@ -256,7 +256,7 @@ TEST(SortedDataInterface, UnindexMultipleSameKey) { } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT(sorted->isEmpty(opCtx.get())); } } @@ -267,12 +267,12 @@ TEST(SortedDataInterface, UnindexEmpty) { const std::unique_ptr<SortedDataInterface> sorted(harnessHelper->newSortedDataInterface(false)); { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); ASSERT(sorted->isEmpty(opCtx.get())); } { - const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext()); + const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext()); { WriteUnitOfWork uow(opCtx.get()); sorted->unindex(opCtx.get(), key1, loc1, true); |