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_unindex.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_unindex.cpp')
-rw-r--r-- | src/mongo/db/storage/sorted_data_interface_test_unindex.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mongo/db/storage/sorted_data_interface_test_unindex.cpp b/src/mongo/db/storage/sorted_data_interface_test_unindex.cpp index 1e217651fc4..3dde7859d9b 100644 --- a/src/mongo/db/storage/sorted_data_interface_test_unindex.cpp +++ b/src/mongo/db/storage/sorted_data_interface_test_unindex.cpp @@ -36,10 +36,11 @@ #include "mongo/unittest/unittest.h" namespace mongo { +namespace { // Insert a key and verify that it can be unindexed. TEST(SortedDataInterface, Unindex) { - const std::unique_ptr<HarnessHelper> harnessHelper(newHarnessHelper()); + const auto harnessHelper(newSortedDataInterfaceHarnessHelper()); const std::unique_ptr<SortedDataInterface> sorted(harnessHelper->newSortedDataInterface(false)); { @@ -79,7 +80,7 @@ TEST(SortedDataInterface, Unindex) { // Insert a compound key and verify that it can be unindexed. TEST(SortedDataInterface, UnindexCompoundKey) { - const std::unique_ptr<HarnessHelper> harnessHelper(newHarnessHelper()); + const auto harnessHelper(newSortedDataInterfaceHarnessHelper()); const std::unique_ptr<SortedDataInterface> sorted(harnessHelper->newSortedDataInterface(false)); { @@ -119,7 +120,7 @@ TEST(SortedDataInterface, UnindexCompoundKey) { // Insert multiple, distinct keys and verify that they can be unindexed. TEST(SortedDataInterface, UnindexMultipleDistinct) { - const std::unique_ptr<HarnessHelper> harnessHelper(newHarnessHelper()); + const auto harnessHelper(newSortedDataInterfaceHarnessHelper()); const std::unique_ptr<SortedDataInterface> sorted(harnessHelper->newSortedDataInterface(false)); { @@ -191,7 +192,7 @@ TEST(SortedDataInterface, UnindexMultipleDistinct) { // Insert the same key multiple times and verify that each occurrence can be unindexed. TEST(SortedDataInterface, UnindexMultipleSameKey) { - const std::unique_ptr<HarnessHelper> harnessHelper(newHarnessHelper()); + const auto harnessHelper(newSortedDataInterfaceHarnessHelper()); const std::unique_ptr<SortedDataInterface> sorted(harnessHelper->newSortedDataInterface(false)); { @@ -263,7 +264,7 @@ TEST(SortedDataInterface, UnindexMultipleSameKey) { // Call unindex() on a nonexistent key and verify the result is false. TEST(SortedDataInterface, UnindexEmpty) { - const std::unique_ptr<HarnessHelper> harnessHelper(newHarnessHelper()); + const auto harnessHelper(newSortedDataInterfaceHarnessHelper()); const std::unique_ptr<SortedDataInterface> sorted(harnessHelper->newSortedDataInterface(false)); { @@ -282,4 +283,5 @@ TEST(SortedDataInterface, UnindexEmpty) { } } +} // namespace } // namespace mongo |