diff options
author | Tor Egge <Tor.Egge@broadpark.no> | 2019-02-13 12:31:58 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@broadpark.no> | 2019-02-13 12:34:18 +0100 |
commit | e6935ceb834b912a0b63b4e7fb9e1c5bceadaab0 (patch) | |
tree | 6bb285c89a183e5aefa0fa911d3de6eba213fb5a /document/src/tests | |
parent | b9869d95dd4d80e23f15d610756924aaa12ea28b (diff) |
Prepare for tracking tensor type in document module (C++), aligning
with java implementation.
Diffstat (limited to 'document/src/tests')
-rw-r--r-- | document/src/tests/documentupdatetestcase.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/document/src/tests/documentupdatetestcase.cpp b/document/src/tests/documentupdatetestcase.cpp index 5100e3683e5..e93738f2afb 100644 --- a/document/src/tests/documentupdatetestcase.cpp +++ b/document/src/tests/documentupdatetestcase.cpp @@ -3,6 +3,7 @@ #include <vespa/document/fieldvalue/fieldvalues.h> #include <vespa/document/update/documentupdate.h> #include <vespa/document/base/testdocman.h> +#include <vespa/document/datatype/tensor_data_type.h> #include <vespa/document/update/addvalueupdate.h> #include <vespa/document/update/arithmeticvalueupdate.h> @@ -944,7 +945,8 @@ DocumentUpdateTest::testTensorAssignUpdate() CPPUNIT_ASSERT(!doc->getValue("tensor")); Document updated(*doc); FieldValue::UP new_value(createTensorFieldValue()); - testValueUpdate(AssignValueUpdate(*new_value), *DataType::TENSOR); + auto tensorDataType = std::make_unique<TensorDataType>(); + testValueUpdate(AssignValueUpdate(*new_value), *tensorDataType); DocumentUpdate upd(docMan.getTypeRepo(), *doc->getDataType(), doc->getId()); upd.addUpdate(FieldUpdate(upd.getType().getField("tensor")).addUpdate(AssignValueUpdate(*new_value))); upd.applyTo(updated); @@ -978,7 +980,8 @@ DocumentUpdateTest::testTensorAddUpdate() auto oldTensor = createTensorFieldValueWith2Cells(); updated.setValue(updated.getField("tensor"), *oldTensor); CPPUNIT_ASSERT(*doc != updated); - testValueUpdate(*createTensorAddUpdate(), *DataType::TENSOR); + auto tensorDataType = std::make_unique<TensorDataType>(); + testValueUpdate(*createTensorAddUpdate(), *tensorDataType); std::string expTensorAddUpdateString("TensorAddUpdate(" "{TensorFieldValue: " "{\"dimensions\":[\"x\",\"y\"]," @@ -1006,7 +1009,8 @@ DocumentUpdateTest::testTensorModifyUpdate() auto oldTensor = createTensorFieldValueWith2Cells(); updated.setValue(updated.getField("tensor"), *oldTensor); CPPUNIT_ASSERT(*doc != updated); - testValueUpdate(*createTensorModifyUpdate(), *DataType::TENSOR); + auto tensorDataType = std::make_unique<TensorDataType>(); + testValueUpdate(*createTensorModifyUpdate(), *tensorDataType); std::string expTensorModifyUpdateString("TensorModifyUpdate(replace," "{TensorFieldValue: " "{\"dimensions\":[\"x\",\"y\"]," |