test/bellman_ford_test.cc
changeset 1160 00f8d9f9920d
parent 960 b89e46862dc2
child 1174 a26b90a17c81
equal deleted inserted replaced
8:d300e1be4987 9:934ee8a5088c
   188   check(checkPath(gr, p), "path() found a wrong path.");
   188   check(checkPath(gr, p), "path() found a wrong path.");
   189   check(pathSource(gr, p) == s, "path() found a wrong path.");
   189   check(pathSource(gr, p) == s, "path() found a wrong path.");
   190   check(pathTarget(gr, p) == t, "path() found a wrong path.");
   190   check(pathTarget(gr, p) == t, "path() found a wrong path.");
   191 
   191 
   192   ListPath<Digraph> path;
   192   ListPath<Digraph> path;
   193   Value dist;
   193   Value dist = 0;
   194   bool reached = bellmanFord(gr,length).path(path).dist(dist).run(s,t);
   194   bool reached = bellmanFord(gr,length).path(path).dist(dist).run(s,t);
   195 
   195 
   196   check(reached && dist == -1, "Bellman-Ford found a wrong path.");
   196   check(reached && dist == -1, "Bellman-Ford found a wrong path.");
   197   check(path.length() == 3, "path() found a wrong path.");
   197   check(path.length() == 3, "path() found a wrong path.");
   198   check(checkPath(gr, path), "path() found a wrong path.");
   198   check(checkPath(gr, path), "path() found a wrong path.");