Skip to content
Snippets Groups Projects
Commit 56da771e authored by Thomas Purcell's avatar Thomas Purcell
Browse files

ModelNode test fix

More parameterization tests moved inside macros
parent 5ba4035f
No related branches found
No related tags found
No related merge requests found
...@@ -108,13 +108,6 @@ namespace ...@@ -108,13 +108,6 @@ namespace
} }
catch(const std::logic_error& e) catch(const std::logic_error& e)
{} {}
try
{
std::shared_ptr<ModelNode> feat_5 = std::make_shared<ModelNode>(4, 1, "(C + 1.0)^2", "$\\left(C + 1\\right)^2$", "2|sq: 1.0, 1.0, 2.0", "(C + 1).^2", _value_3, _test_value_3, std::vector<std::string>(1, "C"), Unit("m"));
EXPECT_TRUE(false) << " (Creation of ModelNode with wrong postfix_expr.)";
}
catch(const std::logic_error& e)
{}
feat_1->set_value(); feat_1->set_value();
EXPECT_EQ(feat_1->value()[0], _value_1[0]); EXPECT_EQ(feat_1->value()[0], _value_1[0]);
...@@ -123,6 +116,13 @@ namespace ...@@ -123,6 +116,13 @@ namespace
EXPECT_EQ(feat_1->test_value()[0], _test_value_1[0]); EXPECT_EQ(feat_1->test_value()[0], _test_value_1[0]);
#ifdef PARAMETERIZE #ifdef PARAMETERIZE
try
{
std::shared_ptr<ModelNode> feat_5 = std::make_shared<ModelNode>(4, 1, "(C + 1.0)^2", "$\\left(C + 1\\right)^2$", "2|sq: 1.0, 1.0, 2.0", "(C + 1).^2", _value_3, _test_value_3, std::vector<std::string>(1, "C"), Unit("m"));
EXPECT_TRUE(false) << " (Creation of ModelNode with wrong postfix_expr.)";
}
catch(const std::logic_error& e)
{}
std::vector<double> params = {1.0, 1.0}; std::vector<double> params = {1.0, 1.0};
EXPECT_STREQ(feat_1->matlab_fxn_expr(params.data()).c_str(), feat_1->matlab_fxn_expr().c_str()); EXPECT_STREQ(feat_1->matlab_fxn_expr(params.data()).c_str(), feat_1->matlab_fxn_expr().c_str());
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment