src/test/graph_test.cc
author klao
Sun, 28 Nov 2004 16:30:10 +0000
changeset 1022 567f392d1d2e
parent 989 ca95f8b5c931
child 1043 52a2201a88e9
permissions -rw-r--r--
UndirGraph implementation nearly complete
     1 // -*- c++ -*-
     2 
     3 #include <iostream>
     4 #include <vector>
     5 
     6 #include <lemon/concept/graph.h>
     7 #include <lemon/list_graph.h>
     8 #include <lemon/smart_graph.h>
     9 #include <lemon/full_graph.h>
    10 
    11 #include "test_tools.h"
    12 #include "graph_test.h"
    13 #include "map_test.h"
    14 
    15 
    16 using namespace lemon;
    17 using namespace lemon::concept;
    18 
    19 
    20 int main() {
    21   ///\file
    22   { // checking graph components
    23     checkConcept<BaseGraphComponent, BaseGraphComponent >();
    24 
    25     checkConcept<BaseIterableGraphComponent, BaseIterableGraphComponent >();
    26 
    27     checkConcept<IDableGraphComponent, IDableGraphComponent >();
    28     checkConcept<MaxIDableGraphComponent, MaxIDableGraphComponent >();
    29 
    30     checkConcept<BaseExtendableGraphComponent, BaseExtendableGraphComponent >();
    31     checkConcept<BaseErasableGraphComponent, BaseErasableGraphComponent >();
    32 
    33     checkConcept<IterableGraphComponent, IterableGraphComponent >();
    34 
    35     checkConcept<MappableGraphComponent, MappableGraphComponent >();
    36 
    37     checkConcept<ExtendableGraphComponent, ExtendableGraphComponent >();
    38     checkConcept<ErasableGraphComponent, ErasableGraphComponent >();
    39     checkConcept<ClearableGraphComponent, ClearableGraphComponent >();
    40   }
    41   { // checking skeleton graphs
    42     checkConcept<StaticGraph, StaticGraph >();
    43     checkConcept<ExtendableGraph, ExtendableGraph >();
    44     checkConcept<ErasableGraph, ErasableGraph >();
    45   }
    46   { // checking list graph
    47     checkConcept<ErasableGraph, ListGraph >();
    48 
    49     checkGraph<ListGraph>();
    50     checkGraphNodeMap<ListGraph>();
    51     checkGraphEdgeMap<ListGraph>();
    52   }
    53   { // checking smart graph
    54     checkConcept<ExtendableGraph, SmartGraph >();
    55 
    56     checkGraph<SmartGraph>();
    57     checkGraphNodeMap<SmartGraph>();
    58     checkGraphEdgeMap<SmartGraph>();
    59   }
    60   { // checking full graph
    61     checkConcept<StaticGraph, FullGraph >();
    62   }
    63 
    64   std::cout << __FILE__ ": All tests passed.\n";
    65 
    66   return 0;
    67 }