Changeset 431:4b6112235fad in lemon for test/graph_adaptor_test.cc
 Timestamp:
 11/30/08 19:00:30 (12 years ago)
 Branch:
 default
 Phase:
 public
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

test/graph_adaptor_test.cc
r430 r431 38 38 using namespace lemon; 39 39 40 void checkDigraphAdaptor() {41 checkConcept<concepts::Digraph, DigraphAdaptor<concepts::Digraph> >();42 43 typedef ListDigraph Digraph;44 typedef DigraphAdaptor<Digraph> Adaptor;45 46 Digraph digraph;47 Adaptor adaptor(digraph);48 49 Digraph::Node n1 = digraph.addNode();50 Digraph::Node n2 = digraph.addNode();51 Digraph::Node n3 = digraph.addNode();52 53 Digraph::Arc a1 = digraph.addArc(n1, n2);54 Digraph::Arc a2 = digraph.addArc(n1, n3);55 Digraph::Arc a3 = digraph.addArc(n2, n3);56 57 checkGraphNodeList(adaptor, 3);58 checkGraphArcList(adaptor, 3);59 checkGraphConArcList(adaptor, 3);60 61 checkGraphOutArcList(adaptor, n1, 2);62 checkGraphOutArcList(adaptor, n2, 1);63 checkGraphOutArcList(adaptor, n3, 0);64 65 checkGraphInArcList(adaptor, n1, 0);66 checkGraphInArcList(adaptor, n2, 1);67 checkGraphInArcList(adaptor, n3, 2);68 69 checkNodeIds(adaptor);70 checkArcIds(adaptor);71 72 checkGraphNodeMap(adaptor);73 checkGraphArcMap(adaptor);74 }75 76 40 void checkRevDigraphAdaptor() { 77 41 checkConcept<concepts::Digraph, RevDigraphAdaptor<concepts::Digraph> >(); … … 586 550 } 587 551 588 void checkGraphAdaptor() {589 checkConcept<concepts::Graph, GraphAdaptor<concepts::Graph> >();590 591 typedef ListGraph Graph;592 typedef GraphAdaptor<Graph> Adaptor;593 594 Graph graph;595 Adaptor adaptor(graph);596 597 Graph::Node n1 = graph.addNode();598 Graph::Node n2 = graph.addNode();599 Graph::Node n3 = graph.addNode();600 Graph::Node n4 = graph.addNode();601 602 Graph::Edge a1 = graph.addEdge(n1, n2);603 Graph::Edge a2 = graph.addEdge(n1, n3);604 Graph::Edge a3 = graph.addEdge(n2, n3);605 Graph::Edge a4 = graph.addEdge(n3, n4);606 607 checkGraphNodeList(adaptor, 4);608 checkGraphArcList(adaptor, 8);609 checkGraphEdgeList(adaptor, 4);610 checkGraphConArcList(adaptor, 8);611 checkGraphConEdgeList(adaptor, 4);612 613 checkGraphOutArcList(adaptor, n1, 2);614 checkGraphOutArcList(adaptor, n2, 2);615 checkGraphOutArcList(adaptor, n3, 3);616 checkGraphOutArcList(adaptor, n4, 1);617 618 checkGraphInArcList(adaptor, n1, 2);619 checkGraphInArcList(adaptor, n2, 2);620 checkGraphInArcList(adaptor, n3, 3);621 checkGraphInArcList(adaptor, n4, 1);622 623 checkGraphIncEdgeList(adaptor, n1, 2);624 checkGraphIncEdgeList(adaptor, n2, 2);625 checkGraphIncEdgeList(adaptor, n3, 3);626 checkGraphIncEdgeList(adaptor, n4, 1);627 628 629 checkNodeIds(adaptor);630 checkArcIds(adaptor);631 checkEdgeIds(adaptor);632 633 checkGraphNodeMap(adaptor);634 checkGraphArcMap(adaptor);635 checkGraphEdgeMap(adaptor);636 }637 638 552 void checkSubGraphAdaptor() { 639 553 checkConcept<concepts::Graph, … … 1054 968 int main(int, const char **) { 1055 969 1056 checkDigraphAdaptor();1057 970 checkRevDigraphAdaptor(); 1058 971 checkSubDigraphAdaptor(); … … 1063 976 checkSplitDigraphAdaptor(); 1064 977 1065 checkGraphAdaptor();1066 978 checkSubGraphAdaptor(); 1067 979 checkNodeSubGraphAdaptor();
Note: See TracChangeset
for help on using the changeset viewer.