diff options
author | Geir Storli <geirst@verizonmedia.com> | 2019-03-07 15:49:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-07 15:49:07 +0100 |
commit | 701e2344811bc2452c9e5d71a5487a291083d1f8 (patch) | |
tree | 3d0489fca53508cf0dfb9da6f99a73b344729268 /searchcore/src/tests/proton/attribute | |
parent | a62d29da8aaeea87648263ba4e7e9503dcf1fcbd (diff) | |
parent | dd41a5b13c767b6a1a685b9d4be873cebff6b5fa (diff) |
Merge pull request #8694 from vespa-engine/toregge/add-tensor-type-checks
Check for assignable tensor type when setting tensor in TensorFieldValue
Diffstat (limited to 'searchcore/src/tests/proton/attribute')
-rw-r--r-- | searchcore/src/tests/proton/attribute/attribute_test.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/searchcore/src/tests/proton/attribute/attribute_test.cpp b/searchcore/src/tests/proton/attribute/attribute_test.cpp index a643dda01c6..7b7d25d2d52 100644 --- a/searchcore/src/tests/proton/attribute/attribute_test.cpp +++ b/searchcore/src/tests/proton/attribute/attribute_test.cpp @@ -1,6 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/config-attributes.h> +#include <vespa/document/datatype/tensor_data_type.h> #include <vespa/document/fieldvalue/document.h> #include <vespa/document/predicate/predicate_slime_builder.h> #include <vespa/document/update/arithmeticvalueupdate.h> @@ -683,7 +684,8 @@ TEST_F("require that attribute writer handles tensor assign update", Fixture) DocumentUpdate upd(*builder.getDocumentTypeRepo(), dt, DocumentId("doc::1")); auto new_tensor = createTensor({ {{{"x", "8"}, {"y", "9"}}, 11} }, {"x", "y"}); - TensorFieldValue new_value; + TensorDataType xySparseTensorDataType(vespalib::eval::ValueType::from_spec("tensor(x{},y{})")); + TensorFieldValue new_value(xySparseTensorDataType); new_value = new_tensor->clone(); upd.addUpdate(FieldUpdate(upd.getType().getField("a1")) .addUpdate(AssignValueUpdate(new_value))); |