From f65a3e60e6024fdf20b87408c9f830c4a0482a34 Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Thu, 12 Dec 2024 12:12:07 +0100 Subject: [PATCH] Prefer enum value over string, to get compile time checking. --- .../match_phase_limiter/match_phase_limiter_test.cpp | 4 ++-- .../searchable/attribute_weighted_set_blueprint_test.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp b/searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp index 4cbf085f7316..8a064cb42f4f 100644 --- a/searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp +++ b/searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp @@ -446,8 +446,8 @@ struct RangeLimitFixture { a1FieldSpec("a1", 1, 1), f1FieldSpec("f1", 2, 2) { - attrManager.addAttribute(search::AttributeFactory::createAttribute(a1FieldSpec.getName(), Config(BasicType("int64")))); - attrManager.addAttribute(search::AttributeFactory::createAttribute(f1FieldSpec.getName(), Config(BasicType("double")))); + attrManager.addAttribute(search::AttributeFactory::createAttribute(a1FieldSpec.getName(), Config(BasicType::INT64))); + attrManager.addAttribute(search::AttributeFactory::createAttribute(f1FieldSpec.getName(), Config(BasicType::DOUBLE))); } search::AttributeBlueprintFactory attrSearchable; search::attribute::test::MockAttributeManager attrManager; diff --git a/searchlib/src/tests/attribute/searchable/attribute_weighted_set_blueprint_test.cpp b/searchlib/src/tests/attribute/searchable/attribute_weighted_set_blueprint_test.cpp index d85a7918b4ff..686dd949c47f 100644 --- a/searchlib/src/tests/attribute/searchable/attribute_weighted_set_blueprint_test.cpp +++ b/searchlib/src/tests/attribute/searchable/attribute_weighted_set_blueprint_test.cpp @@ -37,7 +37,7 @@ setupAttributeManager(MockAttributeManager &manager, bool isFilter) { AttributeVector::DocId docId; { - AttributeVector::SP attr_sp = AttributeFactory::createAttribute("integer", Config(BasicType("int64")).setIsFilter(isFilter)); + AttributeVector::SP attr_sp = AttributeFactory::createAttribute("integer", Config(BasicType::INT64).setIsFilter(isFilter)); manager.addAttribute(attr_sp); auto *attr = (IntegerAttribute*)(attr_sp.get()); @@ -49,7 +49,7 @@ setupAttributeManager(MockAttributeManager &manager, bool isFilter) } } { - AttributeVector::SP attr_sp = AttributeFactory::createAttribute("string", Config(BasicType("string")).setIsFilter(isFilter)); + AttributeVector::SP attr_sp = AttributeFactory::createAttribute("string", Config(BasicType::STRING).setIsFilter(isFilter)); manager.addAttribute(attr_sp); auto *attr = (StringAttribute*)(attr_sp.get()); @@ -62,7 +62,7 @@ setupAttributeManager(MockAttributeManager &manager, bool isFilter) } { AttributeVector::SP attr_sp = AttributeFactory::createAttribute( - "multi", Config(BasicType("int64"), search::attribute::CollectionType("array")).setIsFilter(isFilter)); + "multi", Config(BasicType::INT64, search::attribute::CollectionType::ARRAY).setIsFilter(isFilter)); manager.addAttribute(attr_sp); auto *attr = (IntegerAttribute*)(attr_sp.get()); for (size_t i = 1; i < 10; ++i) {