summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/sorted_data_interface_test_isempty.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2015-04-09 14:40:10 -0400
committerMathias Stearn <mathias@10gen.com>2015-04-15 19:28:35 -0400
commita1a846bdc63b92474fcf3477aea472a7e11cd438 (patch)
tree440859b71041c4260c1359c0e0bda6fff14f179a /src/mongo/db/storage/sorted_data_interface_test_isempty.cpp
parent6546083077887e8dc6ea47c26dc4631709a8ff99 (diff)
downloadmongo-a1a846bdc63b92474fcf3477aea472a7e11cd438.tar.gz
SERVER-17635 Improve SDI unittest helpers
* Added a declaritive way to set index contents * Use std::unique_ptr throughout
Diffstat (limited to 'src/mongo/db/storage/sorted_data_interface_test_isempty.cpp')
-rw-r--r--src/mongo/db/storage/sorted_data_interface_test_isempty.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/mongo/db/storage/sorted_data_interface_test_isempty.cpp b/src/mongo/db/storage/sorted_data_interface_test_isempty.cpp
index d8d40a58cbc..8dcef9a3770 100644
--- a/src/mongo/db/storage/sorted_data_interface_test_isempty.cpp
+++ b/src/mongo/db/storage/sorted_data_interface_test_isempty.cpp
@@ -30,29 +30,27 @@
#include "mongo/db/storage/sorted_data_interface_test_harness.h"
-#include <boost/scoped_ptr.hpp>
+#include <memory>
#include "mongo/db/storage/sorted_data_interface.h"
#include "mongo/unittest/unittest.h"
namespace mongo {
- using boost::scoped_ptr;
-
// Verify that isEmpty() returns true when the index is empty,
// returns false when a key is inserted, and returns true again
// when that is unindex.
TEST( SortedDataInterface, IsEmpty ) {
- scoped_ptr<HarnessHelper> harnessHelper( newHarnessHelper() );
- scoped_ptr<SortedDataInterface> sorted( harnessHelper->newSortedDataInterface( true ) );
+ const std::unique_ptr<HarnessHelper> harnessHelper( newHarnessHelper() );
+ const std::unique_ptr<SortedDataInterface> sorted( harnessHelper->newSortedDataInterface( true ) );
{
- scoped_ptr<OperationContext> opCtx( harnessHelper->newOperationContext() );
+ const std::unique_ptr<OperationContext> opCtx( harnessHelper->newOperationContext() );
ASSERT( sorted->isEmpty( opCtx.get() ) );
}
{
- scoped_ptr<OperationContext> opCtx( harnessHelper->newOperationContext() );
+ const std::unique_ptr<OperationContext> opCtx( harnessHelper->newOperationContext() );
{
WriteUnitOfWork uow( opCtx.get() );
ASSERT_OK( sorted->insert( opCtx.get(), key1, loc1, false ) );
@@ -61,12 +59,12 @@ namespace mongo {
}
{
- scoped_ptr<OperationContext> opCtx( harnessHelper->newOperationContext() );
+ const std::unique_ptr<OperationContext> opCtx( harnessHelper->newOperationContext() );
ASSERT( !sorted->isEmpty( opCtx.get() ) );
}
{
- scoped_ptr<OperationContext> opCtx( harnessHelper->newOperationContext() );
+ const std::unique_ptr<OperationContext> opCtx( harnessHelper->newOperationContext() );
{
WriteUnitOfWork uow( opCtx.get() );
sorted->unindex( opCtx.get(), key1, loc1, false );
@@ -76,7 +74,7 @@ namespace mongo {
}
{
- scoped_ptr<OperationContext> opCtx( harnessHelper->newOperationContext() );
+ const std::unique_ptr<OperationContext> opCtx( harnessHelper->newOperationContext() );
ASSERT( sorted->isEmpty( opCtx.get() ) );
}
}