src/test/graph_wrapper_test.cc
changeset 946 c94ef40a22ce
parent 938 70e2886211d5
child 959 c80ef5912903
     1.1 --- a/src/test/graph_wrapper_test.cc	Mon Oct 25 13:29:46 2004 +0000
     1.2 +++ b/src/test/graph_wrapper_test.cc	Wed Oct 27 22:38:50 2004 +0000
     1.3 @@ -15,8 +15,11 @@
     1.4   */
     1.5  
     1.6  #include<iostream>
     1.7 +#include<lemon/concept_check.h>
     1.8 +
     1.9  #include<lemon/smart_graph.h>
    1.10  #include<lemon/skeletons/graph.h>
    1.11 +
    1.12  #include<lemon/list_graph.h>
    1.13  #include<lemon/full_graph.h>
    1.14  #include<lemon/graph_wrapper.h>
    1.15 @@ -32,66 +35,31 @@
    1.16  */
    1.17  
    1.18  using namespace lemon;
    1.19 +using namespace lemon::skeleton;
    1.20  
    1.21  
    1.22  typedef SmartGraph Graph;
    1.23  
    1.24 -//Compile GraphWrapper
    1.25 -typedef GraphWrapper<Graph> GW;
    1.26 -template void lemon::skeleton::checkCompileStaticGraph<GW>(GW &);
    1.27 -
    1.28 -//Compile RevGraphWrapper
    1.29 -typedef RevGraphWrapper<Graph> RevGW;
    1.30 -template void lemon::skeleton::checkCompileStaticGraph<RevGW>(RevGW &);
    1.31 -
    1.32 -//Compile SubGraphWrapper
    1.33 -typedef SubGraphWrapper<Graph, Graph::NodeMap<bool>, 
    1.34 -			Graph::EdgeMap<bool> > SubGW;
    1.35 -template void lemon::skeleton::checkCompileStaticGraph<SubGW>(SubGW &);
    1.36 -
    1.37 -//Compile NodeSubGraphWrapper
    1.38 -typedef NodeSubGraphWrapper<Graph, Graph::NodeMap<bool> > NodeSubGW;
    1.39 -template void lemon::skeleton::checkCompileStaticGraph<NodeSubGW>(NodeSubGW &);
    1.40 -
    1.41 -//Compile EdgeSubGraphWrapper
    1.42 -typedef EdgeSubGraphWrapper<Graph, Graph::EdgeMap<bool> > EdgeSubGW;
    1.43 -template void lemon::skeleton::checkCompileStaticGraph<EdgeSubGW>(EdgeSubGW &);
    1.44 -
    1.45 -//Compile UndirGraphWrapper
    1.46 -/// \bug UndirGraphWrapper cannot pass the StaticGraph test
    1.47 -//typedef UndirGraphWrapper<Graph> UndirGW;
    1.48 -//template void checkCompileStaticGraph<UndirGW>(UndirGW &);
    1.49 -
    1.50 -//Compile UndirGraph
    1.51 -//typedef UndirGraph<Graph> UndirG;
    1.52 -//template void checkCompileStaticGraph<UndirG>(UndirG &);
    1.53 -
    1.54 -//Compile SubBidirGraphWrapper
    1.55 -typedef SubBidirGraphWrapper<Graph, Graph::EdgeMap<bool>, 
    1.56 -			     Graph::EdgeMap<bool> > SubBDGW;
    1.57 -template void lemon::skeleton::checkCompileStaticGraph<SubBDGW>(SubBDGW &);
    1.58 -
    1.59 -//Compile BidirGraphWrapper
    1.60 -typedef BidirGraphWrapper<Graph> BidirGW;
    1.61 -template void lemon::skeleton::checkCompileStaticGraph<BidirGW>(BidirGW &);
    1.62 -
    1.63 -//Compile BidirGraph
    1.64 -typedef BidirGraph<Graph> BidirG;
    1.65 -template void lemon::skeleton::checkCompileStaticGraph<BidirG>(BidirG &);
    1.66 -
    1.67 -//Compile ResGraphWrapper
    1.68 -typedef ResGraphWrapper<Graph, int, Graph::EdgeMap<int>, 
    1.69 -			Graph::EdgeMap<int> > ResGW;
    1.70 -template void lemon::skeleton::checkCompileStaticGraph<ResGW>(ResGW &);
    1.71 -
    1.72 -//Compile ErasingFirstGraphWrapper
    1.73 -typedef ErasingFirstGraphWrapper<Graph, Graph::NodeMap<Graph::Edge> > ErasingFirstGW;
    1.74 -template
    1.75 -void lemon::skeleton::checkCompileStaticGraph<ErasingFirstGW>(ErasingFirstGW &);
    1.76 -
    1.77  
    1.78  int main() 
    1.79  {
    1.80 +  {
    1.81 +    function_requires<StaticGraphConcept<GraphWrapper<Graph> > >();
    1.82 +
    1.83 +    function_requires<StaticGraphConcept<RevGraphWrapper<Graph> > >();
    1.84 +
    1.85 +    function_requires<StaticGraphConcept<SubGraphWrapper<Graph, Graph::NodeMap<bool> , Graph::EdgeMap<bool> > > >();
    1.86 +    function_requires<StaticGraphConcept<NodeSubGraphWrapper<Graph, Graph::NodeMap<bool> > > >();
    1.87 +    function_requires<StaticGraphConcept<EdgeSubGraphWrapper<Graph, Graph::EdgeMap<bool> > > >();
    1.88 +
    1.89 +    function_requires<StaticGraphConcept<SubBidirGraphWrapper<Graph, Graph::EdgeMap<bool>, Graph::EdgeMap<bool> > > > ();
    1.90 +
    1.91 +    function_requires<StaticGraphConcept<BidirGraph<Graph> > >();
    1.92 +
    1.93 +    function_requires<StaticGraphConcept<ResGraphWrapper<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > > >();
    1.94 +
    1.95 +    function_requires<StaticGraphConcept<ErasingFirstGraphWrapper<Graph, Graph::NodeMap<Graph::Edge> > > >();
    1.96 +  }
    1.97    std::cout << __FILE__ ": All tests passed.\n";
    1.98  
    1.99    return 0;