Commit 4e670617 authored by Tom Perkins's avatar Tom Perkins
Browse files

Add tests for preserving domains on clone

Test that number of domains is preserved on cloning function
and that local attribute "domains" is preserved in string

re #16835
parent bd11449c
......@@ -434,6 +434,22 @@ public:
}
}
void test_clone_preserves_domains() {
const auto copy = multi.clone();
TS_ASSERT_EQUALS(copy->getNumberDomains(), multi.getNumberDomains());
}
void test_string_representation() {
const std::string expected =
"composite=MultiDomainFunction,NumDeriv=true;"
"name=MultiDomainFunctionTest_Function,A=0,B=1,$domains=i;"
"name=MultiDomainFunctionTest_Function,A=0,B=2,$domains=i;"
"name=MultiDomainFunctionTest_Function,A=0,B=3,$domains=i;ties=(f1.A="
"f0.A,f2.A=f0.A)";
TS_ASSERT_EQUALS(multi.asString(), expected);
TS_ASSERT_EQUALS(multi.asString(), multi.clone()->asString());
}
private:
MultiDomainFunction multi;
JointDomain domain;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment