diff -r f2ea4aac9ada -r c94ef40a22ce src/test/graph_test.cc --- a/src/test/graph_test.cc Mon Oct 25 13:29:46 2004 +0000 +++ b/src/test/graph_test.cc Wed Oct 27 22:38:50 2004 +0000 @@ -1,157 +1,67 @@ -/* -*- C++ -*- - * src/test/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. - * - */ +// -*- c++ -*- -#include -#include -#include -#include -#include +#include +#include -#include"test_tools.h" -#include"graph_test.h" +#include +#include +#include +#include -/** -\file -This test makes consistency checks of list graph structures. +#include "test_tools.h" +#include "graph_test.h" +#include "map_test.h" -G.addNode(), G.addEdge(), G.tail(), G.head() - -\todo Checks for empty graphs and isolated points. -conversion. -*/ using namespace lemon; +using namespace lemon::skeleton; -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)); -} +int main() { + ///\file + { // checking graph components + function_requires >(); -template void checkPetersen(Graph &G) -{ - typedef typename Graph::Node Node; + function_requires >(); - typedef typename Graph::EdgeIt EdgeIt; - typedef typename Graph::NodeIt NodeIt; + function_requires >(); + function_requires >(); - checkGraphNodeList(G,10); - checkGraphEdgeList(G,30); + function_requires >(); + function_requires >(); + function_requires >(); - for(NodeIt n(G);n!=INVALID;++n) { - checkGraphInEdgeList(G,n,3); - checkGraphOutEdgeList(G,n,3); - } -} + function_requires >(); -//Compile Graph -template void lemon::skeleton::checkCompileStaticGraph -(skeleton::StaticGraph &); + function_requires >(); + function_requires >(); -template -void lemon::skeleton::checkCompileExtendableGraph -(skeleton::ExtendableGraph &); + function_requires >(); + function_requires >(); + function_requires >(); + } + { // checking skeleton graphs + function_requires >(); + function_requires >(); + function_requires >(); + } + { // checking list graph + function_requires >(); -template -void lemon::skeleton::checkCompileErasableGraph -(skeleton::ErasableGraph &); + checkGraph(); + checkGraphNodeMap(); + checkGraphEdgeMap(); + } + { // checking smart graph + function_requires >(); -//Compile SmartGraph -template -void lemon::skeleton::checkCompileExtendableGraph(SmartGraph &); -template -void lemon::skeleton::checkCompileGraphFindEdge(SmartGraph &); - -//Compile SymSmartGraph -//template void hugo::checkCompileGraph(SymSmartGraph &); -//template void hugo::checkCompileGraphFindEdge(SymSmartGraph &); - -//Compile ListGraph -template -void lemon::skeleton::checkCompileExtendableGraph(ListGraph &); -template -void lemon::skeleton::checkCompileErasableGraph(ListGraph &); -template -void lemon::skeleton::checkCompileGraphFindEdge(ListGraph &); - - -//Compile SymListGraph -//template void hugo::checkCompileGraph(SymListGraph &); -//template void hugo::checkCompileErasableGraph(SymListGraph &); -//template void hugo::checkCompileGraphFindEdge(SymListGraph &); - -//Compile FullGraph -template void lemon::skeleton::checkCompileStaticGraph(FullGraph &); -template -void lemon::skeleton::checkCompileGraphFindEdge(FullGraph &); - -//Compile EdgeSet -template void lemon::skeleton::checkCompileExtendableGraph > -(EdgeSet &); -template void lemon::skeleton::checkCompileGraphEraseEdge > -(EdgeSet &); -template void lemon::skeleton::checkCompileGraphFindEdge > -(EdgeSet &); - -//Compile EdgeSet -template void lemon::skeleton::checkCompileExtendableGraph > -(EdgeSet &); -template void lemon::skeleton::checkCompileGraphEraseEdge > -(EdgeSet &); -template void lemon::skeleton::checkCompileGraphFindEdge > -(EdgeSet &); - - -int main() -{ - { - SmartGraph G; - addPetersen(G); - bidirPetersen(G); - checkPetersen(G); + checkGraph(); + checkGraphNodeMap(); + checkGraphEdgeMap(); } - { - ListGraph G; - addPetersen(G); - bidirPetersen(G); - checkPetersen(G); + { // checking full graph + function_requires >(); } - { - // 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";