diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index c6c0d1e94908f160b821abcf0f47eb2755610994..7c8ba2bf72b5ea402d3c0d7a5dbaee85161b1997 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -39,6 +39,7 @@ target_link_libraries(testrunner ApplicationsLib ApplicationsFileIO GTest + InSituLib MeshGeoToolsLib MaterialLib MeshLib diff --git a/Tests/MeshLib/TestVtkMappedPropertyVector.cpp b/Tests/MeshLib/TestVtkMappedPropertyVector.cpp index 5e408b500d007fa3f122428cbeba4ed31df68801..418eb4428552fb9a717218c0d9f9181496f6c00c 100644 --- a/Tests/MeshLib/TestVtkMappedPropertyVector.cpp +++ b/Tests/MeshLib/TestVtkMappedPropertyVector.cpp @@ -13,8 +13,11 @@ */ #include <numeric> +#include <vtkDoubleArray.h> +#include <vtkIntArray.h> #include <vtkNew.h> #include <vtkUnstructuredGrid.h> +#include <vtkUnsignedIntArray.h> #include "gtest/gtest.h" @@ -40,13 +43,15 @@ TEST(MeshLibMappedPropertyVector, Double) double_properties->resize(number_of_tuples); std::iota(double_properties->begin(), double_properties->end(), 1); - vtkNew<MeshLib::VtkMappedPropertyVectorTemplate<double> > dataArray; - dataArray->SetPropertyVector(*double_properties); + vtkNew<vtkDoubleArray> dataArray; + dataArray->SetNumberOfComponents(1); + dataArray->SetArray(double_properties->data(), + static_cast<vtkIdType>(double_properties->size()), 1); ASSERT_EQ(dataArray->GetNumberOfComponents(), 1); ASSERT_EQ(dataArray->GetNumberOfTuples(), number_of_tuples); - ASSERT_EQ(dataArray->GetValueReference(0), 1.0); + ASSERT_EQ(dataArray->GetValue(0), 1.0); double* range = dataArray->GetRange(0); ASSERT_EQ(range[0], 1.0); ASSERT_EQ(range[1], 1.0 + mesh->getNumberOfElements() - 1.0); @@ -71,13 +76,15 @@ TEST(MeshLibMappedPropertyVector, Int) properties->resize(number_of_tuples); std::iota(properties->begin(), properties->end(), -5); - vtkNew<MeshLib::VtkMappedPropertyVectorTemplate<int> > dataArray; - dataArray->SetPropertyVector(*properties); + vtkNew<vtkIntArray> dataArray; + dataArray->SetNumberOfComponents(1); + dataArray->SetArray(properties->data(), + static_cast<vtkIdType>(properties->size()), 1); ASSERT_EQ(dataArray->GetNumberOfComponents(), 1); ASSERT_EQ(dataArray->GetNumberOfTuples(), number_of_tuples); - ASSERT_EQ(dataArray->GetValueReference(0), -5); + ASSERT_EQ(dataArray->GetValue(0), -5); double* range = dataArray->GetRange(0); ASSERT_EQ(-5.0, range[0]); ASSERT_EQ(-5.0 + static_cast<double>(mesh->getNumberOfElements()) - 1.0, range[1]); @@ -103,13 +110,15 @@ TEST(MeshLibMappedPropertyVector, Unsigned) properties->resize(number_of_tuples); std::iota(properties->begin(), properties->end(), 0); - vtkNew<MeshLib::VtkMappedPropertyVectorTemplate<unsigned> > dataArray; - dataArray->SetPropertyVector(*properties); + vtkNew<vtkUnsignedIntArray> dataArray; + dataArray->SetNumberOfComponents(1); + dataArray->SetArray(properties->data(), + static_cast<vtkIdType>(properties->size()), 1); ASSERT_EQ(dataArray->GetNumberOfComponents(), 1); ASSERT_EQ(dataArray->GetNumberOfTuples(), number_of_tuples); - ASSERT_EQ(dataArray->GetValueReference(0), 0); + ASSERT_EQ(dataArray->GetValue(0), 0); double* range = dataArray->GetRange(0); ASSERT_EQ(range[0], 0); ASSERT_EQ(range[1], 0 + mesh->getNumberOfElements() - 1);