test/graph_adaptor_test.cc
author deba
Mon, 06 Feb 2006 15:52:32 +0000
changeset 1961 8e19ca944727
parent 1909 2d806130e700
child 1979 c2992fd74dad
permissions -rw-r--r--
Bug fix
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>
marci@849
    29
marci@870
    30
#include"test/test_tools.h"
marci@870
    31
#include"test/graph_test.h"
marci@849
    32
marci@849
    33
/**
marci@849
    34
\file
alpar@1401
    35
This test makes consistency checks of graph adaptors.
marci@849
    36
alpar@878
    37
\todo More extensive tests are needed 
marci@849
    38
*/
marci@849
    39
alpar@921
    40
using namespace lemon;
klao@959
    41
using namespace lemon::concept;
marci@849
    42
marci@849
    43
marci@849
    44
marci@849
    45
int main() 
marci@849
    46
{
klao@946
    47
  {
marci@998
    48
    typedef StaticGraph Graph;
alpar@1401
    49
    checkConcept<StaticGraph, GraphAdaptor<Graph> >();
klao@946
    50
alpar@1401
    51
    checkConcept<StaticGraph, RevGraphAdaptor<Graph> >();
klao@946
    52
alpar@1401
    53
    checkConcept<StaticGraph, SubGraphAdaptor<Graph, 
marci@998
    54
      Graph::NodeMap<bool> , Graph::EdgeMap<bool> > >();
alpar@1401
    55
    checkConcept<StaticGraph, NodeSubGraphAdaptor<Graph, 
marci@998
    56
      Graph::NodeMap<bool> > >();
alpar@1401
    57
    checkConcept<StaticGraph, EdgeSubGraphAdaptor<Graph, 
marci@998
    58
      Graph::EdgeMap<bool> > >();
marci@992
    59
    
alpar@1401
    60
    checkConcept<StaticGraph, SubBidirGraphAdaptor<Graph, 
marci@998
    61
      Graph::EdgeMap<bool>, Graph::EdgeMap<bool> > >();
alpar@1160
    62
    //    checkConcept<StaticGraph, BidirGraph<Graph> >();
alpar@1401
    63
    checkConcept<StaticGraph, ResGraphAdaptor<Graph, int, 
marci@998
    64
      Graph::EdgeMap<int>, Graph::EdgeMap<int> > >();
klao@946
    65
alpar@1401
    66
    checkConcept<StaticGraph, ErasingFirstGraphAdaptor<Graph, 
marci@998
    67
      Graph::NodeMap<Graph::Edge> > >(); 
marci@1383
    68
marci@1383
    69
    /// \bug why does not compile with StaticGraph
klao@1909
    70
    checkConcept<BaseIterableUGraphConcept, UGraphAdaptor<ListGraph> >();
klao@1909
    71
    checkConcept<IterableUGraphConcept, UGraphAdaptor<ListGraph> >();
klao@1909
    72
    checkConcept<MappableUGraphConcept, UGraphAdaptor<ListGraph> >();
klao@946
    73
  }
marci@849
    74
  std::cout << __FILE__ ": All tests passed.\n";
marci@849
    75
marci@849
    76
  return 0;
marci@849
    77
}