deba@937: /* -*- C++ -*- deba@937: * src/test/sym_graph_test.cc - Part of LEMON, a generic C++ optimization library deba@937: * alpar@1164: * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport alpar@1359: * (Egervary Research Group on Combinatorial Optimization, EGRES). deba@937: * deba@937: * Permission to use, modify and distribute this software is granted deba@937: * provided that this copyright notice appears in all copies. For deba@937: * precise terms see the accompanying LICENSE file. deba@937: * deba@937: * This software is provided "AS IS" with no warranty of any kind, deba@937: * express or implied, and with no claim as to its suitability for any deba@937: * purpose. deba@937: * deba@937: */ deba@937: deba@937: #include deba@937: klao@959: #include deba@937: deba@937: #include deba@937: #include deba@937: #include deba@937: deba@937: #include"test_tools.h" deba@937: #include"graph_test.h" deba@937: #include"sym_graph_test.h" deba@937: deba@937: /** deba@937: \file deba@937: This test makes consistency checks of list graph structures. deba@937: alpar@986: G.addNode(), G.addEdge(), G.source(), G.target() deba@937: deba@937: \todo Checks for empty graphs and isolated points. deba@937: conversion. deba@937: */ deba@937: deba@937: using namespace lemon; deba@937: deba@937: template void checkPetersen(Graph &G) deba@937: { deba@937: typedef typename Graph::NodeIt NodeIt; deba@937: deba@937: deba@937: checkGraphNodeList(G,10); deba@937: checkGraphEdgeList(G,30); deba@937: checkGraphSymEdgeList(G,15); deba@937: deba@937: for(NodeIt n(G);n!=INVALID;++n) { deba@937: checkGraphInEdgeList(G,n,3); deba@937: checkGraphOutEdgeList(G,n,3); deba@937: } deba@937: } deba@937: deba@937: //Compile Graph klao@959: template void lemon::checkCompileStaticSymGraph klao@959: (concept::StaticSymGraph &); deba@937: klao@959: template void lemon::checkCompileSymGraph klao@959: (concept::ExtendableSymGraph &); deba@937: klao@959: template void lemon::checkCompileErasableSymGraph klao@959: (concept::ErasableSymGraph &); deba@937: deba@937: deba@937: //Compile SymSmartGraph deba@937: template void lemon::checkCompileSymGraph(SymSmartGraph &); alpar@938: template klao@959: void lemon::concept::checkCompileGraphFindEdge(SymSmartGraph &); deba@937: deba@937: //Compile SymListGraph deba@937: template void lemon::checkCompileSymGraph(SymListGraph &); deba@937: template void lemon::checkCompileErasableSymGraph(SymListGraph &); alpar@938: template klao@959: void lemon::concept::checkCompileGraphFindEdge(SymListGraph &); deba@937: deba@937: int main() deba@937: { deba@937: { deba@937: SymSmartGraph G; deba@937: addSymPetersen(G); deba@937: checkPetersen(G); deba@937: } deba@937: { deba@937: SymListGraph G; deba@937: addSymPetersen(G); deba@937: checkPetersen(G); deba@937: } deba@937: deba@937: ///\file deba@937: ///\todo map tests. deba@937: ///\todo copy constr tests. deba@937: deba@937: std::cout << __FILE__ ": All tests passed.\n"; deba@937: deba@937: return 0; deba@937: }