Commit 70836f0d authored by Roman Tolchenov's avatar Roman Tolchenov
Browse files

Re #5808. This should fix the bug.

parent 504579c7
......@@ -109,7 +109,7 @@ namespace API
}
const CompositeDomain& cd = dynamic_cast<const CompositeDomain&>(domain);
// domain must not have less parts than m_maxIndex
if (cd.getNParts() < m_maxIndex)
if (cd.getNParts() <= m_maxIndex)
{
throw std::invalid_argument("CompositeDomain has too few parts ("
+ boost::lexical_cast<std::string>(cd.getNParts()) +
......
......@@ -195,6 +195,20 @@ public:
}
void test_set_wrong_index()
{
multi.setDomainIndices(1,std::vector<size_t>());
multi.setDomainIndices(2,std::vector<size_t>());
FunctionValues values(domain);
multi.setDomainIndex(0,3);
TS_ASSERT_THROWS( multi.function(domain,values), std::invalid_argument );
multi.setDomainIndex(0,4);
TS_ASSERT_THROWS( multi.function(domain,values), std::invalid_argument );
}
void test_calc()
{
multi.setDomainIndex(0,0);
......
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