diff options
author | Tor Egge <Tor.Egge@broadpark.no> | 2019-03-06 18:14:03 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@broadpark.no> | 2019-03-07 13:28:48 +0100 |
commit | 93c5cb44ba9f8fa36314b8a4d6d57b75422f8c29 (patch) | |
tree | 0aabf97b84256fe9c10d3d22de0b9ddcf73d9129 /searchcore/src/tests/proton/attribute/attribute_test.cpp | |
parent | 99bcfb517bd0b57c24f81478c3767f1b8d369fb3 (diff) |
Check for assignable tensor type when setting tensor in TensorFieldValue.
Diffstat (limited to 'searchcore/src/tests/proton/attribute/attribute_test.cpp')
-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))); |