diff options
author | Tor Egge <Tor.Egge@online.no> | 2022-09-07 15:08:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-07 15:08:55 +0200 |
commit | a9d670dff75d1f1d3b9849ee60e312717ca570fe (patch) | |
tree | ae49c288efb2e70d20783c91c293aad5b7442968 /searchcore/src/tests/proton/verify_ranksetup | |
parent | 9ebb7848b51f05209ab735e05d115c55d08ade1a (diff) |
Revert "Unify access to assets needed during rank-setup."
Diffstat (limited to 'searchcore/src/tests/proton/verify_ranksetup')
-rw-r--r-- | searchcore/src/tests/proton/verify_ranksetup/verify_ranksetup_test.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/searchcore/src/tests/proton/verify_ranksetup/verify_ranksetup_test.cpp b/searchcore/src/tests/proton/verify_ranksetup/verify_ranksetup_test.cpp index 33a52f70f2b..6f4420695c4 100644 --- a/searchcore/src/tests/proton/verify_ranksetup/verify_ranksetup_test.cpp +++ b/searchcore/src/tests/proton/verify_ranksetup/verify_ranksetup_test.cpp @@ -27,9 +27,9 @@ using vespalib::make_string_short::fmt; struct Writer { FILE *file; - explicit Writer(const std::string &file_name) { + Writer(const std::string &file_name) { file = fopen(file_name.c_str(), "w"); - ASSERT_TRUE(file != nullptr); + ASSERT_TRUE(file != 0); } void fmt(const char *format, ...) const #ifdef __GNUC__ @@ -63,7 +63,7 @@ struct Attribute { ~Attribute(); }; -Attribute::~Attribute() = default; +Attribute::~Attribute() {} struct Setup { std::map<std::string,std::pair<std::string,std::string> > indexes; @@ -75,8 +75,8 @@ struct Setup { std::map<std::string,OnnxModel> onnx_models; Setup(); ~Setup(); - void add_onnx_model(OnnxModel model) { - onnx_models.insert_or_assign(model.name(), std::move(model)); + void add_onnx_model(const OnnxModel &model) { + onnx_models.insert_or_assign(model.name(), model); } void index(const std::string &name, schema::DataType data_type, schema::CollectionType collection_type) @@ -141,7 +141,7 @@ struct Setup { } void write_indexschema(const Writer &out) { out.fmt("indexfield[%zu]\n", indexes.size()); - auto pos = indexes.begin(); + std::map<std::string,std::pair<std::string,std::string> >::const_iterator pos = indexes.begin(); for (size_t i = 0; pos != indexes.end(); ++pos, ++i) { out.fmt("indexfield[%zu].name \"%s\"\n", i, pos->first.c_str()); out.fmt("indexfield[%zu].datatype %s\n", i, pos->second.first.c_str()); @@ -151,7 +151,7 @@ struct Setup { void write_rank_profiles(const Writer &out) { out.fmt("rankprofile[%zu]\n", extra_profiles.size() + 1); out.fmt("rankprofile[0].name \"default\"\n"); - auto pos = properties.begin(); + std::map<std::string,std::string>::const_iterator pos = properties.begin(); for (size_t i = 0; pos != properties.end(); ++pos, ++i) { out.fmt("rankprofile[0].fef.property[%zu]\n", properties.size()); out.fmt("rankprofile[0].fef.property[%zu].name \"%s\"\n", i, pos->first.c_str()); @@ -258,7 +258,7 @@ Setup::Setup() { verify_dir(); } -Setup::~Setup() = default; +Setup::~Setup() {} //----------------------------------------------------------------------------- @@ -279,15 +279,15 @@ struct SimpleSetup : Setup { struct OnnxSetup : Setup { OnnxSetup() : Setup() { add_onnx_model(OnnxModel("simple", TEST_PATH("../../../../../eval/src/tests/tensor/onnx_wrapper/simple.onnx"))); - add_onnx_model(std::move(OnnxModel("mapped", TEST_PATH("../../../../../eval/src/tests/tensor/onnx_wrapper/simple.onnx")) + add_onnx_model(OnnxModel("mapped", TEST_PATH("../../../../../eval/src/tests/tensor/onnx_wrapper/simple.onnx")) .input_feature("query_tensor", "rankingExpression(qt)") .input_feature("attribute_tensor", "rankingExpression(at)") .input_feature("bias_tensor", "rankingExpression(bt)") - .output_name("output", "result"))); - add_onnx_model(std::move(OnnxModel("fragile", TEST_PATH("../../../../../searchlib/src/tests/features/onnx_feature/fragile.onnx")) - .dry_run_on_setup(true))); - add_onnx_model(std::move(OnnxModel("unfragile", TEST_PATH("../../../../../searchlib/src/tests/features/onnx_feature/fragile.onnx")) - .dry_run_on_setup(false))); + .output_name("output", "result")); + add_onnx_model(OnnxModel("fragile", TEST_PATH("../../../../../searchlib/src/tests/features/onnx_feature/fragile.onnx")) + .dry_run_on_setup(true)); + add_onnx_model(OnnxModel("unfragile", TEST_PATH("../../../../../searchlib/src/tests/features/onnx_feature/fragile.onnx")) + .dry_run_on_setup(false)); } }; |