# HG changeset patch # User marci # Date 1095157406 0 # Node ID 54d3c1599d08e0f6b6e62f8b5e7f2a49ee5ba2bf # Parent cc3867a7d380cd43697a85c9445d60d504e9f819 diff -r cc3867a7d380 -r 54d3c1599d08 src/test/graph_wrapper_test.cc --- a/src/test/graph_wrapper_test.cc Tue Sep 14 10:09:24 2004 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,138 +0,0 @@ -#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; -} diff -r cc3867a7d380 -r 54d3c1599d08 src/work/marci/graph_wrapper_test.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/work/marci/graph_wrapper_test.cc Tue Sep 14 10:23:26 2004 +0000 @@ -0,0 +1,138 @@ +#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; +}