aboutsummaryrefslogtreecommitdiffstats
path: root/streamingvisitors
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2020-12-01 15:10:59 +0000
committerArne Juul <arnej@verizonmedia.com>2020-12-02 14:14:12 +0000
commit919ec00a9948c24f645daafbaea94183cc931397 (patch)
tree11417c16a7ee0aa1274e1605e21e43b62ccad3ac /streamingvisitors
parent2966d36270a364b0d1421fa3c5dfffdca7a8a26d (diff)
use SimpleValue instead of EngineOrFactory
Diffstat (limited to 'streamingvisitors')
-rw-r--r--streamingvisitors/src/tests/hitcollector/hitcollector_test.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/streamingvisitors/src/tests/hitcollector/hitcollector_test.cpp b/streamingvisitors/src/tests/hitcollector/hitcollector_test.cpp
index e2c47da6997..087a3be86d3 100644
--- a/streamingvisitors/src/tests/hitcollector/hitcollector_test.cpp
+++ b/streamingvisitors/src/tests/hitcollector/hitcollector_test.cpp
@@ -6,9 +6,10 @@
#include <vespa/searchlib/fef/matchdata.h>
#include <vespa/searchlib/fef/feature_resolver.h>
#include <vespa/searchvisitor/hitcollector.h>
-#include <vespa/eval/eval/value.h>
+#include <vespa/eval/eval/simple_value.h>
#include <vespa/eval/eval/tensor_spec.h>
-#include <vespa/eval/eval/engine_or_factory.h>
+#include <vespa/eval/eval/value.h>
+#include <vespa/eval/eval/value_codec.h>
#include <vespa/vespalib/objects/nbostream.h>
using namespace document;
@@ -17,10 +18,11 @@ using namespace vespalib;
using namespace vdslib;
using namespace vsm;
using vespalib::nbostream;
-using vespalib::eval::EngineOrFactory;
-using vespalib::eval::Value;
using vespalib::eval::DoubleValue;
+using vespalib::eval::SimpleValue;
using vespalib::eval::TensorSpec;
+using vespalib::eval::Value;
+
namespace streaming {
@@ -252,7 +254,7 @@ public:
~MyRankProgram();
virtual void run(uint32_t docid, const std::vector<search::fef::TermFieldMatchData> &) override {
_boxed_double = std::make_unique<DoubleValue>(docid + 30);
- _tensor = EngineOrFactory::get().from_spec(TensorSpec("tensor(x{})").add({{"x", "a"}}, docid + 20));
+ _tensor = SimpleValue::from_spec(TensorSpec("tensor(x{})").add({{"x", "a"}}, docid + 20));
_fooValue.as_number = docid + 10;
_barValue.as_object = *_boxed_double;
_bazValue.as_object = *_tensor;
@@ -307,9 +309,8 @@ HitCollectorTest::testFeatureSet()
EXPECT_TRUE(!f[2].is_double());
EXPECT_TRUE(f[2].is_data());
{
- auto engine = EngineOrFactory::get();
nbostream buf(f[2].as_data().data, f[2].as_data().size);
- auto actual = engine.to_spec(*engine.decode(buf));
+ auto actual = spec_from_value(*SimpleValue::from_stream(buf));
auto expect = TensorSpec("tensor(x{})").add({{"x", "a"}}, 23);
EXPECT_EQUAL(actual, expect);
}