test/graph_adaptor_test.cc
author deba
Fri, 12 May 2006 09:52:28 +0000
changeset 2077 d687c0033bb5
parent 1980 a954b780e3ab
child 2111 ea1fa1bc3f6d
permissions -rw-r--r--
Two state Variant
+ Some Compile Time arithmetic
alpar@906
     1
/* -*- C++ -*-
alpar@906
     2
 *
alpar@1956
     3
 * This file is a part of LEMON, a generic C++ optimization library
alpar@1956
     4
 *
alpar@1956
     5
 * Copyright (C) 2003-2006
alpar@1956
     6
 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
alpar@1359
     7
 * (Egervary Research Group on Combinatorial Optimization, EGRES).
alpar@906
     8
 *
alpar@906
     9
 * Permission to use, modify and distribute this software is granted
alpar@906
    10
 * provided that this copyright notice appears in all copies. For
alpar@906
    11
 * precise terms see the accompanying LICENSE file.
alpar@906
    12
 *
alpar@906
    13
 * This software is provided "AS IS" with no warranty of any kind,
alpar@906
    14
 * express or implied, and with no claim as to its suitability for any
alpar@906
    15
 * purpose.
alpar@906
    16
 *
alpar@906
    17
 */
alpar@906
    18
marci@849
    19
#include<iostream>
klao@946
    20
#include<lemon/concept_check.h>
klao@946
    21
alpar@921
    22
#include<lemon/smart_graph.h>
klao@959
    23
#include<lemon/concept/graph.h>
klao@1909
    24
#include<lemon/concept/ugraph.h>
klao@946
    25
alpar@921
    26
#include<lemon/list_graph.h>
alpar@921
    27
#include<lemon/full_graph.h>
alpar@1401
    28
#include<lemon/graph_adaptor.h>
deba@1980
    29
#include<lemon/ugraph_adaptor.h>
marci@849
    30
marci@870
    31
#include"test/test_tools.h"
marci@870
    32
#include"test/graph_test.h"
marci@849
    33
marci@849
    34
/**
marci@849
    35
\file
alpar@1401
    36
This test makes consistency checks of graph adaptors.
marci@849
    37
alpar@878
    38
\todo More extensive tests are needed 
marci@849
    39
*/
marci@849
    40
alpar@921
    41
using namespace lemon;
klao@959
    42
using namespace lemon::concept;
marci@849
    43
marci@849
    44
marci@849
    45
marci@849
    46
int main() 
marci@849
    47
{
klao@946
    48
  {
marci@998
    49
    typedef StaticGraph Graph;
alpar@1401
    50
    checkConcept<StaticGraph, GraphAdaptor<Graph> >();
klao@946
    51
alpar@1401
    52
    checkConcept<StaticGraph, RevGraphAdaptor<Graph> >();
klao@946
    53
alpar@1401
    54
    checkConcept<StaticGraph, SubGraphAdaptor<Graph, 
marci@998
    55
      Graph::NodeMap<bool> , Graph::EdgeMap<bool> > >();
alpar@1401
    56
    checkConcept<StaticGraph, NodeSubGraphAdaptor<Graph, 
marci@998
    57
      Graph::NodeMap<bool> > >();
alpar@1401
    58
    checkConcept<StaticGraph, EdgeSubGraphAdaptor<Graph, 
marci@998
    59
      Graph::EdgeMap<bool> > >();
marci@992
    60
    
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
deba@1980
    67
    checkConcept<UGraph, UndirGraphAdaptor<Graph> >();
deba@1980
    68
deba@1980
    69
    checkConcept<UGraph, SubUGraphAdaptor<UGraph, 
deba@1980
    70
      UGraph::NodeMap<bool> , UGraph::UEdgeMap<bool> > >();
deba@1980
    71
    checkConcept<UGraph, NodeSubUGraphAdaptor<UGraph, 
deba@1980
    72
      UGraph::NodeMap<bool> > >();
deba@1980
    73
    checkConcept<UGraph, EdgeSubUGraphAdaptor<UGraph, 
deba@1980
    74
      UGraph::UEdgeMap<bool> > >();
deba@1980
    75
deba@1980
    76
    checkConcept<StaticGraph, DirUGraphAdaptor<UGraph, 
deba@1980
    77
      UGraph::UEdgeMap<bool> > >();
klao@946
    78
  }
marci@849
    79
  std::cout << __FILE__ ": All tests passed.\n";
marci@849
    80
marci@849
    81
  return 0;
marci@849
    82
}