From 3a1502c2e21eec47d34d73bb5ba641dfec51a5c2 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Fri, 15 Dec 2023 15:44:55 +0000 Subject: Remove most of the now void clock indirection. --- searchlib/src/tests/sortspec/multilevelsort_test.cpp | 17 +++++------------ .../vespa/searchlib/queryeval/fake_requestcontext.cpp | 3 +-- 2 files changed, 6 insertions(+), 14 deletions(-) (limited to 'searchlib/src') diff --git a/searchlib/src/tests/sortspec/multilevelsort_test.cpp b/searchlib/src/tests/sortspec/multilevelsort_test.cpp index 2d0456e13fc..f3bf363645e 100644 --- a/searchlib/src/tests/sortspec/multilevelsort_test.cpp +++ b/searchlib/src/tests/sortspec/multilevelsort_test.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -242,10 +241,8 @@ MultilevelSortTest::sortAndCheck(const std::vector &specs, uint32_t num, hits.emplace_back(i, getRandomValue()); } - vespalib::TestClock clock; - vespalib::Doom doom(clock.clock(), vespalib::steady_time::max()); search::uca::UcaConverterFactory ucaFactory; - FastS_SortSpec sorter("no-metastore", 7, doom, ucaFactory); + FastS_SortSpec sorter("no-metastore", 7, vespalib::Doom::never(), ucaFactory); // init sorter with sort data for (const auto & spec : specs) { AttributeGuard ag; @@ -384,10 +381,8 @@ TEST("require that all sort methods behave the same") } TEST("test that [docid] translates to [lid][paritionid]") { - vespalib::TestClock clock; - vespalib::Doom doom(clock.clock(), vespalib::steady_time::max()); search::uca::UcaConverterFactory ucaFactory; - FastS_SortSpec asc("no-metastore", 7, doom, ucaFactory); + FastS_SortSpec asc("no-metastore", 7, vespalib::Doom::never(), ucaFactory); RankedHit hits[2] = {RankedHit(91, 0.0), RankedHit(3, 2.0)}; search::AttributeManager mgr; search::AttributeContext ac(mgr); @@ -404,7 +399,7 @@ TEST("test that [docid] translates to [lid][paritionid]") { EXPECT_EQUAL(6u, sr2.second); EXPECT_EQUAL(0, memcmp(SECOND_ASC, sr2.first, 6)); - FastS_SortSpec desc("no-metastore", 7, doom, ucaFactory); + FastS_SortSpec desc("no-metastore", 7, vespalib::Doom::never(), ucaFactory); desc.Init("-[docid]", ac); desc.initWithoutSorting(hits, 2); sr1 = desc.getSortRef(0); @@ -416,10 +411,8 @@ TEST("test that [docid] translates to [lid][paritionid]") { } TEST("test that [docid] uses attribute when one exists") { - vespalib::TestClock clock; - vespalib::Doom doom(clock.clock(), vespalib::steady_time::max()); search::uca::UcaConverterFactory ucaFactory; - FastS_SortSpec asc("metastore", 7, doom, ucaFactory); + FastS_SortSpec asc("metastore", 7, vespalib::Doom::never(), ucaFactory); RankedHit hits[2] = {RankedHit(91, 0.0), RankedHit(3, 2.0)}; Config cfg(BasicType::INT64, CollectionType::SINGLE); auto metastore = AttributeFactory::createAttribute("metastore", cfg); @@ -445,7 +438,7 @@ TEST("test that [docid] uses attribute when one exists") { EXPECT_EQUAL(8u, sr2.second); EXPECT_EQUAL(0, memcmp(SECOND_ASC, sr2.first, 8)); - FastS_SortSpec desc("metastore", 7, doom, ucaFactory); + FastS_SortSpec desc("metastore", 7, vespalib::Doom::never(), ucaFactory); desc.Init("-[docid]", ac); desc.initWithoutSorting(hits, 2); sr1 = desc.getSortRef(0); diff --git a/searchlib/src/vespa/searchlib/queryeval/fake_requestcontext.cpp b/searchlib/src/vespa/searchlib/queryeval/fake_requestcontext.cpp index ae5a7583c8c..f15f3d0e84c 100644 --- a/searchlib/src/vespa/searchlib/queryeval/fake_requestcontext.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/fake_requestcontext.cpp @@ -3,7 +3,6 @@ #include "fake_requestcontext.h" #include - namespace search::queryeval { FakeRequestContext::FakeRequestContext() @@ -13,7 +12,7 @@ FakeRequestContext::FakeRequestContext() FakeRequestContext::FakeRequestContext(attribute::IAttributeContext * context, vespalib::steady_time softDoom, vespalib::steady_time hardDoom) : _clock(std::make_unique()), - _doom(_clock->clock(), softDoom, hardDoom, false), + _doom(_clock->nowRef(), softDoom, hardDoom, false), _attributeContext(context), _query_tensor_name(), _query_tensor(), -- cgit v1.2.3