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/record_store_test_randomiter.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/record_store_test_randomiter.cpp')
-rw-r--r-- | src/mongo/db/storage/record_store_test_randomiter.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mongo/db/storage/record_store_test_randomiter.cpp b/src/mongo/db/storage/record_store_test_randomiter.cpp index dbb34c00fb4..4fa04ba7440 100644 --- a/src/mongo/db/storage/record_store_test_randomiter.cpp +++ b/src/mongo/db/storage/record_store_test_randomiter.cpp @@ -30,24 +30,23 @@ #include "mongo/platform/basic.h" -#include "mongo/db/storage/record_store_test_harness.h" - - #include "mongo/db/record_id.h" #include "mongo/db/storage/record_data.h" #include "mongo/db/storage/record_store.h" +#include "mongo/db/storage/record_store_test_harness.h" #include "mongo/unittest/unittest.h" +namespace mongo { +namespace { + using std::unique_ptr; using std::set; using std::string; using std::stringstream; -namespace mongo { - // Create a random iterator for empty record store. TEST(RecordStoreTestHarness, GetRandomIteratorEmpty) { - unique_ptr<HarnessHelper> harnessHelper(newHarnessHelper()); + const auto harnessHelper(newRecordStoreHarnessHelper()); unique_ptr<RecordStore> rs(harnessHelper->newNonCappedRecordStore()); { @@ -68,7 +67,7 @@ TEST(RecordStoreTestHarness, GetRandomIteratorEmpty) { // Insert multiple records and create a random iterator for the record store TEST(RecordStoreTestHarness, GetRandomIteratorNonEmpty) { - unique_ptr<HarnessHelper> harnessHelper(newHarnessHelper()); + const auto harnessHelper(newRecordStoreHarnessHelper()); unique_ptr<RecordStore> rs(harnessHelper->newNonCappedRecordStore()); { @@ -129,7 +128,7 @@ TEST(RecordStoreTestHarness, GetRandomIteratorNonEmpty) { // Insert a single record. Create a random iterator pointing to that single record. // Then check we'll retrieve the record. TEST(RecordStoreTestHarness, GetRandomIteratorSingleton) { - unique_ptr<HarnessHelper> harnessHelper(newHarnessHelper()); + const auto harnessHelper(newRecordStoreHarnessHelper()); unique_ptr<RecordStore> rs(harnessHelper->newNonCappedRecordStore()); { @@ -182,4 +181,5 @@ TEST(RecordStoreTestHarness, GetRandomIteratorSingleton) { } } } +} // namespace } // namespace mongo |