Commit 11d37559 authored by Chuanren Wu's avatar Chuanren Wu

more loop tests

parent 6b8b873a
......@@ -333,6 +333,71 @@ TEST(BC, Loop1)
EXPECT_LE(10, v[3]);
}
TEST(BC, Loop2)
{
std::vector<Constraint> cs;
{
Constraint c;
c.plus(0);
c.plus(1);
c.minus(2);
cs.push_back(c);
}
{
Constraint c;
c.plus(2);
c.minus(3);
cs.push_back(c);
}
{
Constraint c;
c.plus(3);
c.minus(0);
c.minus(1);
cs.push_back(c);
}
std::vector<double> vl = {10, 50, 30, 20};
auto v = discretizeImpl(vl, cs);
ASSERT_NE(0, v.size());
EXPECT_LE(10, v[0]);
EXPECT_LE(10, v[1]);
EXPECT_LE(10, v[2]);
EXPECT_LE(10, v[3]);
}
TEST(BC, LoopFailed1)
{
std::vector<Constraint> cs;
{
Constraint c;
c.plus(0);
c.plus(1);
c.minus(2);
cs.push_back(c);
}
{
Constraint c;
c.plus(2);
c.minus(3);
cs.push_back(c);
}
{
Constraint c;
c.plus(3);
c.minus(1);
cs.push_back(c);
}
std::vector<double> vl = {10, 50, 30, 20};
auto v = discretizeImpl(vl, cs);
EXPECT_EQ(0, v.size());
}
TEST(BC, ComplexSystem)
{
std::vector<Constraint> cs;
......
Markdown is supported
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