diff options
author | ADAM David Alan Martin <adam.martin@10gen.com> | 2016-12-14 14:39:44 -0500 |
---|---|---|
committer | ADAM David Alan Martin <adam.martin@10gen.com> | 2016-12-14 14:41:31 -0500 |
commit | 2fd5d3f6cecc0d4f8f3816031352d69ca80e5d1c (patch) | |
tree | 8350daf4d5225504853ff19f4b0117aaac805417 /src/mongo/db/storage/sorted_data_interface_test_dupkeycheck.cpp | |
parent | 0590b0da70cfdad7edf8d214bbfb5d8d8b6e502e (diff) | |
download | mongo-2fd5d3f6cecc0d4f8f3816031352d69ca80e5d1c.tar.gz |
SERVER-27257 Deduplicate symbol `newHarnessHelper`
The `newHarnessHelper` function was defined by multiple test driver
modules, each one specializing it to return a specific kind of
storage test driver's `HarnessHelper`. The two different kinds
of `HarnessHelper` class were given a common base class, and the
`newHarnessHelper` function was changed to a single implementation.
This new implementation returns the results of a `HarnessHelper`
factory function which can be registered by a MONGO_INITIALIZER
statement.
Diffstat (limited to 'src/mongo/db/storage/sorted_data_interface_test_dupkeycheck.cpp')
-rw-r--r-- | src/mongo/db/storage/sorted_data_interface_test_dupkeycheck.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/db/storage/sorted_data_interface_test_dupkeycheck.cpp b/src/mongo/db/storage/sorted_data_interface_test_dupkeycheck.cpp index c52ff7cc644..d0053632b69 100644 --- a/src/mongo/db/storage/sorted_data_interface_test_dupkeycheck.cpp +++ b/src/mongo/db/storage/sorted_data_interface_test_dupkeycheck.cpp @@ -36,12 +36,13 @@ #include "mongo/unittest/unittest.h" namespace mongo { +namespace { // Insert a key and verify that dupKeyCheck() returns a non-OK status for // the same key. When dupKeyCheck() is called with the exact (key, RecordId) // pair that was inserted, it should still return an OK status. TEST(SortedDataInterface, DupKeyCheckAfterInsert) { - const std::unique_ptr<HarnessHelper> harnessHelper(newHarnessHelper()); + const auto harnessHelper(newSortedDataInterfaceHarnessHelper()); const std::unique_ptr<SortedDataInterface> sorted(harnessHelper->newSortedDataInterface(true)); { @@ -77,7 +78,7 @@ TEST(SortedDataInterface, DupKeyCheckAfterInsert) { // Verify that dupKeyCheck() returns an OK status for a key that does // not exist in the index. TEST(SortedDataInterface, DupKeyCheckEmpty) { - const std::unique_ptr<HarnessHelper> harnessHelper(newHarnessHelper()); + const auto harnessHelper(newSortedDataInterfaceHarnessHelper()); const std::unique_ptr<SortedDataInterface> sorted(harnessHelper->newSortedDataInterface(true)); { @@ -98,7 +99,7 @@ TEST(SortedDataInterface, DupKeyCheckEmpty) { // Insert a key and verify that dupKeyCheck() acknowledges the duplicate key, even // when the insert key is located at a RecordId that comes after the one specified. TEST(SortedDataInterface, DupKeyCheckWhenDiskLocBefore) { - const std::unique_ptr<HarnessHelper> harnessHelper(newHarnessHelper()); + const auto harnessHelper(newSortedDataInterfaceHarnessHelper()); const std::unique_ptr<SortedDataInterface> sorted(harnessHelper->newSortedDataInterface(true)); { @@ -133,7 +134,7 @@ TEST(SortedDataInterface, DupKeyCheckWhenDiskLocBefore) { // Insert a key and verify that dupKeyCheck() acknowledges the duplicate key, even // when the insert key is located at a RecordId that comes before the one specified. TEST(SortedDataInterface, DupKeyCheckWhenDiskLocAfter) { - const std::unique_ptr<HarnessHelper> harnessHelper(newHarnessHelper()); + const auto harnessHelper(newSortedDataInterfaceHarnessHelper()); const std::unique_ptr<SortedDataInterface> sorted(harnessHelper->newSortedDataInterface(true)); { @@ -165,4 +166,5 @@ TEST(SortedDataInterface, DupKeyCheckWhenDiskLocAfter) { } } +} // namespace } // namespace mongo |