diff options
author | Waley Chen <waleycz@gmail.com> | 2016-05-02 21:40:41 -0400 |
---|---|---|
committer | Waley Chen <waleycz@gmail.com> | 2016-05-02 21:40:41 -0400 |
commit | 8abd5682f551ad79dec3557f721eebd45b21be0f (patch) | |
tree | e3430994fdf46a4cce8f40ce2f6e621c477065f3 /src/mongo/db/storage/kv/kv_engine_test_harness.cpp | |
parent | 21cfba12a005431b08a8c69dcdb1f262622ea780 (diff) | |
download | mongo-8abd5682f551ad79dec3557f721eebd45b21be0f.tar.gz |
SERVER-23243 Replace Listener::getElapsedTimeMillis() in elapsed_tracker.cpp
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.cpp | 20 |
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; |