test/graph_adaptor_test.cc
author deba
Mon, 03 Oct 2005 10:16:45 +0000
changeset 1696 4e03a355d2ea
parent 1401 9588dcef6793
child 1875 98698b69a902
permissions -rw-r--r--
CompileTimeAnd
Used by SplitGraphAdaptor
alpar@906
     1
/* -*- C++ -*-
ladanyi@1435
     2
 * test/graph_adaptor_test.cc - Part of LEMON, a generic C++ optimization library
alpar@906
     3
 *
alpar@1164
     4
 * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
alpar@1359
     5
 * (Egervary Research Group on Combinatorial Optimization, EGRES).
alpar@906
     6
 *
alpar@906
     7
 * Permission to use, modify and distribute this software is granted
alpar@906
     8
 * provided that this copyright notice appears in all copies. For
alpar@906
     9
 * precise terms see the accompanying LICENSE file.
alpar@906
    10
 *
alpar@906
    11
 * This software is provided "AS IS" with no warranty of any kind,
alpar@906
    12
 * express or implied, and with no claim as to its suitability for any
alpar@906
    13
 * purpose.
alpar@906
    14
 *
alpar@906
    15
 */
alpar@906
    16
marci@849
    17
#include<iostream>
klao@946
    18
#include<lemon/concept_check.h>
klao@946
    19
alpar@921
    20
#include<lemon/smart_graph.h>
klao@959
    21
#include<lemon/concept/graph.h>
marci@1383
    22
#include<lemon/concept/undir_graph.h>
klao@946
    23
alpar@921
    24
#include<lemon/list_graph.h>
alpar@921
    25
#include<lemon/full_graph.h>
alpar@1401
    26
#include<lemon/graph_adaptor.h>
marci@849
    27
marci@870
    28
#include"test/test_tools.h"
marci@870
    29
#include"test/graph_test.h"
marci@849
    30
marci@849
    31
/**
marci@849
    32
\file
alpar@1401
    33
This test makes consistency checks of graph adaptors.
marci@849
    34
alpar@878
    35
\todo More extensive tests are needed 
marci@849
    36
*/
marci@849
    37
alpar@921
    38
using namespace lemon;
klao@959
    39
using namespace lemon::concept;
marci@849
    40
marci@849
    41
marci@849
    42
marci@849
    43
int main() 
marci@849
    44
{
klao@946
    45
  {
marci@998
    46
    typedef StaticGraph Graph;
alpar@1401
    47
    checkConcept<StaticGraph, GraphAdaptor<Graph> >();
klao@946
    48
alpar@1401
    49
    checkConcept<StaticGraph, RevGraphAdaptor<Graph> >();
klao@946
    50
alpar@1401
    51
    checkConcept<StaticGraph, SubGraphAdaptor<Graph, 
marci@998
    52
      Graph::NodeMap<bool> , Graph::EdgeMap<bool> > >();
alpar@1401
    53
    checkConcept<StaticGraph, NodeSubGraphAdaptor<Graph, 
marci@998
    54
      Graph::NodeMap<bool> > >();
alpar@1401
    55
    checkConcept<StaticGraph, EdgeSubGraphAdaptor<Graph, 
marci@998
    56
      Graph::EdgeMap<bool> > >();
marci@992
    57
    
alpar@1401
    58
    checkConcept<StaticGraph, SubBidirGraphAdaptor<Graph, 
marci@998
    59
      Graph::EdgeMap<bool>, Graph::EdgeMap<bool> > >();
alpar@1160
    60
    //    checkConcept<StaticGraph, BidirGraph<Graph> >();
alpar@1401
    61
    checkConcept<StaticGraph, ResGraphAdaptor<Graph, int, 
marci@998
    62
      Graph::EdgeMap<int>, Graph::EdgeMap<int> > >();
klao@946
    63
alpar@1401
    64
    checkConcept<StaticGraph, ErasingFirstGraphAdaptor<Graph, 
marci@998
    65
      Graph::NodeMap<Graph::Edge> > >(); 
marci@1383
    66
marci@1383
    67
    /// \bug why does not compile with StaticGraph
alpar@1401
    68
    checkConcept<BaseIterableUndirGraphConcept, UndirGraphAdaptor<ListGraph> >();
alpar@1401
    69
    checkConcept<IterableUndirGraphConcept, UndirGraphAdaptor<ListGraph> >();
alpar@1401
    70
    checkConcept<MappableUndirGraphConcept, UndirGraphAdaptor<ListGraph> >();
klao@946
    71
  }
marci@849
    72
  std::cout << __FILE__ ": All tests passed.\n";
marci@849
    73
marci@849
    74
  return 0;
marci@849
    75
}