src/test/graph_test.cc
author klao
Wed, 27 Oct 2004 22:38:50 +0000
changeset 946 c94ef40a22ce
parent 938 70e2886211d5
child 959 c80ef5912903
permissions -rw-r--r--
The graph_factory branch (@ 1321) has been merged to trunk.
     1 // -*- c++ -*-
     2 
     3 #include <iostream>
     4 #include <vector>
     5 
     6 #include <lemon/skeletons/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::skeleton;
    18 
    19 
    20 int main() {
    21   ///\file
    22   { // checking graph components
    23     function_requires<BaseGraphComponentConcept<BaseGraphComponent> >();
    24 
    25     function_requires<BaseIterableGraphComponentConcept<BaseIterableGraphComponent> >();
    26 
    27     function_requires<IDableGraphComponentConcept<IDableGraphComponent> >();
    28     function_requires<MaxIDableGraphComponentConcept<MaxIDableGraphComponent> >();
    29 
    30     function_requires<BaseExtendableGraphComponentConcept<BaseExtendableGraphComponent> >();
    31     function_requires<BaseErasableGraphComponentConcept<BaseErasableGraphComponent> >();
    32     function_requires<BaseClearableGraphComponentConcept<BaseClearableGraphComponent> >();
    33 
    34     function_requires<IterableGraphComponentConcept<IterableGraphComponent> >();
    35 
    36     function_requires<IdMappableGraphComponentConcept<IdMappableGraphComponent> >();
    37     function_requires<MappableGraphComponentConcept<MappableGraphComponent> >();
    38 
    39     function_requires<ExtendableGraphComponentConcept<ExtendableGraphComponent> >();
    40     function_requires<ErasableGraphComponentConcept<ErasableGraphComponent> >();
    41     function_requires<ClearableGraphComponentConcept<ClearableGraphComponent> >();
    42   }
    43   { // checking skeleton graphs
    44     function_requires<StaticGraphConcept<StaticGraph> >();
    45     function_requires<ExtendableGraphConcept<ExtendableGraph> >();
    46     function_requires<ErasableGraphConcept<ErasableGraph> >();
    47   }
    48   { // checking list graph
    49     function_requires<ErasableGraphConcept<ListGraph> >();
    50 
    51     checkGraph<ListGraph>();
    52     checkGraphNodeMap<ListGraph>();
    53     checkGraphEdgeMap<ListGraph>();
    54   }
    55   { // checking smart graph
    56     function_requires<ExtendableGraphConcept<SmartGraph> >();
    57 
    58     checkGraph<SmartGraph>();
    59     checkGraphNodeMap<SmartGraph>();
    60     checkGraphEdgeMap<SmartGraph>();
    61   }
    62   { // checking full graph
    63     function_requires<StaticGraphConcept<FullGraph> >();
    64   }
    65 
    66   std::cout << __FILE__ ": All tests passed.\n";
    67 
    68   return 0;
    69 }