diff options
8 files changed, 247 insertions, 190 deletions
diff --git a/build_settings.cmake b/build_settings.cmake index 1e7ed08055c..4e972b3839e 100644 --- a/build_settings.cmake +++ b/build_settings.cmake @@ -6,10 +6,11 @@ if (EXISTS ${CMAKE_CURRENT_LIST_DIR}/vtag.cmake) endif() if (VESPA_USE_SANITIZER) - if (VESPA_USE_SANITIZER STREQUAL "address" OR VESPA_USE_SANITIZER STREQUAL "thread" OR VESPA_USE_SANITIZER STREQUAL "undefined") + if (VESPA_USE_SANITIZER STREQUAL "address" OR VESPA_USE_SANITIZER STREQUAL "thread" OR + VESPA_USE_SANITIZER STREQUAL "undefined" OR VESPA_USE_SANITIZER STREQUAL "address,undefined") message("-- Instrumenting code using ${VESPA_USE_SANITIZER} sanitizer") else() - message(FATAL_ERROR "Unsupported sanitizer option '${VESPA_USE_SANITIZER}'. Supported: 'address', 'thread' or 'undefined'") + message(FATAL_ERROR "Unsupported sanitizer option '${VESPA_USE_SANITIZER}'. Supported: 'address', 'thread', 'undefined' or 'address,undefined'") endif() endif() @@ -35,7 +36,7 @@ else() set(C_WARN_OPTS "-Winline ${C_WARN_OPTS}") endif() if (VESPA_USE_SANITIZER) - if (VESPA_USE_SANITIZER STREQUAL "address" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0) + if (VESPA_USE_SANITIZER MATCHES "address" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0) # Turn off maybe uninitialized and restrict warnings when compiling with # address sanitizer on gcc 12 or newer. set(C_WARN_OPTS "${C_WARN_OPTS} -Wno-maybe-uninitialized -Wno-restrict") @@ -84,10 +85,11 @@ else() endif() # Disable dangling reference and overloaded virtual warnings when using gcc 13 -# Disable stringop-oveflow and array-bounds warning when using gcc 13. +# Disable stringop-oveflow, stringop-overread and array-bounds warning when using gcc 13. +# The latter heuristics are sufficiently broken to be useless in practice. if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "13") - set(CXX_SPECIFIC_WARN_OPTS "${CXX_SPECIFIC_WARN_OPTS} -Wno-dangling-reference -Wno-overloaded-virtual -Wno-stringop-overflow -Wno-array-bounds") + set(CXX_SPECIFIC_WARN_OPTS "${CXX_SPECIFIC_WARN_OPTS} -Wno-dangling-reference -Wno-overloaded-virtual -Wno-stringop-overflow -Wno-stringop-overread -Wno-array-bounds") endif() endif() @@ -101,7 +103,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O3 -fno-omit-frame-pointer ${C_WARN_OPTS # AddressSanitizer/ThreadSanitizer work for both GCC and Clang if (VESPA_USE_SANITIZER) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=${VESPA_USE_SANITIZER}") - if (VESPA_USE_SANITIZER STREQUAL "undefined") + if (VESPA_USE_SANITIZER MATCHES "undefined") # Many false positives when checking vptr due to limited visibility set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-sanitize=vptr") endif() @@ -198,7 +200,7 @@ if(VESPA_USE_SANITIZER) endif() # Dump stack when finding issues in unit tests using undefined sanitizer if(VESPA_USE_SANITIZER) - if(VESPA_USE_SANITIZER STREQUAL "undefined") + if(VESPA_USE_SANITIZER MATCHES "undefined") set(VESPA_SANITIZER_ENV "UBSAN_OPTIONS=print_stacktrace=1") endif() endif() diff --git a/config-model-api/abi-spec.json b/config-model-api/abi-spec.json index 79283641074..ccd256d0c88 100644 --- a/config-model-api/abi-spec.json +++ b/config-model-api/abi-spec.json @@ -1500,15 +1500,13 @@ ], "methods" : [ "public void <init>(java.lang.String, long, long, com.yahoo.config.model.api.OnnxModelOptions)", - "public void <init>(java.lang.String, long, long, java.util.Optional)", - "public com.yahoo.config.model.api.OnnxModelOptions options()", "public final java.lang.String toString()", "public final int hashCode()", "public final boolean equals(java.lang.Object)", "public java.lang.String modelId()", "public long estimatedCost()", "public long hash()", - "public java.util.Optional onnxModelOptions()" + "public com.yahoo.config.model.api.OnnxModelOptions onnxModelOptions()" ], "fields" : [ ] }, diff --git a/config-model-api/src/main/java/com/yahoo/config/model/api/OnnxModelCost.java b/config-model-api/src/main/java/com/yahoo/config/model/api/OnnxModelCost.java index 4764d501865..1efd98184cc 100644 --- a/config-model-api/src/main/java/com/yahoo/config/model/api/OnnxModelCost.java +++ b/config-model-api/src/main/java/com/yahoo/config/model/api/OnnxModelCost.java @@ -8,10 +8,10 @@ import com.yahoo.config.provision.ClusterSpec; import java.net.URI; import java.util.Map; -import java.util.Optional; /** * @author bjorncs + * @author hmusum */ public interface OnnxModelCost { @@ -31,17 +31,7 @@ public interface OnnxModelCost { void store(); } - record ModelInfo(String modelId, long estimatedCost, long hash, Optional<OnnxModelOptions> onnxModelOptions) { - - public ModelInfo(String modelId, long estimatedCost, long hash, OnnxModelOptions onnxModelOptions) { - this(modelId, estimatedCost, hash, Optional.of(onnxModelOptions)); - } - - public OnnxModelOptions options() { - return onnxModelOptions.orElseThrow(() -> new IllegalStateException("No onnxModelOptions exist")); - } - - } + record ModelInfo(String modelId, long estimatedCost, long hash, OnnxModelOptions onnxModelOptions) {} static OnnxModelCost disabled() { return new DisabledOnnxModelCost(); } diff --git a/defaults/src/vespa/CMakeLists.txt b/defaults/src/vespa/CMakeLists.txt index c2bf0de5b6b..e2bfbf3264b 100644 --- a/defaults/src/vespa/CMakeLists.txt +++ b/defaults/src/vespa/CMakeLists.txt @@ -12,11 +12,13 @@ function(vespa_configure_config_h) set(VESPA_USE_UNDEFINED_SANITIZER False) set(VESPA_HAS_IO_URING False) set(VESPA_HAS_EPOLL False) - if(VESPA_USE_SANITIZER STREQUAL "address") + if(VESPA_USE_SANITIZER MATCHES "address") set(VESPA_USE_ADDRESS_SANITIZER True) - elseif(VESPA_USE_SANITIZER STREQUAL "thread") + endif() + if(VESPA_USE_SANITIZER STREQUAL "thread") set(VESPA_USE_THREAD_SANITIZER True) - elseif(VESPA_USE_SANITIZER STREQUAL "undefined") + endif() + if(VESPA_USE_SANITIZER MATCHES "undefined") set(VESPA_USE_UNDEFINED_SANITIZER True) endif() if(NOT APPLE) diff --git a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java index b5774ad1c92..41c2ed0a9f7 100644 --- a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java +++ b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java @@ -78,16 +78,20 @@ public class Flags { "Takes effect at redeployment (requires restart)", INSTANCE_ID); + public static final List<String> VALID_NESSUS_AGENT_GROUPS = List.of( + "", // Skip task + ":legacy", // Run legacy task. Is a no-op outside YAHOO cloud. + ":stop", // Stop / shut down Nessus if it is running + "All", // Link to the All group. + "vespa-ci", // Link to the vespa-ci group. + "vespa-config"); // Link to the vespa-config group. + public static final UnboundStringFlag NESSUS_AGENT_GROUP = defineStringFlag( "nessus-agent-group", ":legacy", List.of("hakonhall"), "2023-11-29", "2024-02-29", "Link nessusagent to the given group, or run legacy task (\":legacy\"), or disable task (\"\").", "Takes effect after host admin restart", - (String value) -> value.equals(":legacy") || // Run legacy task. Is a no-op outside YAHOO cloud. - value.equals(":stop") || // Stop / shut down Nessus if it is running - value.equals("All") || // Link to All group. - value.equals("vespa-ci") || // Link to vespa-ci group. - value.isEmpty(), // Skip task + VALID_NESSUS_AGENT_GROUPS::contains, ARCHITECTURE, CLAVE); public static final UnboundIntFlag MAX_UNCOMMITTED_MEMORY = defineIntFlag( diff --git a/searchlib/src/tests/queryeval/termwise_eval/termwise_eval_test.cpp b/searchlib/src/tests/queryeval/termwise_eval/termwise_eval_test.cpp index 3ca35221c50..3a10ed6df53 100644 --- a/searchlib/src/tests/queryeval/termwise_eval/termwise_eval_test.cpp +++ b/searchlib/src/tests/queryeval/termwise_eval/termwise_eval_test.cpp @@ -1,5 +1,4 @@ // Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/vespalib/testkit/test_kit.h> #include <vespa/vespalib/util/stringfmt.h> #include <vespa/searchlib/queryeval/searchiterator.h> #include <vespa/searchlib/queryeval/andnotsearch.h> @@ -8,11 +7,12 @@ #include <vespa/searchlib/queryeval/termwise_search.h> #include <vespa/searchlib/queryeval/intermediate_blueprints.h> #include <vespa/searchlib/queryeval/termwise_blueprint_helper.h> -#include <vespa/vespalib/test/insertion_operators.h> +#define ENABLE_GTEST_MIGRATION #include <vespa/searchlib/test/searchiteratorverifier.h> #include <vespa/searchlib/common/bitvectoriterator.h> #include <vespa/searchlib/fef/matchdata.h> #include <vespa/vespalib/objects/visit.hpp> +#include <vespa/vespalib/gtest/gtest.h> using namespace vespalib; using namespace search; @@ -192,7 +192,10 @@ std::vector<uint32_t> make_expect(uint32_t begin, uint32_t end) { return expect; } -void verify(const std::vector<uint32_t> &expect, SearchIterator &search, uint32_t begin, uint32_t end) { +void +verify(const std::vector<uint32_t> &expect, SearchIterator &search, uint32_t begin, uint32_t end, const vespalib::string& label) +{ + SCOPED_TRACE(label); std::vector<uint32_t> actual; search.initRange(begin, end); for (uint32_t docid = begin; docid < end; ++docid) { @@ -200,7 +203,7 @@ void verify(const std::vector<uint32_t> &expect, SearchIterator &search, uint32_ actual.push_back(docid); } } - EXPECT_EQUAL(expect, actual); + EXPECT_EQ(expect, actual); } //----------------------------------------------------------------------------- @@ -213,95 +216,107 @@ MatchData::UP make_match_data() { //----------------------------------------------------------------------------- -TEST("require that pseudo term produces correct results") { - TEST_DO(verify({1,2,3,4,5}, *UP(TERM({1,2,3,4,5}, true)), 1, 6)); - TEST_DO(verify({1,2,3,4,5}, *UP(TERM({1,2,3,4,5}, false)), 1, 6)); - TEST_DO(verify({3,4,5}, *UP(TERM({1,2,3,4,5}, true)), 3, 6)); - TEST_DO(verify({3,4,5}, *UP(TERM({1,2,3,4,5}, false)), 3, 6)); - TEST_DO(verify({1,2,3}, *UP(TERM({1,2,3,4,5}, true)), 1, 4)); - TEST_DO(verify({1,2,3}, *UP(TERM({1,2,3,4,5}, false)), 1, 4)); +TEST(TermwiseEvalTest, require_that_pseudo_term_produces_correct_results) +{ + verify({1,2,3,4,5}, *UP(TERM({1,2,3,4,5}, true)), 1, 6, "strict full"); + verify({1,2,3,4,5}, *UP(TERM({1,2,3,4,5}, false)), 1, 6, "non-strict full"); + verify({3,4,5}, *UP(TERM({1,2,3,4,5}, true)), 3, 6, "strict last"); + verify({3,4,5}, *UP(TERM({1,2,3,4,5}, false)), 3, 6, "non-strict last"); + verify({1,2,3}, *UP(TERM({1,2,3,4,5}, true)), 1, 4, "strict first"); + verify({1,2,3}, *UP(TERM({1,2,3,4,5}, false)), 1, 4, "non-strict first"); } -TEST("require that normal search gives expected results") { +TEST(TermwiseEvalTest, require_that_normal_search_gives_expected_results) +{ auto search = make_search(true); - TEST_DO(verify(make_expect(1, 10), *search, 1, 10)); + verify(make_expect(1, 10), *search, 1, 10, "strict normal"); } -TEST("require that filter search gives expected results") { +TEST(TermwiseEvalTest, require_that_filter_search_gives_expected_results) +{ auto search = make_filter_search(true); - TEST_DO(verify(make_expect(1, 10), *search, 1, 10)); + verify(make_expect(1, 10), *search, 1, 10, "strict filter"); } -TEST("require that termwise AND/OR search produces appropriate results") { +TEST(TermwiseEvalTest, require_that_termwise_and_or_or_search_produces_appropriate_results) +{ for (uint32_t begin: {1, 2, 5}) { for (uint32_t end: {6, 7, 10}) { for (bool strict_search: {true, false}) { for (bool strict_wrapper: {true, false}) { - TEST_STATE(make_string("begin: %u, end: %u, strict_search: %s, strict_wrapper: %s", - begin, end, strict_search ? "true" : "false", - strict_wrapper ? "true" : "false").c_str()); + auto label = make_string("begin: %u, end: %u, strict_search: %s, strict_wrapper: %s", + begin, end, strict_search ? "true" : "false", + strict_wrapper ? "true" : "false"); auto search = make_termwise(make_search(strict_search), strict_wrapper); - TEST_DO(verify(make_expect(begin, end), *search, begin, end)); + verify(make_expect(begin, end), *search, begin, end, label); } } } } } -TEST("require that termwise filter search produces appropriate results") { +TEST(TermwiseEvalTest, require_that_termwise_filter_search_produces_appropriate_results) +{ for (uint32_t begin: {1, 2, 5}) { for (uint32_t end: {6, 7, 10}) { for (bool strict_search: {true, false}) { for (bool strict_wrapper: {true, false}) { - TEST_STATE(make_string("begin: %u, end: %u, strict_search: %s, strict_wrapper: %s", - begin, end, strict_search ? "true" : "false", - strict_wrapper ? "true" : "false").c_str()); + auto label = make_string("begin: %u, end: %u, strict_search: %s, strict_wrapper: %s", + begin, end, strict_search ? "true" : "false", + strict_wrapper ? "true" : "false"); auto search = make_termwise(make_filter_search(strict_search), strict_wrapper); - TEST_DO(verify(make_expect(begin, end), *search, begin, end)); + verify(make_expect(begin, end), *search, begin, end, label); } } } } } -TEST("require that termwise ANDNOT with single term works") { - TEST_DO(verify({2,3,4}, *make_termwise(ANDNOT({ TERM({1,2,3,4,5}, true) }, true), true), 2, 5)); +TEST(TermwiseEvalTest, require_that_termwise_andnot_with_single_term_works) +{ + verify({2,3,4}, *make_termwise(ANDNOT({ TERM({1,2,3,4,5}, true) }, true), true), 2, 5, "termwise andnot"); } -TEST("require that pseudo term is rewindable") { +TEST(TermwiseEvalTest, require_that_pseudo_term_is_rewindable) +{ auto search = UP(TERM({1,2,3,4,5}, true)); - TEST_DO(verify({3,4,5}, *search, 3, 6)); - TEST_DO(verify({1,2,3,4}, *search, 1, 5)); + verify({3,4,5}, *search, 3, 6, "pseudo term end"); + verify({1,2,3,4}, *search, 1, 5, "pseudo term rewound to start"); } -TEST("require that termwise wrapper is rewindable") { +TEST(TermwiseEvalTest, require_that_termwise_wrapper_is_rewindable) +{ auto search = make_termwise(make_search(true), true); - TEST_DO(verify(make_expect(3, 7), *search, 3, 7)); - TEST_DO(verify(make_expect(1, 5), *search, 1, 5)); + verify(make_expect(3, 7), *search, 3, 7, "termwise wrapper end"); + verify(make_expect(1, 5), *search, 1, 5, "termwise wrapper rewound to start"); } //----------------------------------------------------------------------------- -TEST("require that leaf blueprints allow termwise evaluation by default") { +TEST(TermwiseEvalTest, require_that_leaf_blueprints_allow_termwise_evaluation_by_default) +{ MyBlueprint bp({}); EXPECT_TRUE(bp.getState().allow_termwise_eval()); } -TEST("require that leaf blueprints can enable/disable termwise evaluation") { +TEST(TermwiseEvalTest, require_that_leaf_blueprints_can_enable_and_disable_termwise_evaluation) +{ MyBlueprint enable({}, true); MyBlueprint disable({}, false); EXPECT_TRUE(enable.getState().allow_termwise_eval()); EXPECT_FALSE(disable.getState().allow_termwise_eval()); } -TEST("require that intermediate blueprints disallow termwise evaluation by default") { +TEST(TermwiseEvalTest, require_that_intermediate_blueprints_disallow_termwise_evaluation_by_default) +{ MyOr bp(false); bp.addChild(UP(new MyBlueprint({}, true))); bp.addChild(UP(new MyBlueprint({}, true))); EXPECT_FALSE(bp.getState().allow_termwise_eval()); } -TEST("require that intermediate blueprints can enable/disable termwise evaluation") { +TEST(TermwiseEvalTest, require_that_intermediate_blueprints_can_enable_and_disable_termwise_evaluation) +{ MyOr enable(true, true); enable.addChild(UP(new MyBlueprint({}, true))); enable.addChild(UP(new MyBlueprint({}, true))); @@ -312,7 +327,8 @@ TEST("require that intermediate blueprints can enable/disable termwise evaluatio EXPECT_FALSE(disable.getState().allow_termwise_eval()); } -TEST("require that intermediate blueprints cannot be termwise unless all its children are termwise") { +TEST(TermwiseEvalTest, require_that_intermediate_blueprints_cannot_be_termwise_unless_all_its_children_are_termwise) +{ MyOr bp(true, true); bp.addChild(UP(new MyBlueprint({}, true))); bp.addChild(UP(new MyBlueprint({}, false))); @@ -321,27 +337,30 @@ TEST("require that intermediate blueprints cannot be termwise unless all its chi //----------------------------------------------------------------------------- -TEST("require that leafs have tree size 1") { +TEST(TermwiseEvalTest, require_that_leafs_have_tree_size_1) +{ MyBlueprint bp({}); - EXPECT_EQUAL(1u, bp.getState().tree_size()); + EXPECT_EQ(1u, bp.getState().tree_size()); } -TEST("require that tree size is accumulated correctly by intermediate nodes") { +TEST(TermwiseEvalTest, require_that_tree_size_is_accumulated_correctly_by_intermediate_nodes) +{ MyOr bp(false); - EXPECT_EQUAL(1u, bp.getState().tree_size()); + EXPECT_EQ(1u, bp.getState().tree_size()); bp.addChild(UP(new MyBlueprint({}))); bp.addChild(UP(new MyBlueprint({}))); - EXPECT_EQUAL(3u, bp.getState().tree_size()); + EXPECT_EQ(3u, bp.getState().tree_size()); auto child = UP(new MyOr(false)); child->addChild(UP(new MyBlueprint({}))); child->addChild(UP(new MyBlueprint({}))); bp.addChild(std::move(child)); - EXPECT_EQUAL(6u, bp.getState().tree_size()); + EXPECT_EQ(6u, bp.getState().tree_size()); } //----------------------------------------------------------------------------- -TEST("require that any blueprint node can obtain the root") { +TEST(TermwiseEvalTest, require_that_any_blueprint_node_can_obtain_the_root) +{ MyOr bp(false); bp.addChild(UP(new MyBlueprint({1,2,3}))); bp.addChild(UP(new MyBlueprint({1,2,3,4,5,6}))); @@ -354,35 +373,38 @@ TEST("require that any blueprint node can obtain the root") { //----------------------------------------------------------------------------- -TEST("require that match data keeps track of the termwise limit") { +TEST(TermwiseEvalTest, require_that_match_data_keeps_track_of_the_termwise_limit) +{ auto md = make_match_data(); - EXPECT_EQUAL(1.0, md->get_termwise_limit()); + EXPECT_EQ(1.0, md->get_termwise_limit()); md->set_termwise_limit(0.03); - EXPECT_EQUAL(0.03, md->get_termwise_limit()); + EXPECT_EQ(0.03, md->get_termwise_limit()); } //----------------------------------------------------------------------------- -TEST("require that terwise test search string dump is detailed enough") { - EXPECT_EQUAL(make_termwise(OR({ TERM({1,2,3}, true), TERM({2,3}, true), TERM({3}, true) }, true), true)->asString(), - make_termwise(OR({ TERM({1,2,3}, true), TERM({2,3}, true), TERM({3}, true) }, true), true)->asString()); +TEST(TermwiseEvalTest, require_that_terwise_test_search_string_dump_is_detailed_enough) +{ + EXPECT_EQ(make_termwise(OR({ TERM({1,2,3}, true), TERM({2,3}, true), TERM({3}, true) }, true), true)->asString(), + make_termwise(OR({ TERM({1,2,3}, true), TERM({2,3}, true), TERM({3}, true) }, true), true)->asString()); - EXPECT_NOT_EQUAL(make_termwise(OR({ TERM({1,2,3}, true), TERM({2,3}, true), TERM({3}, true) }, true), true)->asString(), - make_termwise(OR({ TERM({1,2,3}, true), TERM({2,3}, false), TERM({3}, true) }, true), true)->asString()); + EXPECT_NE(make_termwise(OR({ TERM({1,2,3}, true), TERM({2,3}, true), TERM({3}, true) }, true), true)->asString(), + make_termwise(OR({ TERM({1,2,3}, true), TERM({2,3}, false), TERM({3}, true) }, true), true)->asString()); - EXPECT_NOT_EQUAL(make_termwise(OR({ TERM({1,2,3}, true), TERM({2,3}, true), TERM({3}, true) }, true), true)->asString(), - make_termwise(OR({ TERM({1,2,3}, true), TERM({2,3}, true), TERM({3}, true) }, false), true)->asString()); + EXPECT_NE(make_termwise(OR({ TERM({1,2,3}, true), TERM({2,3}, true), TERM({3}, true) }, true), true)->asString(), + make_termwise(OR({ TERM({1,2,3}, true), TERM({2,3}, true), TERM({3}, true) }, false), true)->asString()); - EXPECT_NOT_EQUAL(make_termwise(OR({ TERM({1,2,3}, true), TERM({2,3}, true), TERM({3}, true) }, true), true)->asString(), - make_termwise(OR({ TERM({1,2,3}, true), TERM({2,3}, true), TERM({3}, true) }, true), false)->asString()); + EXPECT_NE(make_termwise(OR({ TERM({1,2,3}, true), TERM({2,3}, true), TERM({3}, true) }, true), true)->asString(), + make_termwise(OR({ TERM({1,2,3}, true), TERM({2,3}, true), TERM({3}, true) }, true), false)->asString()); - EXPECT_NOT_EQUAL(make_termwise(OR({ TERM({1,2,3}, true), TERM({2,3}, true), TERM({3}, true) }, true), true)->asString(), - make_termwise(OR({ TERM({1,2,3}, true), TERM({3}, true), TERM({2,3}, true) }, true), true)->asString()); + EXPECT_NE(make_termwise(OR({ TERM({1,2,3}, true), TERM({2,3}, true), TERM({3}, true) }, true), true)->asString(), + make_termwise(OR({ TERM({1,2,3}, true), TERM({3}, true), TERM({2,3}, true) }, true), true)->asString()); } //----------------------------------------------------------------------------- -TEST("require that basic termwise evaluation works") { +TEST(TermwiseEvalTest, require_that_basic_termwise_evaluation_works) +{ auto md = make_match_data(); md->set_termwise_limit(0.0); md->resolveTermField(1)->tagAsNotNeeded(); @@ -391,12 +413,13 @@ TEST("require that basic termwise evaluation works") { my_or.addChild(UP(new MyBlueprint({1}, true, 1))); my_or.addChild(UP(new MyBlueprint({2}, true, 2))); for (bool strict: {true, false}) { - EXPECT_EQUAL(my_or.createSearch(*md, strict)->asString(), - make_termwise(OR({ TERM({1}, strict), TERM({2}, strict) }, strict), strict)->asString()); + EXPECT_EQ(my_or.createSearch(*md, strict)->asString(), + make_termwise(OR({ TERM({1}, strict), TERM({2}, strict) }, strict), strict)->asString()); } } -TEST("require that the hit rate must be high enough for termwise evaluation to be activated") { +TEST(TermwiseEvalTest, require_that_the_hit_rate_must_be_high_enough_for_termwise_evaluation_to_be_activated) +{ auto md = make_match_data(); md->set_termwise_limit(1.0); // <- md->resolveTermField(1)->tagAsNotNeeded(); @@ -409,7 +432,8 @@ TEST("require that the hit rate must be high enough for termwise evaluation to b } } -TEST("require that enough unranked termwise terms are present for termwise evaluation to be activated") { +TEST(TermwiseEvalTest, require_that_enough_unranked_termwise_terms_are_present_for_termwise_evaluation_to_be_activated) +{ auto md = make_match_data(); md->set_termwise_limit(0.0); md->resolveTermField(1)->tagAsNotNeeded(); @@ -423,29 +447,31 @@ TEST("require that enough unranked termwise terms are present for termwise evalu } } -TEST("require that termwise evaluation can be multi-level, but not duplicated") { +TEST(TermwiseEvalTest, require_that_termwise_evaluation_can_be_multi_level_but_not_duplicated) +{ auto md = make_match_data(); md->set_termwise_limit(0.0); md->resolveTermField(1)->tagAsNotNeeded(); md->resolveTermField(2)->tagAsNotNeeded(); md->resolveTermField(3)->tagAsNotNeeded(); OrBlueprint my_or; - my_or.addChild(UP(new MyBlueprint({1}, true, 1))); + my_or.addChild(UP(new MyBlueprint({1}, true, 1))); auto child = UP(new OrBlueprint()); child->addChild(UP(new MyBlueprint({2}, true, 2))); child->addChild(UP(new MyBlueprint({3}, true, 3))); my_or.addChild(std::move(child)); for (bool strict: {true, false}) { - EXPECT_EQUAL(my_or.createSearch(*md, strict)->asString(), - make_termwise(OR({ TERM({1}, strict), - ORz({ TERM({2}, strict), TERM({3}, strict) }, strict) }, - strict), strict)->asString()); + EXPECT_EQ(my_or.createSearch(*md, strict)->asString(), + make_termwise(OR({ TERM({1}, strict), + ORz({ TERM({2}, strict), TERM({3}, strict) }, strict) }, + strict), strict)->asString()); } } //----------------------------------------------------------------------------- -TEST("require that OR can be completely termwise") { +TEST(TermwiseEvalTest, require_that_or_can_be_completely_termwise) +{ auto md = make_match_data(); md->set_termwise_limit(0.0); md->resolveTermField(1)->tagAsNotNeeded(); @@ -454,12 +480,13 @@ TEST("require that OR can be completely termwise") { my_or.addChild(UP(new MyBlueprint({1}, true, 1))); my_or.addChild(UP(new MyBlueprint({2}, true, 2))); for (bool strict: {true, false}) { - EXPECT_EQUAL(my_or.createSearch(*md, strict)->asString(), - make_termwise(OR({ TERM({1}, strict), TERM({2}, strict) }, strict), strict)->asString()); + EXPECT_EQ(my_or.createSearch(*md, strict)->asString(), + make_termwise(OR({ TERM({1}, strict), TERM({2}, strict) }, strict), strict)->asString()); } } -TEST("require that OR can be partially termwise") { +TEST(TermwiseEvalTest, require_that_or_can_be_partially_termwise) +{ auto md = make_match_data(); md->set_termwise_limit(0.0); md->resolveTermField(1)->tagAsNotNeeded(); @@ -469,13 +496,14 @@ TEST("require that OR can be partially termwise") { my_or.addChild(UP(new MyBlueprint({2}, true, 2))); my_or.addChild(UP(new MyBlueprint({3}, true, 3))); for (bool strict: {true, false}) { - EXPECT_EQUAL(my_or.createSearch(*md, strict)->asString(), - ORs({ make_termwise(OR({ TERM({1}, strict), TERM({3}, strict) }, strict), strict), + EXPECT_EQ(my_or.createSearch(*md, strict)->asString(), + ORs({ make_termwise(OR({ TERM({1}, strict), TERM({3}, strict) }, strict), strict), TERM({2}, strict) }, strict)->asString()); } } -TEST("require that OR puts termwise subquery at the right place") { +TEST(TermwiseEvalTest, require_that_or_puts_termwise_subquery_at_the_right_place) +{ auto md = make_match_data(); md->set_termwise_limit(0.0); md->resolveTermField(2)->tagAsNotNeeded(); @@ -485,14 +513,15 @@ TEST("require that OR puts termwise subquery at the right place") { my_or.addChild(UP(new MyBlueprint({2}, true, 2))); my_or.addChild(UP(new MyBlueprint({3}, true, 3))); for (bool strict: {true, false}) { - EXPECT_EQUAL(my_or.createSearch(*md, strict)->asString(), - ORs({ TERM({1}, strict), - make_termwise(OR({ TERM({2}, strict), TERM({3}, strict) }, strict), - strict) }, strict)->asString()); + EXPECT_EQ(my_or.createSearch(*md, strict)->asString(), + ORs({ TERM({1}, strict), + make_termwise(OR({ TERM({2}, strict), TERM({3}, strict) }, strict), + strict) }, strict)->asString()); } } -TEST("require that OR can use termwise eval also when having non-termwise children") { +TEST(TermwiseEvalTest, require_that_or_can_use_termwise_eval_also_when_having_non_termwise_children) +{ auto md = make_match_data(); md->set_termwise_limit(0.0); md->resolveTermField(1)->tagAsNotNeeded(); @@ -503,17 +532,18 @@ TEST("require that OR can use termwise eval also when having non-termwise childr my_or.addChild(UP(new MyBlueprint({2}, true, 2))); my_or.addChild(UP(new MyBlueprint({3}, true, 3))); for (bool strict: {true, false}) { - EXPECT_EQUAL(my_or.createSearch(*md, strict)->asString(), - ORz({ TERM({1}, strict), - make_termwise(OR({ TERM({2}, strict), TERM({3}, strict) }, strict), - strict)}, - strict)->asString()); + EXPECT_EQ(my_or.createSearch(*md, strict)->asString(), + ORz({ TERM({1}, strict), + make_termwise(OR({ TERM({2}, strict), TERM({3}, strict) }, strict), + strict)}, + strict)->asString()); } } //----------------------------------------------------------------------------- -TEST("require that AND can be completely termwise") { +TEST(TermwiseEvalTest, require_that_and_can_be_completely_termwise) +{ auto md = make_match_data(); md->set_termwise_limit(0.0); md->resolveTermField(1)->tagAsNotNeeded(); @@ -522,12 +552,13 @@ TEST("require that AND can be completely termwise") { my_and.addChild(UP(new MyBlueprint({1}, true, 1))); my_and.addChild(UP(new MyBlueprint({2}, true, 2))); for (bool strict: {true, false}) { - EXPECT_EQUAL(my_and.createSearch(*md, strict)->asString(), - make_termwise(AND({ TERM({1}, strict), TERM({2}, false) }, strict), strict)->asString()); + EXPECT_EQ(my_and.createSearch(*md, strict)->asString(), + make_termwise(AND({ TERM({1}, strict), TERM({2}, false) }, strict), strict)->asString()); } } -TEST("require that AND can be partially termwise") { +TEST(TermwiseEvalTest, require_that_and_can_be_partially_termwise) +{ auto md = make_match_data(); md->set_termwise_limit(0.0); md->resolveTermField(1)->tagAsNotNeeded(); @@ -537,7 +568,7 @@ TEST("require that AND can be partially termwise") { my_and.addChild(UP(new MyBlueprint({2}, true, 2))); my_and.addChild(UP(new MyBlueprint({3}, true, 3))); for (bool strict: {true, false}) { - EXPECT_EQUAL(my_and.createSearch(*md, strict)->asString(), + EXPECT_EQ(my_and.createSearch(*md, strict)->asString(), ANDs({ make_termwise(AND({ TERM({1}, strict), TERM({3}, false) }, strict), strict), @@ -545,7 +576,8 @@ TEST("require that AND can be partially termwise") { } } -TEST("require that AND puts termwise subquery at the right place") { +TEST(TermwiseEvalTest, require_that_and_puts_termwise_subquery_at_the_right_place) +{ auto md = make_match_data(); md->set_termwise_limit(0.0); md->resolveTermField(2)->tagAsNotNeeded(); @@ -555,14 +587,15 @@ TEST("require that AND puts termwise subquery at the right place") { my_and.addChild(UP(new MyBlueprint({2}, true, 2))); my_and.addChild(UP(new MyBlueprint({3}, true, 3))); for (bool strict: {true, false}) { - EXPECT_EQUAL(my_and.createSearch(*md, strict)->asString(), + EXPECT_EQ(my_and.createSearch(*md, strict)->asString(), ANDs({ TERM({1}, strict), make_termwise(AND({ TERM({2}, false), TERM({3}, false) }, false), false) }, strict)->asString()); } } -TEST("require that AND can use termwise eval also when having non-termwise children") { +TEST(TermwiseEvalTest, require_that_and_can_use_termwise_eval_also_when_having_non_termwise_children) +{ auto md = make_match_data(); md->set_termwise_limit(0.0); md->resolveTermField(1)->tagAsNotNeeded(); @@ -573,7 +606,7 @@ TEST("require that AND can use termwise eval also when having non-termwise child my_and.addChild(UP(new MyBlueprint({2}, true, 2))); my_and.addChild(UP(new MyBlueprint({3}, true, 3))); for (bool strict: {true, false}) { - EXPECT_EQUAL(my_and.createSearch(*md, strict)->asString(), + EXPECT_EQ(my_and.createSearch(*md, strict)->asString(), ANDz({ TERM({1}, strict), make_termwise(AND({ TERM({2}, false), TERM({3}, false) }, false), false) }, strict)->asString()); @@ -582,7 +615,8 @@ TEST("require that AND can use termwise eval also when having non-termwise child //----------------------------------------------------------------------------- -TEST("require that ANDNOT can be completely termwise") { +TEST(TermwiseEvalTest, require_that_andnot_can_be_completely_termwise) +{ auto md = make_match_data(); md->set_termwise_limit(0.0); md->resolveTermField(1)->tagAsNotNeeded(); @@ -590,13 +624,14 @@ TEST("require that ANDNOT can be completely termwise") { my_andnot.addChild(UP(new MyBlueprint({1}, true, 1))); my_andnot.addChild(UP(new MyBlueprint({2}, true, 2))); for (bool strict: {true, false}) { - EXPECT_EQUAL(my_andnot.createSearch(*md, strict)->asString(), + EXPECT_EQ(my_andnot.createSearch(*md, strict)->asString(), make_termwise(ANDNOT({ TERM({1}, strict), TERM({2}, false) }, strict), strict)->asString()); } } -TEST("require that ANDNOT can be partially termwise") { +TEST(TermwiseEvalTest, require_that_andnot_can_be_partially_termwise) +{ auto md = make_match_data(); md->set_termwise_limit(0.0); AndNotBlueprint my_andnot; @@ -604,14 +639,15 @@ TEST("require that ANDNOT can be partially termwise") { my_andnot.addChild(UP(new MyBlueprint({2}, true, 2))); my_andnot.addChild(UP(new MyBlueprint({3}, true, 3))); for (bool strict: {true, false}) { - EXPECT_EQUAL(my_andnot.createSearch(*md, strict)->asString(), + EXPECT_EQ(my_andnot.createSearch(*md, strict)->asString(), ANDNOT({ TERM({1}, strict), make_termwise(OR({ TERM({2}, false), TERM({3}, false) }, false), false) }, strict)->asString()); } } -TEST("require that ANDNOT can be partially termwise with first child being termwise") { +TEST(TermwiseEvalTest, require_that_andnot_can_be_partially_termwise_with_first_child_being_termwise) +{ auto md = make_match_data(); md->set_termwise_limit(0.0); md->resolveTermField(1)->tagAsNotNeeded(); @@ -620,7 +656,7 @@ TEST("require that ANDNOT can be partially termwise with first child being termw my_andnot.addChild(UP(new MyBlueprint({2}, false, 2))); my_andnot.addChild(UP(new MyBlueprint({3}, true, 3))); for (bool strict: {true, false}) { - EXPECT_EQUAL(my_andnot.createSearch(*md, strict)->asString(), + EXPECT_EQ(my_andnot.createSearch(*md, strict)->asString(), ANDNOT({ make_termwise(ANDNOT({ TERM({1}, strict), TERM({3}, false) }, strict), strict), TERM({2}, false) }, strict)->asString()); @@ -629,7 +665,8 @@ TEST("require that ANDNOT can be partially termwise with first child being termw //----------------------------------------------------------------------------- -TEST("require that termwise blueprint helper calculates unpack info correctly") { +TEST(TermwiseEvalTest, require_that_termwise_blueprint_helper_calculates_unpack_info_correctly) +{ OrBlueprint my_or; my_or.addChild(UP(new MyBlueprint({1}, false, 1))); // termwise not allowed my_or.addChild(UP(new MyBlueprint({2}, false, 2))); // termwise not allowed and ranked @@ -641,9 +678,9 @@ TEST("require that termwise blueprint helper calculates unpack info correctly") unpack.add(1); unpack.add(3); TermwiseBlueprintHelper helper(my_or, std::move(dummy_searches), unpack); - EXPECT_EQUAL(helper.get_result().size(), 3u); - EXPECT_EQUAL(helper.get_termwise_children().size(), 2u); - EXPECT_EQUAL(helper.first_termwise, 2u); + EXPECT_EQ(helper.get_result().size(), 3u); + EXPECT_EQ(helper.get_termwise_children().size(), 2u); + EXPECT_EQ(helper.first_termwise, 2u); EXPECT_TRUE(!helper.termwise_unpack.needUnpack(0)); EXPECT_TRUE(helper.termwise_unpack.needUnpack(1)); EXPECT_TRUE(!helper.termwise_unpack.needUnpack(2)); @@ -658,11 +695,12 @@ public: return make_termwise(createIterator(getExpectedDocIds(), strict), strict); } }; -TEST("test terwise adheres to search iterator requirements.") { +TEST(TermwiseEvalTest, test_termwise_adheres_to_search_iterator_requirements) +{ Verifier verifier; verifier.verify(); } //----------------------------------------------------------------------------- -TEST_MAIN() { TEST_RUN_ALL(); } +GTEST_MAIN_RUN_ALL_TESTS() diff --git a/searchlib/src/tests/queryeval/weighted_set_term/weighted_set_term_test.cpp b/searchlib/src/tests/queryeval/weighted_set_term/weighted_set_term_test.cpp index 5faead1175e..24d62f66714 100644 --- a/searchlib/src/tests/queryeval/weighted_set_term/weighted_set_term_test.cpp +++ b/searchlib/src/tests/queryeval/weighted_set_term/weighted_set_term_test.cpp @@ -1,6 +1,5 @@ // Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/vespalib/testkit/testapp.h> #include <vespa/searchlib/queryeval/weighted_set_term_search.h> #include <vespa/searchlib/query/tree/simplequery.h> @@ -11,7 +10,9 @@ #include <vespa/searchlib/queryeval/emptysearch.h> #include <vespa/searchlib/queryeval/fake_searchable.h> #include <vespa/searchlib/queryeval/fake_requestcontext.h> +#define ENABLE_GTEST_MIGRATION #include <vespa/searchlib/test/weightedchildrenverifiers.h> +#include <vespa/vespalib/gtest/gtest.h> using namespace search; using namespace search::query; @@ -112,8 +113,9 @@ WS::WS() term_is_not_needed(false) { MatchData::UP tmp = layout.createMatchData(); - ASSERT_TRUE(tmp->resolveTermField(handle)->getFieldId() == fieldId); + assert(tmp->resolveTermField(handle)->getFieldId() == fieldId); } + WS::~WS() = default; struct MockSearch : public SearchIterator { @@ -143,8 +145,11 @@ struct MockFixture { weights.push_back(1); search = WeightedSetTermSearch::create(children, tfmd, false, weights, {}); } + ~MockFixture(); }; +MockFixture::~MockFixture() = default; + } // namespace <unnamed> void run_simple(bool field_is_filter, bool term_is_not_needed, bool singleTerm) @@ -179,42 +184,50 @@ void run_simple(bool field_is_filter, bool term_is_not_needed, bool singleTerm) EXPECT_TRUE(ws.isGenericSearch(index, "multi-field", true)); EXPECT_TRUE(ws.isGenericSearch(index, "multi-field", false)); - EXPECT_EQUAL(expect, ws.search(index, "field", true)); - EXPECT_EQUAL(expect, ws.search(index, "field", false)); - EXPECT_EQUAL(expect, ws.search(index, "multi-field", true)); - EXPECT_EQUAL(expect, ws.search(index, "multi-field", false)); + EXPECT_EQ(expect, ws.search(index, "field", true)); + EXPECT_EQ(expect, ws.search(index, "field", false)); + EXPECT_EQ(expect, ws.search(index, "multi-field", true)); + EXPECT_EQ(expect, ws.search(index, "multi-field", false)); } -TEST("testSimple") { - TEST_DO(run_simple(false, false, false)); +TEST(WeightedSetTermTest, test_simple) +{ + run_simple(false, false, false); } -TEST("testSimple filter field") { - TEST_DO(run_simple(true, false, false)); +TEST(WeightedSetTermTest, test_simple_filter_field) +{ + run_simple(true, false, false); } -TEST("testSimple unranked") { - TEST_DO(run_simple(false, true, false)); +TEST(WeightedSetTermTest, test_simple_unranked) +{ + run_simple(false, true, false); } -TEST("testSimple unranked filter filed") { - TEST_DO(run_simple(true, true, false)); +TEST(WeightedSetTermTest, test_simple_unranked_filter_field) +{ + run_simple(true, true, false); } -TEST("testSimple single") { - TEST_DO(run_simple(false, false, true)); +TEST(WeightedSetTermTest, test_simple_single) +{ + run_simple(false, false, true); } -TEST("testSimple single filter field") { - TEST_DO(run_simple(true, false, true)); +TEST(WeightedSetTermTest, test_simple_single_filter_field) +{ + run_simple(true, false, true); } -TEST("testSimple single unranked") { - TEST_DO(run_simple(false, true, true)); +TEST(WeightedSetTermTest, test_simple_single_unranked) +{ + run_simple(false, true, true); } -TEST("testSimple single unranked filter field") { - TEST_DO(run_simple(true, true, true)); +TEST(WeightedSetTermTest, test_simple_single_unranked_filter_field) +{ + run_simple(true, true, true); } void run_multi(bool field_is_filter, bool term_is_not_needed) @@ -240,46 +253,53 @@ void run_multi(bool field_is_filter, bool term_is_not_needed) EXPECT_TRUE(ws.isGenericSearch(index, "multi-field", true)); EXPECT_TRUE(ws.isGenericSearch(index, "multi-field", false)); - EXPECT_EQUAL(expect, ws.search(index, "multi-field", true)); - EXPECT_EQUAL(expect, ws.search(index, "multi-field", false)); + EXPECT_EQ(expect, ws.search(index, "multi-field", true)); + EXPECT_EQ(expect, ws.search(index, "multi-field", false)); } -TEST("testMulti") { - TEST_DO(run_multi(false, false)); +TEST(WeightedSetTermTest, test_multi) +{ + run_multi(false, false); } -TEST("testMulti filter field") { - TEST_DO(run_multi(true, false)); +TEST(WeightedSetTermTest, test_multi_filter_field) +{ + run_multi(true, false); } -TEST("testMulti unranked") { - TEST_DO(run_multi(false, true)); +TEST(WeightedSetTermTest, test_multi_unranked) +{ + run_multi(false, true); } -TEST_F("test Eager Empty Child", MockFixture(search::endDocId)) { +TEST(WeightedSetTermTest, test_eager_empty_child) +{ + MockFixture f1(search::endDocId); MockSearch *mock = f1.mock; SearchIterator &search = *f1.search; search.initFullRange(); - EXPECT_EQUAL(search.beginId(), search.getDocId()); + EXPECT_EQ(search.beginId(), search.getDocId()); EXPECT_TRUE(!search.seek(1)); EXPECT_TRUE(search.isAtEnd()); - EXPECT_EQUAL(0, mock->seekCnt); + EXPECT_EQ(0, mock->seekCnt); } -TEST_F("test Eager Matching Child", MockFixture(5)) { +TEST(WeightedSetTermTest, test_eager_matching_child) +{ + MockFixture f1(5); MockSearch *mock = f1.mock; SearchIterator &search = *f1.search; search.initFullRange(); - EXPECT_EQUAL(search.beginId(), search.getDocId()); + EXPECT_EQ(search.beginId(), search.getDocId()); EXPECT_TRUE(!search.seek(3)); - EXPECT_EQUAL(5u, search.getDocId()); - EXPECT_EQUAL(0, mock->seekCnt); + EXPECT_EQ(5u, search.getDocId()); + EXPECT_EQ(0, mock->seekCnt); EXPECT_TRUE(search.seek(5)); - EXPECT_EQUAL(5u, search.getDocId()); - EXPECT_EQUAL(0, mock->seekCnt); + EXPECT_EQ(5u, search.getDocId()); + EXPECT_EQ(0, mock->seekCnt); EXPECT_TRUE(!search.seek(7)); EXPECT_TRUE(search.isAtEnd()); - EXPECT_EQUAL(1, mock->seekCnt); + EXPECT_EQ(1, mock->seekCnt); } class IteratorChildrenVerifier : public search::test::IteratorChildrenVerifier { @@ -296,12 +316,14 @@ private: } }; -TEST("verify search iterator conformance with search iterator children") { +TEST(WeightedSetTermTest, verify_search_iterator_conformance_with_search_iterator_children) +{ IteratorChildrenVerifier verifier; verifier.verify(); } -TEST("verify search iterator conformance with document weight iterator children") { +TEST(WeightedSetTermTest, verify_search_iterator_conformance_with_document_weight_iterator_children) +{ WeightIteratorChildrenVerifier verifier; verifier.verify(); } @@ -312,12 +334,12 @@ struct VerifyMatchData { MyBlueprint(VerifyMatchData &vmd_in, FieldSpecBase spec_in) : SimpleLeafBlueprint(spec_in), vmd(vmd_in) {} [[nodiscard]] SearchIterator::UP createLeafSearch(const fef::TermFieldMatchDataArray &tfmda, bool) const override { - EXPECT_EQUAL(tfmda.size(), 1u); + EXPECT_EQ(tfmda.size(), 1u); EXPECT_TRUE(tfmda[0] != nullptr); if (vmd.child_tfmd == nullptr) { vmd.child_tfmd = tfmda[0]; } else { - EXPECT_EQUAL(vmd.child_tfmd, tfmda[0]); + EXPECT_EQ(vmd.child_tfmd, tfmda[0]); } ++vmd.child_cnt; return std::make_unique<EmptySearch>(); @@ -333,7 +355,8 @@ struct VerifyMatchData { } }; -TEST("require that children get a common (yet separate) term field match data") { +TEST(WeightedSetTermTest, require_that_children_get_a_common_yet_separate_term_field_match_data) +{ VerifyMatchData vmd; MatchDataLayout layout; auto top_handle = layout.allocTermField(42); @@ -347,9 +370,9 @@ TEST("require that children get a common (yet separate) term field match data") auto match_data = layout.createMatchData(); auto search = blueprint.createSearch(*match_data, true); auto top_tfmd = match_data->resolveTermField(top_handle); - EXPECT_EQUAL(vmd.child_cnt, 5u); + EXPECT_EQ(vmd.child_cnt, 5u); EXPECT_TRUE(vmd.child_tfmd != nullptr); - EXPECT_NOT_EQUAL(top_tfmd, vmd.child_tfmd); + EXPECT_NE(top_tfmd, vmd.child_tfmd); } -TEST_MAIN() { TEST_RUN_ALL(); } +GTEST_MAIN_RUN_ALL_TESTS() diff --git a/searchlib/src/vespa/searchlib/test/document_weight_attribute_helper.h b/searchlib/src/vespa/searchlib/test/document_weight_attribute_helper.h index 059456c383b..10d64b0aa6d 100644 --- a/searchlib/src/vespa/searchlib/test/document_weight_attribute_helper.h +++ b/searchlib/src/vespa/searchlib/test/document_weight_attribute_helper.h @@ -6,7 +6,7 @@ #include <vespa/searchlib/attribute/multinumericattribute.h> #include <vespa/searchlib/attribute/multinumericpostattribute.hpp> #include <vespa/searchlib/attribute/attributefactory.h> -#include <vespa/vespalib/testkit/test_kit.h> +#include <cassert> namespace search::test { @@ -25,8 +25,8 @@ public: _int_attr(dynamic_cast<IntegerAttribute *>(_attr.get())), _dww(_attr->as_docid_with_weight_posting_store()) { - ASSERT_TRUE(_int_attr != nullptr); - ASSERT_TRUE(_dww != nullptr); + assert(_int_attr != nullptr); + assert(_dww != nullptr); } ~DocumentWeightAttributeHelper(); @@ -36,7 +36,7 @@ public: _attr->addDoc(docid); } _attr->commit(); - ASSERT_EQUAL((limit - 1), docid); + assert((limit - 1) == docid); } void set_doc(uint32_t docid, int64_t key, int32_t weight) { |