test/path_test.cc
changeset 2335 27aa03cd3121
parent 2260 4274224f8a7d
child 2391 14a343be7a5a
     1.1 --- a/test/path_test.cc	Fri Jan 05 10:59:18 2007 +0000
     1.2 +++ b/test/path_test.cc	Mon Jan 08 10:39:59 2007 +0000
     1.3 @@ -31,78 +31,14 @@
     1.4  using namespace lemon;
     1.5  
     1.6  void check_concepts() {
     1.7 -  checkConcept<concepts::Path<concepts::Graph>, 
     1.8 -    concepts::Path<concepts::Graph> >();
     1.9 -  checkConcept<concepts::Path<concepts::Graph>, 
    1.10 -    Path<concepts::Graph> >();
    1.11 +  checkConcept<concepts::Path<ListGraph>, concepts::Path<ListGraph> >();
    1.12    checkConcept<concepts::Path<ListGraph>, Path<ListGraph> >();
    1.13 +  checkConcept<concepts::Path<ListGraph>, SimplePath<ListGraph> >();
    1.14 +  checkConcept<concepts::Path<ListGraph>, StaticPath<ListGraph> >();
    1.15 +  checkConcept<concepts::Path<ListGraph>, ListPath<ListGraph> >();
    1.16  }
    1.17  
    1.18  int main() {
    1.19 -  check_concepts();
    1.20 -  
    1.21 -  ListGraph g;
    1.22 -  
    1.23 -  ListGraph::Node n1 = g.addNode();
    1.24 -  ListGraph::Node n2 = g.addNode();
    1.25 -  ListGraph::Node n3 = g.addNode();
    1.26 -  ListGraph::Node n4 = g.addNode();
    1.27 -  ListGraph::Node n5 = g.addNode();
    1.28 - 
    1.29 -  ListGraph::Edge e1 = g.addEdge(n1, n2);
    1.30 -  ListGraph::Edge e2 = g.addEdge(n2, n3);
    1.31 -  ListGraph::Edge e3 = g.addEdge(n3, n4);
    1.32 -  ListGraph::Edge e4 = g.addEdge(n4, n5);
    1.33 -  ListGraph::Edge e5 = g.addEdge(n5, n1);
    1.34 -
    1.35 -  {
    1.36 -    Path<ListGraph> p(g);
    1.37 -
    1.38 -    check(p.empty(), "Wrong Path");
    1.39 -    check(p.length() == 0, "Wrong Path");
    1.40 -    
    1.41 -    {
    1.42 -      Path<ListGraph>::Builder b(p);
    1.43 -      b.setStartNode(n3);
    1.44 -      b.commit();
    1.45 -    }
    1.46 -
    1.47 -    check(!p.empty(), "Wrong Path");
    1.48 -    check(p.length() == 0, "Wrong Path");
    1.49 -    check(p.source() == n3, "Wrong Path");
    1.50 -    check(p.target() == n3, "Wrong Path");
    1.51 -
    1.52 -    {
    1.53 -      Path<ListGraph>::Builder b(p);
    1.54 -      b.pushBack(e3);
    1.55 -      b.pushBack(e4);
    1.56 -      b.pushFront(e2);
    1.57 -      b.commit();
    1.58 -    }
    1.59 -
    1.60 -    check(!p.empty(), "Wrong Path");
    1.61 -    check(p.length() == 3, "Wrong Path");
    1.62 -    check(p.source() == n2, "Wrong Path");
    1.63 -    check(p.target() == n5, "Wrong Path");
    1.64 -    
    1.65 -    {
    1.66 -      Path<ListGraph>::NodeIt it(p);
    1.67 -      check((ListGraph::Node)it == n2, "Wrong Path"); ++it;
    1.68 -      check((ListGraph::Node)it == n3, "Wrong Path"); ++it;
    1.69 -      check((ListGraph::Node)it == n4, "Wrong Path"); ++it;
    1.70 -      check((ListGraph::Node)it == n5, "Wrong Path"); ++it;
    1.71 -      check((ListGraph::Node)it == INVALID, "Wrong Path");
    1.72 -    }
    1.73 -
    1.74 -    {
    1.75 -      Path<ListGraph>::EdgeIt it(p);
    1.76 -      check((ListGraph::Edge)it == e2, "Wrong Path"); ++it;
    1.77 -      check((ListGraph::Edge)it == e3, "Wrong Path"); ++it;
    1.78 -      check((ListGraph::Edge)it == e4, "Wrong Path"); ++it;
    1.79 -      check((ListGraph::Edge)it == INVALID, "Wrong Path");
    1.80 -    }
    1.81 -    
    1.82 -  }
    1.83 -  
    1.84 +  check_concepts();  
    1.85    return 0;
    1.86  }