src/test/dfs_test.cc
changeset 1086 caa13d291528
parent 959 c80ef5912903
child 1164 80bb73097736
equal deleted inserted replaced
5:40bc4cccbb45 6:fdc0f0fc9635
    81   
    81   
    82   for(NodeIt v(G); v!=INVALID; ++v) {
    82   for(NodeIt v(G); v!=INVALID; ++v) {
    83     check(dfs_test.reached(v),"Each node should be reached.");
    83     check(dfs_test.reached(v),"Each node should be reached.");
    84     if ( dfs_test.pred(v)!=INVALID ) {
    84     if ( dfs_test.pred(v)!=INVALID ) {
    85       Edge e=dfs_test.pred(v);
    85       Edge e=dfs_test.pred(v);
    86       Node u=G.tail(e);
    86       Node u=G.source(e);
    87       check(u==dfs_test.predNode(v),"Wrong tree.");
    87       check(u==dfs_test.predNode(v),"Wrong tree.");
    88       check(dfs_test.dist(v) - dfs_test.dist(u) == 1,
    88       check(dfs_test.dist(v) - dfs_test.dist(u) == 1,
    89 	    "Wrong distance." << dfs_test.dist(v) << " " <<dfs_test.dist(u) );
    89 	    "Wrong distance." << dfs_test.dist(v) << " " <<dfs_test.dist(u) );
    90     }
    90     }
    91   }
    91   }