diff options
author | Waley Chen <waleycz@gmail.com> | 2016-05-02 17:42:40 -0400 |
---|---|---|
committer | Waley Chen <waleycz@gmail.com> | 2016-05-02 18:18:48 -0400 |
commit | da38826985001daff55c7e2f723f73f5263e2dbf (patch) | |
tree | 947fac050de09b26e1ee1e7626cb519f30f39a1b /src/mongo/db/storage/kv/kv_engine_test_harness.cpp | |
parent | a45700cc0121c53b09c8fb6761703509427cff62 (diff) | |
download | mongo-da38826985001daff55c7e2f723f73f5263e2dbf.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; |