diff -r 60a96465dc49 -r d4e911acef3d src/test/sym_graph_test.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/test/sym_graph_test.cc Mon Oct 04 17:13:21 2004 +0000 @@ -0,0 +1,96 @@ +/* -*- C++ -*- + * src/test/sym_graph_test.cc - Part of LEMON, a generic C++ optimization library + * + * Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport + * (Egervary Combinatorial Optimization Research Group, EGRES). + * + * Permission to use, modify and distribute this software is granted + * provided that this copyright notice appears in all copies. For + * precise terms see the accompanying LICENSE file. + * + * This software is provided "AS IS" with no warranty of any kind, + * express or implied, and with no claim as to its suitability for any + * purpose. + * + */ + +#include + +#include + +#include +#include +#include + +#include"test_tools.h" +#include"graph_test.h" +#include"sym_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 lemon; + +template void checkPetersen(Graph &G) +{ + typedef typename Graph::NodeIt NodeIt; + + + checkGraphNodeList(G,10); + checkGraphEdgeList(G,30); + checkGraphSymEdgeList(G,15); + + for(NodeIt n(G);n!=INVALID;++n) { + checkGraphInEdgeList(G,n,3); + checkGraphOutEdgeList(G,n,3); + } +} + +//Compile Graph +template void lemon::checkCompileStaticSymGraph +(skeleton::StaticSymGraph &); + +template void lemon::checkCompileSymGraph +(skeleton::ExtendableSymGraph &); + +template void lemon::checkCompileErasableSymGraph +(skeleton::ErasableSymGraph &); + + +//Compile SymSmartGraph +template void lemon::checkCompileSymGraph(SymSmartGraph &); +template void lemon::checkCompileGraphFindEdge(SymSmartGraph &); + +//Compile SymListGraph +template void lemon::checkCompileSymGraph(SymListGraph &); +template void lemon::checkCompileErasableSymGraph(SymListGraph &); +template void lemon::checkCompileGraphFindEdge(SymListGraph &); + +int main() +{ + { + SymSmartGraph G; + addSymPetersen(G); + checkPetersen(G); + } + { + SymListGraph G; + addSymPetersen(G); + checkPetersen(G); + } + + ///\file + ///\todo map tests. + ///\todo copy constr tests. + + std::cout << __FILE__ ": All tests passed.\n"; + + return 0; +}