Skip to content
Snippets Groups Projects
Commit 010cda9d authored by Tom Fischer's avatar Tom Fischer
Browse files

[T/MPL] Use the new interface in the tests.

parent f5961dd8
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......@@ -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)]) -
......
......@@ -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)),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment