src/test/graph_adaptor_test.cc
changeset 1401 9588dcef6793
parent 1383 79b68a337f9f
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/test/graph_adaptor_test.cc	Wed May 04 13:07:10 2005 +0000
     1.3 @@ -0,0 +1,75 @@
     1.4 +/* -*- C++ -*-
     1.5 + * src/test/graph_adaptor_test.cc - Part of LEMON, a generic C++ optimization library
     1.6 + *
     1.7 + * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     1.8 + * (Egervary Research Group on Combinatorial Optimization, EGRES).
     1.9 + *
    1.10 + * Permission to use, modify and distribute this software is granted
    1.11 + * provided that this copyright notice appears in all copies. For
    1.12 + * precise terms see the accompanying LICENSE file.
    1.13 + *
    1.14 + * This software is provided "AS IS" with no warranty of any kind,
    1.15 + * express or implied, and with no claim as to its suitability for any
    1.16 + * purpose.
    1.17 + *
    1.18 + */
    1.19 +
    1.20 +#include<iostream>
    1.21 +#include<lemon/concept_check.h>
    1.22 +
    1.23 +#include<lemon/smart_graph.h>
    1.24 +#include<lemon/concept/graph.h>
    1.25 +#include<lemon/concept/undir_graph.h>
    1.26 +
    1.27 +#include<lemon/list_graph.h>
    1.28 +#include<lemon/full_graph.h>
    1.29 +#include<lemon/graph_adaptor.h>
    1.30 +
    1.31 +#include"test/test_tools.h"
    1.32 +#include"test/graph_test.h"
    1.33 +
    1.34 +/**
    1.35 +\file
    1.36 +This test makes consistency checks of graph adaptors.
    1.37 +
    1.38 +\todo More extensive tests are needed 
    1.39 +*/
    1.40 +
    1.41 +using namespace lemon;
    1.42 +using namespace lemon::concept;
    1.43 +
    1.44 +
    1.45 +
    1.46 +int main() 
    1.47 +{
    1.48 +  {
    1.49 +    typedef StaticGraph Graph;
    1.50 +    checkConcept<StaticGraph, GraphAdaptor<Graph> >();
    1.51 +
    1.52 +    checkConcept<StaticGraph, RevGraphAdaptor<Graph> >();
    1.53 +
    1.54 +    checkConcept<StaticGraph, SubGraphAdaptor<Graph, 
    1.55 +      Graph::NodeMap<bool> , Graph::EdgeMap<bool> > >();
    1.56 +    checkConcept<StaticGraph, NodeSubGraphAdaptor<Graph, 
    1.57 +      Graph::NodeMap<bool> > >();
    1.58 +    checkConcept<StaticGraph, EdgeSubGraphAdaptor<Graph, 
    1.59 +      Graph::EdgeMap<bool> > >();
    1.60 +    
    1.61 +    checkConcept<StaticGraph, SubBidirGraphAdaptor<Graph, 
    1.62 +      Graph::EdgeMap<bool>, Graph::EdgeMap<bool> > >();
    1.63 +    //    checkConcept<StaticGraph, BidirGraph<Graph> >();
    1.64 +    checkConcept<StaticGraph, ResGraphAdaptor<Graph, int, 
    1.65 +      Graph::EdgeMap<int>, Graph::EdgeMap<int> > >();
    1.66 +
    1.67 +    checkConcept<StaticGraph, ErasingFirstGraphAdaptor<Graph, 
    1.68 +      Graph::NodeMap<Graph::Edge> > >(); 
    1.69 +
    1.70 +    /// \bug why does not compile with StaticGraph
    1.71 +    checkConcept<BaseIterableUndirGraphConcept, UndirGraphAdaptor<ListGraph> >();
    1.72 +    checkConcept<IterableUndirGraphConcept, UndirGraphAdaptor<ListGraph> >();
    1.73 +    checkConcept<MappableUndirGraphConcept, UndirGraphAdaptor<ListGraph> >();
    1.74 +  }
    1.75 +  std::cout << __FILE__ ": All tests passed.\n";
    1.76 +
    1.77 +  return 0;
    1.78 +}