diff -r 91fb4372688f -r 02f4d5d9bfd7 test/dfs_test.cc --- a/test/dfs_test.cc Sun Jun 15 22:03:33 2008 +0200 +++ b/test/dfs_test.cc Sun Jun 15 22:05:23 2008 +0200 @@ -16,32 +16,25 @@ * */ -#include "test_tools.h" -// #include +#include +#include #include #include #include -#include + +#include "graph_test.h" +#include "test_tools.h" using namespace lemon; -const int PET_SIZE =5; - - -void check_Dfs_SmartDigraph_Compile() +void checkDfsCompile() { typedef concepts::Digraph Digraph; - - typedef Digraph::Arc Arc; - typedef Digraph::Node Node; - typedef Digraph::ArcIt ArcIt; - typedef Digraph::NodeIt NodeIt; - typedef Dfs DType; Digraph G; - Node n; - Arc e; + Digraph::Node n; + Digraph::Arc e; int l; bool b; DType::DistMap d(G); @@ -63,17 +56,12 @@ Path pp = dfs_test.path(n); } - -void check_Dfs_Function_Compile() +void checkDfsFunctionCompile() { typedef int VType; typedef concepts::Digraph Digraph; - typedef Digraph::Arc Arc; typedef Digraph::Node Node; - typedef Digraph::ArcIt ArcIt; - typedef Digraph::NodeIt NodeIt; - typedef concepts::ReadMap LengthMap; Digraph g; dfs(g,Node()).run(); @@ -83,25 +71,16 @@ .distMap(concepts::WriteMap()) .reachedMap(concepts::ReadWriteMap()) .processedMap(concepts::WriteMap()) - .run(Node()); - + .run(Node()); } -int main() -{ - - // typedef SmartDigraph Digraph; - typedef ListDigraph Digraph; - - typedef Digraph::Arc Arc; - typedef Digraph::Node Node; - typedef Digraph::ArcIt ArcIt; - typedef Digraph::NodeIt NodeIt; - typedef Digraph::ArcMap LengthMap; +template +void checkDfs() { + TEMPLATE_DIGRAPH_TYPEDEFS(Digraph); Digraph G; Node s, t; - PetStruct ps = addPetersen(G,PET_SIZE); + PetStruct ps = addPetersen(G, 5); s=ps.outer[2]; t=ps.inner[0]; @@ -110,7 +89,7 @@ dfs_test.run(s); Path p = dfs_test.path(t); - check(p.length()==dfs_test.dist(t),"path() found a wrong path."); + check(p.length() == dfs_test.dist(t),"path() found a wrong path."); check(checkPath(G, p),"path() found a wrong path."); check(pathSource(G, p) == s,"path() found a wrong path."); check(pathTarget(G, p) == t,"path() found a wrong path."); @@ -128,3 +107,9 @@ } } +int main() +{ + checkDfs(); + checkDfs(); + return 0; +}