src/test/graph_test.h
changeset 1097 c91e765266d7
parent 946 c94ef40a22ce
child 1164 80bb73097736
equal deleted inserted replaced
9:b76a4740ca51 10:a89914263032
    51   void checkGraphOutEdgeList(Graph &G, typename Graph::Node n, int nn)
    51   void checkGraphOutEdgeList(Graph &G, typename Graph::Node n, int nn)
    52   {
    52   {
    53     typename Graph::OutEdgeIt e(G,n);
    53     typename Graph::OutEdgeIt e(G,n);
    54     for(int i=0;i<nn;i++) {
    54     for(int i=0;i<nn;i++) {
    55       check(e!=INVALID,"Wrong OutEdge list linking.");
    55       check(e!=INVALID,"Wrong OutEdge list linking.");
    56       check(n==G.tail(e), "Wrong OutEdge list linking.");
    56       check(n==G.source(e), "Wrong OutEdge list linking.");
    57       ++e;
    57       ++e;
    58     }
    58     }
    59     check(e==INVALID,"Wrong OutEdge list linking.");
    59     check(e==INVALID,"Wrong OutEdge list linking.");
    60   }
    60   }
    61 
    61 
    63   checkGraphInEdgeList(Graph &G, typename Graph::Node n, int nn)
    63   checkGraphInEdgeList(Graph &G, typename Graph::Node n, int nn)
    64   {
    64   {
    65     typename Graph::InEdgeIt e(G,n);
    65     typename Graph::InEdgeIt e(G,n);
    66     for(int i=0;i<nn;i++) {
    66     for(int i=0;i<nn;i++) {
    67       check(e!=INVALID,"Wrong InEdge list linking.");
    67       check(e!=INVALID,"Wrong InEdge list linking.");
    68       check(n==G.head(e), "Wrong InEdge list linking.");
    68       check(n==G.target(e), "Wrong InEdge list linking.");
    69       ++e;
    69       ++e;
    70     }
    70     }
    71     check(e==INVALID,"Wrong InEdge list linking.");
    71     check(e==INVALID,"Wrong InEdge list linking.");
    72   }
    72   }
    73 
    73 
    79     bidirGraph(G);
    79     bidirGraph(G);
    80     checkBidirPetersen(G, num);
    80     checkBidirPetersen(G, num);
    81   }
    81   }
    82 
    82 
    83   ///\file
    83   ///\file
    84   ///\todo Check head(), tail() as well;
    84   ///\todo Check target(), source() as well;
    85 
    85 
    86   
    86   
    87 } //namespace lemon
    87 } //namespace lemon
    88 
    88 
    89 
    89