#include #include #include #include #include #include #include"test_tools.h" #include"graph_test.h" /** \file This test makes consistency checks of list graph structures. G.addNode(), G.addEdge(), G.tail(), G.head() \todo Checks for empty graphs and isolated points. conversion. */ using namespace hugo; template void bidirPetersen(Graph &G) { typedef typename Graph::Edge Edge; typedef typename Graph::EdgeIt EdgeIt; checkGraphEdgeList(G,15); std::vector ee; for(EdgeIt e(G);e!=INVALID;++e) ee.push_back(e); for(typename std::vector::iterator p=ee.begin();p!=ee.end();p++) G.addEdge(G.head(*p),G.tail(*p)); } template void checkPetersen(Graph &G) { typedef typename Graph::Node Node; typedef typename Graph::EdgeIt EdgeIt; typedef typename Graph::NodeIt NodeIt; checkGraphNodeList(G,10); checkGraphEdgeList(G,30); for(NodeIt n(G);n!=INVALID;++n) { checkGraphInEdgeList(G,n,3); checkGraphOutEdgeList(G,n,3); ++n; } } //Compile GraphSkeleton template void checkCompileStaticGraph (skeleton::StaticGraphSkeleton &); template void checkCompileGraph (skeleton::GraphSkeleton &); template void checkCompileErasableGraph (skeleton::ErasableGraphSkeleton &); //Compile SmartGraph typedef SmartGraph Graph; typedef GraphWrapper GW; template void checkCompileStaticGraph(GW &); //template void checkCompileGraphFindEdge(SmartGraph &); //Compile SymSmartGraph typedef RevGraphWrapper RevGW; template void checkCompileStaticGraph(RevGW &); //template void checkCompileGraphFindEdge(SymSmartGraph &); // //Compile ListGraph // template void checkCompileGraph(ListGraph &); // template void checkCompileErasableGraph(ListGraph &); // template void checkCompileGraphFindEdge(ListGraph &); // //Compile SymListGraph // template void checkCompileGraph(SymListGraph &); // template void checkCompileErasableGraph(SymListGraph &); // template void checkCompileGraphFindEdge(SymListGraph &); // //Compile FullGraph // template void checkCompileStaticGraph(FullGraph &); // template void checkCompileGraphFindEdge(FullGraph &); // //Compile EdgeSet // template void checkCompileGraph >(EdgeSet &); // template void checkCompileGraphEraseEdge > // (EdgeSet &); // template void checkCompileGraphFindEdge > // (EdgeSet &); // //Compile EdgeSet // template void checkCompileGraph >(EdgeSet &); // template void checkCompileGraphEraseEdge > // (EdgeSet &); // template void checkCompileGraphFindEdge > // (EdgeSet &); int main() { // { // SmartGraph G; // addPetersen(G); // bidirPetersen(G); // checkPetersen(G); // } // { // ListGraph G; // addPetersen(G); // bidirPetersen(G); // checkPetersen(G); // } // { // SymSmartGraph G; // addPetersen(G); // checkPetersen(G); // } // { // SymListGraph G; // addPetersen(G); // checkPetersen(G); // } ///\file ///\todo map tests. ///\todo copy constr tests. std::cout << __FILE__ ": All tests passed.\n"; return 0; }