1.1 --- a/test/path_test.cc Wed Sep 12 17:25:48 2012 +0200
1.2 +++ b/test/path_test.cc Thu Sep 13 11:56:19 2012 +0200
1.3 @@ -38,7 +38,36 @@
1.4 checkConcept<concepts::Path<ListDigraph>, ListPath<ListDigraph> >();
1.5 }
1.6
1.7 +// Check if proper copy consructor is called (use valgrind for testing)
1.8 +template<class _Path>
1.9 +void checkCopy()
1.10 +{
1.11 + ListDigraph g;
1.12 + ListDigraph::Arc a = g.addArc(g.addNode(), g.addNode());
1.13 +
1.14 + _Path p,q;
1.15 + p.addBack(a);
1.16 + q=p;
1.17 + _Path r(p);
1.18 + StaticPath<ListDigraph> s(r);
1.19 +}
1.20 +
1.21 int main() {
1.22 check_concepts();
1.23 +
1.24 + checkCopy<Path<ListDigraph> >();
1.25 + checkCopy<SimplePath<ListDigraph> >();
1.26 + checkCopy<ListPath<ListDigraph> >();
1.27 +
1.28 + ListDigraph g;
1.29 + ListDigraph::Arc a = g.addArc(g.addNode(), g.addNode());
1.30 +
1.31 + Path<ListDigraph> p;
1.32 + StaticPath<ListDigraph> q,r;
1.33 + p.addBack(a);
1.34 + q=p;
1.35 + r=q;
1.36 + StaticPath<ListDigraph> s(q);
1.37 +
1.38 return 0;
1.39 }