COIN-OR::LEMON - Graph Library

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/digraph_test.cc

    r228 r209  
    2525#include "test_tools.h"
    2626#include "graph_test.h"
     27#include "graph_maps_test.h"
    2728
    2829using namespace lemon;
    2930using namespace lemon::concepts;
    3031
    31 template <class Digraph>
    32 void checkDigraph() {
    33   TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);
    34   Digraph G;
    35 
    36   checkGraphNodeList(G, 0);
    37   checkGraphArcList(G, 0);
    38 
    39   Node
    40     n1 = G.addNode(),
    41     n2 = G.addNode(),
    42     n3 = G.addNode();
    43   checkGraphNodeList(G, 3);
    44   checkGraphArcList(G, 0);
    45 
    46   Arc a1 = G.addArc(n1, n2);
    47   check(G.source(a1) == n1 && G.target(a1) == n2, "Wrong arc");
    48   checkGraphNodeList(G, 3);
    49   checkGraphArcList(G, 1);
    50 
    51   checkGraphOutArcList(G, n1, 1);
    52   checkGraphOutArcList(G, n2, 0);
    53   checkGraphOutArcList(G, n3, 0);
    54 
    55   checkGraphInArcList(G, n1, 0);
    56   checkGraphInArcList(G, n2, 1);
    57   checkGraphInArcList(G, n3, 0);
    58 
    59   checkGraphConArcList(G, 1);
    60 
    61   Arc a2 = G.addArc(n2, n1), a3 = G.addArc(n2, n3), a4 = G.addArc(n2, n3);
    62   checkGraphNodeList(G, 3);
    63   checkGraphArcList(G, 4);
    64 
    65   checkGraphOutArcList(G, n1, 1);
    66   checkGraphOutArcList(G, n2, 3);
    67   checkGraphOutArcList(G, n3, 0);
    68 
    69   checkGraphInArcList(G, n1, 1);
    70   checkGraphInArcList(G, n2, 1);
    71   checkGraphInArcList(G, n3, 2);
    72 
    73   checkGraphConArcList(G, 4);
    74 
    75   checkNodeIds(G);
    76   checkArcIds(G);
    77   checkGraphNodeMap(G);
    78   checkGraphArcMap(G);
    79 
    80 }
    81 
    82 
    83 void checkConcepts() {
     32void check_concepts() {
    8433  { // Checking digraph components
    8534    checkConcept<BaseDigraphComponent, BaseDigraphComponent >();
     
    10352    checkConcept<ClearableDigraphComponent<>, ListDigraph>();
    10453    checkConcept<ErasableDigraphComponent<>, ListDigraph>();
     54    checkDigraphIterators<ListDigraph>();
    10555  }
    10656  { // Checking SmartDigraph
     
    10959    checkConcept<ExtendableDigraphComponent<>, SmartDigraph>();
    11060    checkConcept<ClearableDigraphComponent<>, SmartDigraph>();
     61    checkDigraphIterators<SmartDigraph>();
    11162  }
    11263//  { // Checking FullDigraph
    11364//    checkConcept<Digraph, FullDigraph>();
     65//    checkDigraphIterators<FullDigraph>();
    11466//  }
    11567//  { // Checking HyperCubeDigraph
    11668//    checkConcept<Digraph, HyperCubeDigraph>();
     69//    checkDigraphIterators<HyperCubeDigraph>();
    11770//  }
    11871}
    11972
    12073template <typename Digraph>
    121 void checkDigraphValidity() {
     74void check_graph_validity() {
    12275  TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);
    12376  Digraph g;
     
    14093
    14194template <typename Digraph>
    142 void checkDigraphValidityErase() {
     95void check_graph_validity_erase() {
    14396  TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);
    14497  Digraph g;
     
    168121}
    169122
    170 void checkDigraphs() {
     123void check_digraphs() {
    171124  { // Checking ListDigraph
    172125    checkDigraph<ListDigraph>();
    173     checkDigraphValidityErase<ListDigraph>();
     126    checkGraphNodeMap<ListDigraph>();
     127    checkGraphArcMap<ListDigraph>();
     128
     129    check_graph_validity_erase<ListDigraph>();
    174130  }
    175131  { // Checking SmartDigraph
    176132    checkDigraph<SmartDigraph>();
    177     checkDigraphValidity<SmartDigraph>();
     133    checkGraphNodeMap<SmartDigraph>();
     134    checkGraphArcMap<SmartDigraph>();
     135
     136    check_graph_validity<SmartDigraph>();
    178137  }
    179138}
    180139
    181140int main() {
    182   checkDigraphs();
    183   checkConcepts();
     141  check_concepts();
     142  check_digraphs();
    184143  return 0;
    185144}
Note: See TracChangeset for help on using the changeset viewer.