summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/record_store_test_datafor.cpp
diff options
context:
space:
mode:
authorADAM David Alan Martin <adam.martin@10gen.com>2016-12-14 14:39:44 -0500
committerADAM David Alan Martin <adam.martin@10gen.com>2016-12-14 14:41:31 -0500
commit2fd5d3f6cecc0d4f8f3816031352d69ca80e5d1c (patch)
tree8350daf4d5225504853ff19f4b0117aaac805417 /src/mongo/db/storage/record_store_test_datafor.cpp
parent0590b0da70cfdad7edf8d214bbfb5d8d8b6e502e (diff)
downloadmongo-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_datafor.cpp')
-rw-r--r--src/mongo/db/storage/record_store_test_datafor.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/db/storage/record_store_test_datafor.cpp b/src/mongo/db/storage/record_store_test_datafor.cpp
index aa97da93979..a1935dc0d93 100644
--- a/src/mongo/db/storage/record_store_test_datafor.cpp
+++ b/src/mongo/db/storage/record_store_test_datafor.cpp
@@ -37,17 +37,18 @@
#include "mongo/db/storage/record_store.h"
#include "mongo/unittest/unittest.h"
-using std::string;
-using std::stringstream;
namespace mongo {
+namespace {
+using std::string;
+using std::stringstream;
using std::unique_ptr;
// Insert a record and verify its contents by calling dataFor()
// on the returned RecordId.
TEST(RecordStoreTestHarness, DataFor) {
- unique_ptr<HarnessHelper> harnessHelper(newHarnessHelper());
+ const auto harnessHelper(newRecordStoreHarnessHelper());
unique_ptr<RecordStore> rs(harnessHelper->newNonCappedRecordStore());
{
@@ -87,7 +88,7 @@ TEST(RecordStoreTestHarness, DataFor) {
// Insert multiple records and verify their contents by calling dataFor()
// on each of the returned RecordIds.
TEST(RecordStoreTestHarness, DataForMultiple) {
- unique_ptr<HarnessHelper> harnessHelper(newHarnessHelper());
+ const auto harnessHelper(newRecordStoreHarnessHelper());
unique_ptr<RecordStore> rs(harnessHelper->newNonCappedRecordStore());
{
@@ -132,4 +133,5 @@ TEST(RecordStoreTestHarness, DataForMultiple) {
}
}
+} // namespace
} // namespace mongo