From 1422c3fc47bce99839fdcce0359bb79fd06dc96b Mon Sep 17 00:00:00 2001 From: Xiangyu Yao Date: Wed, 21 Aug 2019 20:28:34 -0400 Subject: SERVER-42904 Fix unittest compile --- .../sorted_data_interface_test_bulkbuilder.cpp | 31 +++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'src/mongo') diff --git a/src/mongo/db/storage/sorted_data_interface_test_bulkbuilder.cpp b/src/mongo/db/storage/sorted_data_interface_test_bulkbuilder.cpp index 15a85756c19..58110f038c0 100644 --- a/src/mongo/db/storage/sorted_data_interface_test_bulkbuilder.cpp +++ b/src/mongo/db/storage/sorted_data_interface_test_bulkbuilder.cpp @@ -53,7 +53,7 @@ TEST(SortedDataInterface, BuilderAddKey) { const std::unique_ptr builder( sorted->getBulkBuilder(opCtx.get(), true)); - ASSERT_OK(builder->addKey(makeKeyString(sorted, key1, loc1))); + ASSERT_OK(builder->addKey(makeKeyString(sorted.get(), key1, loc1))); builder->commit(false); } @@ -111,7 +111,7 @@ TEST(SortedDataInterface, BuilderAddKeyWithReservedRecordId) { RecordId reservedLoc(RecordId::ReservedId::kWildcardMultikeyMetadataId); ASSERT(reservedLoc.isReserved()); - ASSERT_OK(builder->addKey(makeKeyString(sorted, key1, reservedLoc))); + ASSERT_OK(builder->addKey(makeKeyString(sorted.get(), key1, reservedLoc))); builder->commit(false); } @@ -137,7 +137,7 @@ TEST(SortedDataInterface, BuilderAddCompoundKey) { const std::unique_ptr builder( sorted->getBulkBuilder(opCtx.get(), true)); - ASSERT_OK(builder->addKey(makeKeyString(sorted, compoundKey1a, loc1))); + ASSERT_OK(builder->addKey(makeKeyString(sorted.get(), compoundKey1a, loc1))); builder->commit(false); } @@ -165,8 +165,9 @@ TEST(SortedDataInterface, BuilderAddSameKey) { const std::unique_ptr builder( sorted->getBulkBuilder(opCtx.get(), false)); - ASSERT_OK(builder->addKey(makeKeyString(sorted, key1, loc1))); - ASSERT_EQUALS(ErrorCodes::DuplicateKey, builder->addKey(makeKeyString(sorted, key1, loc2))); + ASSERT_OK(builder->addKey(makeKeyString(sorted.get(), key1, loc1))); + ASSERT_EQUALS(ErrorCodes::DuplicateKey, + builder->addKey(makeKeyString(sorted.get(), key1, loc2))); builder->commit(false); } @@ -228,8 +229,8 @@ TEST(SortedDataInterface, BuilderAddSameKeyWithDupsAllowed) { const std::unique_ptr builder( sorted->getBulkBuilder(opCtx.get(), true /* allow duplicates */)); - ASSERT_OK(builder->addKey(makeKeyString(sorted, key1, loc1))); - ASSERT_OK(builder->addKey(makeKeyString(sorted, key1, loc2))); + ASSERT_OK(builder->addKey(makeKeyString(sorted.get(), key1, loc1))); + ASSERT_OK(builder->addKey(makeKeyString(sorted.get(), key1, loc2))); builder->commit(false); } @@ -290,9 +291,9 @@ TEST(SortedDataInterface, BuilderAddMultipleKeys) { const std::unique_ptr builder( sorted->getBulkBuilder(opCtx.get(), true)); - ASSERT_OK(builder->addKey(makeKeyString(sorted, key1, loc1))); - ASSERT_OK(builder->addKey(makeKeyString(sorted, key2, loc2))); - ASSERT_OK(builder->addKey(makeKeyString(sorted, key3, loc3))); + ASSERT_OK(builder->addKey(makeKeyString(sorted.get(), key1, loc1))); + ASSERT_OK(builder->addKey(makeKeyString(sorted.get(), key2, loc2))); + ASSERT_OK(builder->addKey(makeKeyString(sorted.get(), key3, loc3))); builder->commit(false); } @@ -352,11 +353,11 @@ TEST(SortedDataInterface, BuilderAddMultipleCompoundKeys) { const std::unique_ptr builder( sorted->getBulkBuilder(opCtx.get(), true)); - ASSERT_OK(builder->addKey(makeKeyString(sorted, compoundKey1a, loc1))); - ASSERT_OK(builder->addKey(makeKeyString(sorted, compoundKey1b, loc2))); - ASSERT_OK(builder->addKey(makeKeyString(sorted, compoundKey1c, loc4))); - ASSERT_OK(builder->addKey(makeKeyString(sorted, compoundKey2b, loc3))); - ASSERT_OK(builder->addKey(makeKeyString(sorted, compoundKey3a, loc5))); + ASSERT_OK(builder->addKey(makeKeyString(sorted.get(), compoundKey1a, loc1))); + ASSERT_OK(builder->addKey(makeKeyString(sorted.get(), compoundKey1b, loc2))); + ASSERT_OK(builder->addKey(makeKeyString(sorted.get(), compoundKey1c, loc4))); + ASSERT_OK(builder->addKey(makeKeyString(sorted.get(), compoundKey2b, loc3))); + ASSERT_OK(builder->addKey(makeKeyString(sorted.get(), compoundKey3a, loc5))); builder->commit(false); } -- cgit v1.2.1