summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/sorted_data_interface_test_rollback.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/sorted_data_interface_test_rollback.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/sorted_data_interface_test_rollback.cpp')
-rw-r--r--src/mongo/db/storage/sorted_data_interface_test_rollback.cpp28
1 files changed, 14 insertions, 14 deletions
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<SortedDataInterface> sorted(harnessHelper->newSortedDataInterface(true));
{
- 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, false));
@@ -58,12 +58,12 @@ TEST(SortedDataInterface, InsertWithoutCommit) {
}
{
- 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(), key2, loc1, false));
@@ -73,7 +73,7 @@ TEST(SortedDataInterface, InsertWithoutCommit) {
}
{
- const std::unique_ptr<OperationContext> 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<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));
@@ -101,12 +101,12 @@ TEST(SortedDataInterface, UnindexWithoutCommit) {
}
{
- 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);
@@ -116,12 +116,12 @@ TEST(SortedDataInterface, UnindexWithoutCommit) {
}
{
- 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());
ASSERT_OK(sorted->insert(opCtx.get(), key3, loc3, true));
@@ -130,12 +130,12 @@ TEST(SortedDataInterface, UnindexWithoutCommit) {
}
{
- const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext());
+ const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext());
ASSERT_EQUALS(3, 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);
@@ -147,7 +147,7 @@ TEST(SortedDataInterface, UnindexWithoutCommit) {
}
{
- const std::unique_ptr<OperationContext> opCtx(harnessHelper->newOperationContext());
+ const ServiceContext::UniqueOperationContext opCtx(harnessHelper->newOperationContext());
ASSERT_EQUALS(3, sorted->numEntries(opCtx.get()));
}
}