test/graph_adaptor_test.cc
author alpar
Mon, 04 Sep 2006 19:12:44 +0000
changeset 2194 eaf16c8f6fef
parent 1991 d7442141d9ef
child 2231 06faf3f06d67
permissions -rw-r--r--
'make doc' is now working also in case of external build.
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
  {
deba@2111
    49
    typedef Graph Graph;
deba@2111
    50
    checkConcept<Graph, GraphAdaptor<Graph> >();
klao@946
    51
deba@2111
    52
    checkConcept<Graph, RevGraphAdaptor<Graph> >();
klao@946
    53
deba@2111
    54
    checkConcept<Graph, SubGraphAdaptor<Graph, 
marci@998
    55
      Graph::NodeMap<bool> , Graph::EdgeMap<bool> > >();
deba@2111
    56
    checkConcept<Graph, NodeSubGraphAdaptor<Graph, 
marci@998
    57
      Graph::NodeMap<bool> > >();
deba@2111
    58
    checkConcept<Graph, EdgeSubGraphAdaptor<Graph, 
marci@998
    59
      Graph::EdgeMap<bool> > >();
marci@992
    60
    
deba@2111
    61
    checkConcept<Graph, ResGraphAdaptor<Graph, int, 
marci@998
    62
      Graph::EdgeMap<int>, Graph::EdgeMap<int> > >();
klao@946
    63
deba@2111
    64
    checkConcept<Graph, 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@2111
    76
    checkConcept<Graph, 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
}