src/test/dijkstra_test.cc
changeset 780 e06d0d16595f
parent 776 f2994a2b10b2
child 793 9cd0aeea47b0
     1.1 --- a/src/test/dijkstra_test.cc	Wed Sep 01 09:04:07 2004 +0000
     1.2 +++ b/src/test/dijkstra_test.cc	Wed Sep 01 15:08:41 2004 +0000
     1.3 @@ -86,13 +86,17 @@
     1.4    }
     1.5  
     1.6    ///\bug This works only for integer lengths
     1.7 -  for(NodeIt v(G); v!=INVALID; ++v)
     1.8 -    if ( dijkstra_test.reached(v) ) {
     1.9 +  for(NodeIt v(G); v!=INVALID; ++v){
    1.10 +    check(dijkstra_test.reached(v),"Each node should be reached.");
    1.11 +    if ( dijkstra_test.pred(v)!=INVALID ) {
    1.12        Edge e=dijkstra_test.pred(v);
    1.13        Node u=G.tail(e);
    1.14 +      check(u==dijkstra_test.predNode(v),"Wrong tree.");
    1.15        check(dijkstra_test.dist(v) - dijkstra_test.dist(u) == cap[e],
    1.16 -	    "Bad shortest path tree edge! Difference: " 
    1.17 +	    "Wrong distance! Difference: " 
    1.18  	    << std::abs(dijkstra_test.dist(v) - dijkstra_test.dist(u) 
    1.19  			    - cap[e]));
    1.20      }
    1.21 +  }
    1.22  }
    1.23 +