diff options
author | John Esmet <john.esmet@gmail.com> | 2014-10-16 20:02:03 -0400 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2014-10-17 10:17:12 -0400 |
commit | a1b5c0925eedec72e402878433da4890630ef533 (patch) | |
tree | 525db075179c91b3415ecc1af2bc5d595b357d20 /src/mongo/db/storage/sorted_data_interface_test_harness.cpp | |
parent | a868d509e98c217edeb51e42623725272e114eea (diff) | |
download | mongo-a1b5c0925eedec72e402878433da4890630ef533.tar.gz |
SERVER-15700 Modify SortedDataInterface to not require unindex() to return
whether the index row was deleted. Fix unit tests to manually verify that
unindex() operations had the desired effect (in the same operation context)
Closes #827
Signed-off-by: Benety Goh <benety@mongodb.com>
Diffstat (limited to 'src/mongo/db/storage/sorted_data_interface_test_harness.cpp')
-rw-r--r-- | src/mongo/db/storage/sorted_data_interface_test_harness.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mongo/db/storage/sorted_data_interface_test_harness.cpp b/src/mongo/db/storage/sorted_data_interface_test_harness.cpp index b731931de92..dd04bb3945f 100644 --- a/src/mongo/db/storage/sorted_data_interface_test_harness.cpp +++ b/src/mongo/db/storage/sorted_data_interface_test_harness.cpp @@ -203,7 +203,8 @@ namespace mongo { scoped_ptr<OperationContext> opCtx( harnessHelper->newOperationContext() ); { WriteUnitOfWork uow( opCtx.get() ); - ASSERT( !sorted->unindex( opCtx.get(), BSON( "" << 1 ), DiskLoc( 5, 20 ), true ) ); + sorted->unindex( opCtx.get(), BSON( "" << 1 ), DiskLoc( 5, 20 ), true ); + ASSERT_EQUALS( 1, sorted->numEntries( opCtx.get() ) ); uow.commit(); } } @@ -217,7 +218,8 @@ namespace mongo { scoped_ptr<OperationContext> opCtx( harnessHelper->newOperationContext() ); { WriteUnitOfWork uow( opCtx.get() ); - ASSERT( !sorted->unindex( opCtx.get(), BSON( "" << 2 ), DiskLoc( 5, 18 ), true ) ); + sorted->unindex( opCtx.get(), BSON( "" << 2 ), DiskLoc( 5, 18 ), true ); + ASSERT_EQUALS( 1, sorted->numEntries( opCtx.get() ) ); uow.commit(); } } @@ -232,7 +234,8 @@ namespace mongo { scoped_ptr<OperationContext> opCtx( harnessHelper->newOperationContext() ); { WriteUnitOfWork uow( opCtx.get() ); - ASSERT( sorted->unindex( opCtx.get(), BSON( "" << 1 ), DiskLoc( 5, 18 ), true ) ); + sorted->unindex( opCtx.get(), BSON( "" << 1 ), DiskLoc( 5, 18 ), true ); + ASSERT( sorted->isEmpty( opCtx.get() ) ); uow.commit(); } } @@ -266,7 +269,8 @@ namespace mongo { scoped_ptr<OperationContext> opCtx( harnessHelper->newOperationContext() ); { WriteUnitOfWork uow( opCtx.get() ); - ASSERT( sorted->unindex( opCtx.get(), BSON( "" << 1 ), DiskLoc( 5, 18 ), true ) ); + sorted->unindex( opCtx.get(), BSON( "" << 1 ), DiskLoc( 5, 18 ), true ); + ASSERT( sorted->isEmpty( opCtx.get() ) ); // no commit } } |