Commit 6b8b873a authored by Chuanren Wu's avatar Chuanren Wu

add a loop test

parent 6575f802
......@@ -294,6 +294,45 @@ TEST(BC, ThreeSegment1)
EXPECT_EQ(v[2], v[4]+v[8]);
}
TEST(BC, Loop1)
{
std::vector<Constraint> cs;
{
Constraint c;
c.plus(0);
c.minus(1);
cs.push_back(c);
}
{
Constraint c;
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);
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, 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