From e6935ceb834b912a0b63b4e7fb9e1c5bceadaab0 Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Wed, 13 Feb 2019 12:31:58 +0100 Subject: Prepare for tracking tensor type in document module (C++), aligning with java implementation. --- document/src/tests/documentupdatetestcase.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'document/src/tests') 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 #include #include +#include #include #include @@ -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(); + 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(); + 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(); + testValueUpdate(*createTensorModifyUpdate(), *tensorDataType); std::string expTensorModifyUpdateString("TensorModifyUpdate(replace," "{TensorFieldValue: " "{\"dimensions\":[\"x\",\"y\"]," -- cgit v1.2.3