# HG changeset patch # User deba # Date 1129883687 0 # Node ID edeee3cbd80c6fe10bee65279cf9f9b1ecfe050f # Parent 616bc933c2bce4b90fe9854b1b41748d8e1bfd0d Bugfix diff -r 616bc933c2bc -r edeee3cbd80c test/all_pairs_shortest_path_test.cc --- a/test/all_pairs_shortest_path_test.cc Thu Oct 20 15:50:23 2005 +0000 +++ b/test/all_pairs_shortest_path_test.cc Fri Oct 21 08:34:47 2005 +0000 @@ -10,6 +10,7 @@ #include #include +#include "test_tools.h" using namespace lemon; using namespace std; @@ -26,7 +27,7 @@ typedef Graph::NodeMap DistMap; const int n = argc > 1 ? atoi(argv[1]) : 20; - const int e = argc > 2 ? atoi(argv[2]) : (int)(n * log(n)); + const int e = argc > 2 ? atoi(argv[2]) : (int)(n * log((double)n)); const double m = argc > 3 ? (double)atoi(argv[3]) : 100.0; Graph graph; @@ -64,16 +65,20 @@ for (NodeIt it(graph); it != INVALID; ++it) { for (NodeIt jt(graph); jt != INVALID; ++jt) { - assert(johnson.connected(it, jt) == floyd.connected(it, jt)); + check(johnson.connected(it, jt) == floyd.connected(it, jt), + "Wrong connection in all pairs shortest path"); if (johnson.connected(it, jt)) { - assert(johnson.dist(it, jt) == floyd.dist(it, jt)); + check(johnson.dist(it, jt) == floyd.dist(it, jt), + "Wrong distance in all pairs shortest path"); if (it != jt) { - assert(johnson.dist(it, jt) == - johnson.dist(it, johnson.predNode(it, jt)) + - length[johnson.pred(it, jt)]); - assert(floyd.dist(it, jt) == - floyd.dist(it, floyd.predNode(it, jt)) + - length[floyd.pred(it, jt)]); + check(johnson.dist(it, jt) == + johnson.dist(it, johnson.predNode(it, jt)) + + length[johnson.pred(it, jt)], + "Wrong edge in all pairs shortest path"); + check(floyd.dist(it, jt) == + floyd.dist(it, floyd.predNode(it, jt)) + + length[floyd.pred(it, jt)], + "Wrong edge in all pairs shortest path"); } } }