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_rollback.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_rollback.cpp')
-rw-r--r-- | src/mongo/db/storage/sorted_data_interface_test_rollback.cpp | 9 |
1 files changed, 6 insertions, 3 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 0216f35f575..dc6da2a988e 100644 --- a/src/mongo/db/storage/sorted_data_interface_test_rollback.cpp +++ b/src/mongo/db/storage/sorted_data_interface_test_rollback.cpp @@ -107,7 +107,8 @@ namespace mongo { scoped_ptr<OperationContext> opCtx( harnessHelper->newOperationContext() ); { WriteUnitOfWork uow( opCtx.get() ); - ASSERT( sorted->unindex( opCtx.get(), key2, loc2, true ) ); + sorted->unindex( opCtx.get(), key2, loc2, true ); + ASSERT_EQUALS( 1, sorted->numEntries( opCtx.get() ) ); // no commit } } @@ -135,8 +136,10 @@ namespace mongo { scoped_ptr<OperationContext> opCtx( harnessHelper->newOperationContext() ); { WriteUnitOfWork uow( opCtx.get() ); - ASSERT( sorted->unindex( opCtx.get(), key1, loc1, true ) ); - ASSERT( sorted->unindex( opCtx.get(), key3, loc3, true ) ); + sorted->unindex( opCtx.get(), key1, loc1, true ); + ASSERT_EQUALS( 2, sorted->numEntries( opCtx.get() ) ); + sorted->unindex( opCtx.get(), key3, loc3, true ); + ASSERT_EQUALS( 1, sorted->numEntries( opCtx.get() ) ); // no commit } } |