summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/kv/kv_engine_test_harness.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/storage/kv/kv_engine_test_harness.cpp')
-rw-r--r--src/mongo/db/storage/kv/kv_engine_test_harness.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/mongo/db/storage/kv/kv_engine_test_harness.cpp b/src/mongo/db/storage/kv/kv_engine_test_harness.cpp
index c225fb7ada3..ae6964d6d98 100644
--- a/src/mongo/db/storage/kv/kv_engine_test_harness.cpp
+++ b/src/mongo/db/storage/kv/kv_engine_test_harness.cpp
@@ -30,7 +30,6 @@
#include "mongo/db/storage/kv/kv_engine_test_harness.h"
-
#include "mongo/db/operation_context_noop.h"
#include "mongo/db/index/index_descriptor.h"
#include "mongo/db/storage/kv/kv_catalog.h"
@@ -38,6 +37,7 @@
#include "mongo/db/storage/record_store.h"
#include "mongo/db/storage/sorted_data_interface.h"
#include "mongo/unittest/unittest.h"
+#include "mongo/util/clock_source_mock.h"
namespace mongo {
@@ -49,10 +49,12 @@ class MyOperationContext : public OperationContextNoop {
public:
MyOperationContext(KVEngine* engine) : OperationContextNoop(engine->newRecoveryUnit()) {}
};
+
+const std::unique_ptr<ClockSource> clock = stdx::make_unique<ClockSourceMock>();
}
TEST(KVEngineTestHarness, SimpleRS1) {
- unique_ptr<KVHarnessHelper> helper(KVHarnessHelper::create());
+ unique_ptr<KVHarnessHelper> helper(KVHarnessHelper::create(clock.get()));
KVEngine* engine = helper->getEngine();
ASSERT(engine);
@@ -90,7 +92,7 @@ TEST(KVEngineTestHarness, SimpleRS1) {
}
TEST(KVEngineTestHarness, Restart1) {
- unique_ptr<KVHarnessHelper> helper(KVHarnessHelper::create());
+ unique_ptr<KVHarnessHelper> helper(KVHarnessHelper::create(clock.get()));
KVEngine* engine = helper->getEngine();
ASSERT(engine);
@@ -134,7 +136,7 @@ TEST(KVEngineTestHarness, Restart1) {
TEST(KVEngineTestHarness, SimpleSorted1) {
- unique_ptr<KVHarnessHelper> helper(KVHarnessHelper::create());
+ unique_ptr<KVHarnessHelper> helper(KVHarnessHelper::create(clock.get()));
KVEngine* engine = helper->getEngine();
ASSERT(engine);
@@ -162,7 +164,7 @@ TEST(KVEngineTestHarness, SimpleSorted1) {
}
TEST(KVCatalogTest, Coll1) {
- unique_ptr<KVHarnessHelper> helper(KVHarnessHelper::create());
+ unique_ptr<KVHarnessHelper> helper(KVHarnessHelper::create(clock.get()));
KVEngine* engine = helper->getEngine();
unique_ptr<RecordStore> rs;
@@ -206,7 +208,7 @@ TEST(KVCatalogTest, Coll1) {
TEST(KVCatalogTest, Idx1) {
- unique_ptr<KVHarnessHelper> helper(KVHarnessHelper::create());
+ unique_ptr<KVHarnessHelper> helper(KVHarnessHelper::create(clock.get()));
KVEngine* engine = helper->getEngine();
unique_ptr<RecordStore> rs;
@@ -279,7 +281,7 @@ TEST(KVCatalogTest, Idx1) {
}
TEST(KVCatalogTest, DirectoryPerDb1) {
- unique_ptr<KVHarnessHelper> helper(KVHarnessHelper::create());
+ unique_ptr<KVHarnessHelper> helper(KVHarnessHelper::create(clock.get()));
KVEngine* engine = helper->getEngine();
unique_ptr<RecordStore> rs;
@@ -321,7 +323,7 @@ TEST(KVCatalogTest, DirectoryPerDb1) {
}
TEST(KVCatalogTest, Split1) {
- unique_ptr<KVHarnessHelper> helper(KVHarnessHelper::create());
+ unique_ptr<KVHarnessHelper> helper(KVHarnessHelper::create(clock.get()));
KVEngine* engine = helper->getEngine();
unique_ptr<RecordStore> rs;
@@ -363,7 +365,7 @@ TEST(KVCatalogTest, Split1) {
}
TEST(KVCatalogTest, DirectoryPerAndSplit1) {
- unique_ptr<KVHarnessHelper> helper(KVHarnessHelper::create());
+ unique_ptr<KVHarnessHelper> helper(KVHarnessHelper::create(clock.get()));
KVEngine* engine = helper->getEngine();
unique_ptr<RecordStore> rs;