From 010cda9d7422266d495fcad91a87e70150ae8651 Mon Sep 17 00:00:00 2001 From: Thomas Fischer <thomas.fischer@ufz.de> Date: Mon, 19 Aug 2019 14:32:06 +0200 Subject: [PATCH] [T/MPL] Use the new interface in the tests. --- Tests/MaterialLib/TestMPL.cpp | 4 +++- Tests/MaterialLib/TestMPLExponentialProperty.cpp | 4 +++- Tests/MaterialLib/TestMPLLinearProperty.cpp | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Tests/MaterialLib/TestMPL.cpp b/Tests/MaterialLib/TestMPL.cpp index 3885b74a240..5f59b41d850 100644 --- a/Tests/MaterialLib/TestMPL.cpp +++ b/Tests/MaterialLib/TestMPL.cpp @@ -16,6 +16,7 @@ #include "BaseLib/ConfigTree.h" #include "MaterialLib/MPL/CreateMedium.h" +#include "ParameterLib/Parameter.h" std::unique_ptr<MPL::Medium> createTestMaterial(std::string const& xml) { @@ -23,6 +24,7 @@ std::unique_ptr<MPL::Medium> createTestMaterial(std::string const& xml) BaseLib::ConfigTree conf(ptree, "", BaseLib::ConfigTree::onerror, BaseLib::ConfigTree::onwarning); auto const& config = conf.getConfigSubtree("medium"); + std::vector<std::unique_ptr<ParameterLib::ParameterBase>> parameters; - return MPL::createMedium(config); + return MPL::createMedium(config, parameters); } diff --git a/Tests/MaterialLib/TestMPLExponentialProperty.cpp b/Tests/MaterialLib/TestMPLExponentialProperty.cpp index 3a9c56f1144..44773d7425c 100644 --- a/Tests/MaterialLib/TestMPLExponentialProperty.cpp +++ b/Tests/MaterialLib/TestMPLExponentialProperty.cpp @@ -26,8 +26,10 @@ TEST(MaterialPropertyLib, ExponentialProperty) MaterialPropertyLib::VariableArray variable_array; variable_array[static_cast<int>( MaterialPropertyLib::Variable::temperature)] = 20; + ParameterLib::SpatialPosition const pos; + double const time = std::numeric_limits<double>::quiet_NaN(); ASSERT_NEAR( - std::get<double>(exp_property.value(variable_array)), + std::get<double>(exp_property.value(variable_array, pos, time)), y_ref * (std::exp(-factor * (std::get<double>(variable_array[static_cast<int>( MaterialPropertyLib::Variable::temperature)]) - diff --git a/Tests/MaterialLib/TestMPLLinearProperty.cpp b/Tests/MaterialLib/TestMPLLinearProperty.cpp index 3cb9672efa2..fc348c4ba11 100644 --- a/Tests/MaterialLib/TestMPLLinearProperty.cpp +++ b/Tests/MaterialLib/TestMPLLinearProperty.cpp @@ -24,8 +24,10 @@ TEST(MaterialPropertyLib, LinearProperty) MaterialPropertyLib::VariableArray variable_array; variable_array[static_cast<int>( MaterialPropertyLib::Variable::temperature)] = 303.15; + ParameterLib::SpatialPosition const pos; + double const time = std::numeric_limits<double>::quiet_NaN(); ASSERT_NEAR( - std::get<double>(linear_property.value(variable_array)), + std::get<double>(linear_property.value(variable_array, pos, time)), y_ref * (1 + m * (std::get<double>(variable_array[static_cast<int>( MaterialPropertyLib::Variable::temperature)]) - x_ref)), -- GitLab