test/graph_adaptor_test.cc
author alpar
Tue, 21 Feb 2006 12:37:00 +0000
changeset 1977 8ef02f0c4245
parent 1909 2d806130e700
child 1979 c2992fd74dad
permissions -rw-r--r--
RefPtr: a reference counted pointer class
     1 /* -*- C++ -*-
     2  *
     3  * This file is a part of LEMON, a generic C++ optimization library
     4  *
     5  * Copyright (C) 2003-2006
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     8  *
     9  * Permission to use, modify and distribute this software is granted
    10  * provided that this copyright notice appears in all copies. For
    11  * precise terms see the accompanying LICENSE file.
    12  *
    13  * This software is provided "AS IS" with no warranty of any kind,
    14  * express or implied, and with no claim as to its suitability for any
    15  * purpose.
    16  *
    17  */
    18 
    19 #include<iostream>
    20 #include<lemon/concept_check.h>
    21 
    22 #include<lemon/smart_graph.h>
    23 #include<lemon/concept/graph.h>
    24 #include<lemon/concept/ugraph.h>
    25 
    26 #include<lemon/list_graph.h>
    27 #include<lemon/full_graph.h>
    28 #include<lemon/graph_adaptor.h>
    29 
    30 #include"test/test_tools.h"
    31 #include"test/graph_test.h"
    32 
    33 /**
    34 \file
    35 This test makes consistency checks of graph adaptors.
    36 
    37 \todo More extensive tests are needed 
    38 */
    39 
    40 using namespace lemon;
    41 using namespace lemon::concept;
    42 
    43 
    44 
    45 int main() 
    46 {
    47   {
    48     typedef StaticGraph Graph;
    49     checkConcept<StaticGraph, GraphAdaptor<Graph> >();
    50 
    51     checkConcept<StaticGraph, RevGraphAdaptor<Graph> >();
    52 
    53     checkConcept<StaticGraph, SubGraphAdaptor<Graph, 
    54       Graph::NodeMap<bool> , Graph::EdgeMap<bool> > >();
    55     checkConcept<StaticGraph, NodeSubGraphAdaptor<Graph, 
    56       Graph::NodeMap<bool> > >();
    57     checkConcept<StaticGraph, EdgeSubGraphAdaptor<Graph, 
    58       Graph::EdgeMap<bool> > >();
    59     
    60     checkConcept<StaticGraph, SubBidirGraphAdaptor<Graph, 
    61       Graph::EdgeMap<bool>, Graph::EdgeMap<bool> > >();
    62     //    checkConcept<StaticGraph, BidirGraph<Graph> >();
    63     checkConcept<StaticGraph, ResGraphAdaptor<Graph, int, 
    64       Graph::EdgeMap<int>, Graph::EdgeMap<int> > >();
    65 
    66     checkConcept<StaticGraph, ErasingFirstGraphAdaptor<Graph, 
    67       Graph::NodeMap<Graph::Edge> > >(); 
    68 
    69     /// \bug why does not compile with StaticGraph
    70     checkConcept<BaseIterableUGraphConcept, UGraphAdaptor<ListGraph> >();
    71     checkConcept<IterableUGraphConcept, UGraphAdaptor<ListGraph> >();
    72     checkConcept<MappableUGraphConcept, UGraphAdaptor<ListGraph> >();
    73   }
    74   std::cout << __FILE__ ": All tests passed.\n";
    75 
    76   return 0;
    77 }