Skip to content

Commit

Permalink
Merge pull request #21 from lballabio/fourth-case
Browse files Browse the repository at this point in the history
Add Motti Lanzkron's fourth test case.
  • Loading branch information
hsutter authored Oct 16, 2016
2 parents ad9fe3c + c1061c8 commit 9da9af2
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,24 @@ bool TestCase3() {
return Counter::count() == 4;
}

bool TestCase4() {
MyGraph g;
{
auto a = MyGraph::MakeNode();
g.SetRoot(a);
auto b = MyGraph::MakeNode();
a->AddChild(b);
auto c = MyGraph::MakeNode();
b->AddChild(c);
auto d = MyGraph::MakeNode();
b->AddChild(d);
d->AddChild(b);
d->RemoveChild(b);
}
g.ShrinkToFit();
return Counter::count() == 4;
}

int main() {
cout.setf(ios::boolalpha);

Expand All @@ -153,5 +171,8 @@ int main() {
bool passed3 = TestCase3();
cout << passed3 << endl;

bool passed4 = TestCase4();
cout << passed4 << endl;

return 0;
}

0 comments on commit 9da9af2

Please sign in to comment.