Index: src/test/graph_test.cc
===================================================================
--- src/test/graph_test.cc	(revision 938)
+++ src/test/graph_test.cc	(revision 946)
@@ -1,156 +1,66 @@
-/* -*- 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<iostream>
-#include<lemon/smart_graph.h>
-#include<lemon/skeletons/graph.h>
-#include<lemon/list_graph.h>
-#include<lemon/full_graph.h>
+#include <iostream>
+#include <vector>
 
-#include"test_tools.h"
-#include"graph_test.h"
+#include <lemon/skeletons/graph.h>
+#include <lemon/list_graph.h>
+#include <lemon/smart_graph.h>
+#include <lemon/full_graph.h>
 
-/**
-\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;
-
-template<class Graph> void bidirPetersen(Graph &G)
-{
-  typedef typename Graph::Edge Edge;
-  typedef typename Graph::EdgeIt EdgeIt;
-  
-  checkGraphEdgeList(G,15);
-  
-  std::vector<Edge> ee;
-  
-  for(EdgeIt e(G);e!=INVALID;++e) ee.push_back(e);
-
-  for(typename std::vector<Edge>::iterator p=ee.begin();p!=ee.end();p++)
-    G.addEdge(G.head(*p),G.tail(*p));
-}
-
-template<class Graph> 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);
-  }  
-}
-
-//Compile Graph
-template void lemon::skeleton::checkCompileStaticGraph<skeleton::StaticGraph>
-(skeleton::StaticGraph &);
-
-template
-void lemon::skeleton::checkCompileExtendableGraph<skeleton::ExtendableGraph>
-(skeleton::ExtendableGraph &);
-
-template
-void lemon::skeleton::checkCompileErasableGraph<skeleton::ErasableGraph>
-(skeleton::ErasableGraph &);
-
-//Compile SmartGraph
-template
-void lemon::skeleton::checkCompileExtendableGraph<SmartGraph>(SmartGraph &);
-template
-void lemon::skeleton::checkCompileGraphFindEdge<SmartGraph>(SmartGraph &);
-
-//Compile SymSmartGraph
-//template void hugo::checkCompileGraph<SymSmartGraph>(SymSmartGraph &);
-//template void hugo::checkCompileGraphFindEdge<SymSmartGraph>(SymSmartGraph &);
-
-//Compile ListGraph
-template
-void lemon::skeleton::checkCompileExtendableGraph<ListGraph>(ListGraph &);
-template
-void lemon::skeleton::checkCompileErasableGraph<ListGraph>(ListGraph &);
-template
-void lemon::skeleton::checkCompileGraphFindEdge<ListGraph>(ListGraph &);
+using namespace lemon::skeleton;
 
 
-//Compile SymListGraph
-//template void hugo::checkCompileGraph<SymListGraph>(SymListGraph &);
-//template void hugo::checkCompileErasableGraph<SymListGraph>(SymListGraph &);
-//template void hugo::checkCompileGraphFindEdge<SymListGraph>(SymListGraph &);
+int main() {
+  ///\file
+  { // checking graph components
+    function_requires<BaseGraphComponentConcept<BaseGraphComponent> >();
 
-//Compile FullGraph
-template void lemon::skeleton::checkCompileStaticGraph<FullGraph>(FullGraph &);
-template
-void lemon::skeleton::checkCompileGraphFindEdge<FullGraph>(FullGraph &);
+    function_requires<BaseIterableGraphComponentConcept<BaseIterableGraphComponent> >();
 
-//Compile EdgeSet <ListGraph>
-template void lemon::skeleton::checkCompileExtendableGraph<EdgeSet <ListGraph> >
-(EdgeSet <ListGraph> &);
-template void lemon::skeleton::checkCompileGraphEraseEdge<EdgeSet <ListGraph> >
-(EdgeSet <ListGraph> &);
-template void lemon::skeleton::checkCompileGraphFindEdge<EdgeSet <ListGraph> >
-(EdgeSet <ListGraph> &);
+    function_requires<IDableGraphComponentConcept<IDableGraphComponent> >();
+    function_requires<MaxIDableGraphComponentConcept<MaxIDableGraphComponent> >();
 
-//Compile EdgeSet <NodeSet>
-template void lemon::skeleton::checkCompileExtendableGraph<EdgeSet <NodeSet> >
-(EdgeSet <NodeSet> &);
-template void lemon::skeleton::checkCompileGraphEraseEdge<EdgeSet <NodeSet> >
-(EdgeSet <NodeSet> &);
-template void lemon::skeleton::checkCompileGraphFindEdge<EdgeSet <NodeSet> >
-(EdgeSet <NodeSet> &);
+    function_requires<BaseExtendableGraphComponentConcept<BaseExtendableGraphComponent> >();
+    function_requires<BaseErasableGraphComponentConcept<BaseErasableGraphComponent> >();
+    function_requires<BaseClearableGraphComponentConcept<BaseClearableGraphComponent> >();
 
+    function_requires<IterableGraphComponentConcept<IterableGraphComponent> >();
 
-int main() 
-{
-  {
-    SmartGraph G;
-    addPetersen(G);
-    bidirPetersen(G);
-    checkPetersen(G);
+    function_requires<IdMappableGraphComponentConcept<IdMappableGraphComponent> >();
+    function_requires<MappableGraphComponentConcept<MappableGraphComponent> >();
+
+    function_requires<ExtendableGraphComponentConcept<ExtendableGraphComponent> >();
+    function_requires<ErasableGraphComponentConcept<ErasableGraphComponent> >();
+    function_requires<ClearableGraphComponentConcept<ClearableGraphComponent> >();
   }
-  {
-    ListGraph G;
-    addPetersen(G);
-    bidirPetersen(G);
-    checkPetersen(G);
+  { // checking skeleton graphs
+    function_requires<StaticGraphConcept<StaticGraph> >();
+    function_requires<ExtendableGraphConcept<ExtendableGraph> >();
+    function_requires<ErasableGraphConcept<ErasableGraph> >();
   }
-  {
-    //    SymSmartGraph G;
-    //    addPetersen(G);
-    //    checkPetersen(G);
+  { // checking list graph
+    function_requires<ErasableGraphConcept<ListGraph> >();
+
+    checkGraph<ListGraph>();
+    checkGraphNodeMap<ListGraph>();
+    checkGraphEdgeMap<ListGraph>();
   }
-  {
-    //    SymListGraph G;
-    //    addPetersen(G);
-    //    checkPetersen(G);
+  { // checking smart graph
+    function_requires<ExtendableGraphConcept<SmartGraph> >();
+
+    checkGraph<SmartGraph>();
+    checkGraphNodeMap<SmartGraph>();
+    checkGraphEdgeMap<SmartGraph>();
   }
-
-  ///\file
-  ///\todo map tests.
-  ///\todo copy constr tests.
+  { // checking full graph
+    function_requires<StaticGraphConcept<FullGraph> >();
+  }
 
   std::cout << __FILE__ ": All tests passed.\n";
