summaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests/features/ranking_expression/ranking_expression_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'searchlib/src/tests/features/ranking_expression/ranking_expression_test.cpp')
-rw-r--r--searchlib/src/tests/features/ranking_expression/ranking_expression_test.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/searchlib/src/tests/features/ranking_expression/ranking_expression_test.cpp b/searchlib/src/tests/features/ranking_expression/ranking_expression_test.cpp
index 963f4a58bb0..70e1d481a6c 100644
--- a/searchlib/src/tests/features/ranking_expression/ranking_expression_test.cpp
+++ b/searchlib/src/tests/features/ranking_expression/ranking_expression_test.cpp
@@ -21,20 +21,24 @@ struct SetupResult {
RankingExpressionBlueprint rank;
DummyDependencyHandler deps;
bool setup_ok;
- SetupResult(const TypeMap &object_inputs,
- const vespalib::string &expression)
- : index_env(), rank(), deps(rank), setup_ok(false)
- {
- rank.setName("self");
- index_env.getProperties().add("self.rankingScript", expression);
- for (const auto &input: object_inputs) {
- deps.define_object_input(input.first, ValueType::from_spec(input.second));
- }
- setup_ok = rank.setup(index_env, {});
- EXPECT_TRUE(!deps.accept_type_mismatch);
- }
+ SetupResult(const TypeMap &object_inputs, const vespalib::string &expression);
+ ~SetupResult();
};
+SetupResult::SetupResult(const TypeMap &object_inputs,
+ const vespalib::string &expression)
+ : index_env(), rank(), deps(rank), setup_ok(false)
+{
+ rank.setName("self");
+ index_env.getProperties().add("self.rankingScript", expression);
+ for (const auto &input: object_inputs) {
+ deps.define_object_input(input.first, ValueType::from_spec(input.second));
+ }
+ setup_ok = rank.setup(index_env, {});
+ EXPECT_TRUE(!deps.accept_type_mismatch);
+}
+SetupResult::~SetupResult() {}
+
void verify_output_type(const TypeMap &object_inputs,
const vespalib::string &expression, const FeatureType &expect)
{