From 62df45c284db9613764d9ca2b01825d9abb42812 Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Tue, 11 Jul 2023 12:29:58 +0200 Subject: Revert "- Enable use of optimized DirectWeightedAttribute for all integer att…" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- searchlib/src/tests/attribute/bitvector/bitvector_test.cpp | 13 +++++++------ .../document_weight_iterator_test.cpp | 3 +-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'searchlib/src/tests/attribute') diff --git a/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp b/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp index e0f4a99dfc9..5fa8889a01d 100644 --- a/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp +++ b/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp @@ -160,14 +160,14 @@ template <> vespalib::string BitVectorTest::getSearchStr() { - return "-42"; + return "[-42;-42]"; } template <> vespalib::string BitVectorTest::getSearchStr() { - return "-42.0"; + return "[-42.0;-42.0]"; } template <> @@ -365,6 +365,7 @@ BitVectorTest::checkSearch(AttributePtr v, bool weights, bool checkStride) { + (void) checkStride; sb->initRange(1, v->getCommittedDocIdLimit()); sb->seek(1u); uint32_t docId = sb->getDocId(); @@ -374,7 +375,7 @@ BitVectorTest::checkSearch(AttributePtr v, while (docId != search::endDocId) { lastDocId = docId; ++docFreq, - ASSERT_TRUE(!checkStride || (docId % 5) == 2u); + assert(!checkStride || (docId % 5) == 2u); sb->unpack(docId); EXPECT_EQUAL(md.getDocId(), docId); if (v->getCollectionType() == CollectionType::SINGLE || !weights) { @@ -430,12 +431,12 @@ BitVectorTest::test(BasicType bt, CollectionType ct, const vespalib::string &pre checkSearch(v, std::move(sc), 2, 1022, 205, !filter, true); const search::IDocumentWeightAttribute *dwa = v->asDocumentWeightAttribute(); if (dwa != nullptr) { - vespalib::string key = getSearchStr(); - search::IDocumentWeightAttribute::LookupResult lres = dwa->lookup(key, dwa->get_dictionary_snapshot()); + search::IDocumentWeightAttribute::LookupResult lres = + dwa->lookup(getSearchStr(), dwa->get_dictionary_snapshot()); using DWSI = search::queryeval::DocumentWeightSearchIterator; using SI = search::queryeval::SearchIterator; TermFieldMatchData md; - SI::UP dwsi = std::make_unique(md, *dwa, lres); + SI::UP dwsi(new DWSI(md, *dwa, lres)); if (!filter) { TEST_DO(checkSearch(v, std::move(dwsi), md, 2, 1022, 205, !filter, true)); } else { diff --git a/searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp b/searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp index 98e70fd6c1f..56fe791021e 100644 --- a/searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp +++ b/searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp @@ -81,7 +81,6 @@ struct StringFixture { }; TEST("require that appropriate attributes support the document weight attribute interface") { - EXPECT_TRUE(make_attribute(BasicType::INT32, CollectionType::WSET, true)->asDocumentWeightAttribute() != nullptr); EXPECT_TRUE(make_attribute(BasicType::INT64, CollectionType::WSET, true)->asDocumentWeightAttribute() != nullptr); EXPECT_TRUE(make_attribute(BasicType::STRING, CollectionType::WSET, true)->asDocumentWeightAttribute() != nullptr); } @@ -97,7 +96,7 @@ TEST("require that inappropriate attributes do not support the document weight a EXPECT_TRUE(make_attribute(BasicType::STRING, CollectionType::WSET, false)->asDocumentWeightAttribute() == nullptr); EXPECT_TRUE(make_attribute(BasicType::STRING, CollectionType::SINGLE, true)->asDocumentWeightAttribute() == nullptr); EXPECT_TRUE(make_attribute(BasicType::STRING, CollectionType::ARRAY, true)->asDocumentWeightAttribute() == nullptr); - EXPECT_TRUE(make_attribute(BasicType::FLOAT, CollectionType::WSET, true)->asDocumentWeightAttribute() == nullptr); + EXPECT_TRUE(make_attribute(BasicType::INT32, CollectionType::WSET, true)->asDocumentWeightAttribute() == nullptr); EXPECT_TRUE(make_attribute(BasicType::DOUBLE, CollectionType::WSET, true)->asDocumentWeightAttribute() == nullptr); } -- cgit v1.2.3