test/digraph_test.cc
changeset 1209 4a170261cc54
parent 1092 dceba191c00d
equal deleted inserted replaced
26:51366f3ab9a1 27:c5a88dfe828d
    18 
    18 
    19 #include <lemon/concepts/digraph.h>
    19 #include <lemon/concepts/digraph.h>
    20 #include <lemon/list_graph.h>
    20 #include <lemon/list_graph.h>
    21 #include <lemon/smart_graph.h>
    21 #include <lemon/smart_graph.h>
    22 #include <lemon/static_graph.h>
    22 #include <lemon/static_graph.h>
       
    23 #include <lemon/compact_graph.h>
    23 #include <lemon/full_graph.h>
    24 #include <lemon/full_graph.h>
    24 
    25 
    25 #include "test_tools.h"
    26 #include "test_tools.h"
    26 #include "graph_test.h"
    27 #include "graph_test.h"
    27 
    28 
   336   }
   337   }
   337   { // Checking StaticDigraph
   338   { // Checking StaticDigraph
   338     checkConcept<Digraph, StaticDigraph>();
   339     checkConcept<Digraph, StaticDigraph>();
   339     checkConcept<ClearableDigraphComponent<>, StaticDigraph>();
   340     checkConcept<ClearableDigraphComponent<>, StaticDigraph>();
   340   }
   341   }
       
   342   { // Checking CompactDigraph
       
   343     checkConcept<Digraph, CompactDigraph>();
       
   344     checkConcept<ClearableDigraphComponent<>, CompactDigraph>();
       
   345   }
   341   { // Checking FullDigraph
   346   { // Checking FullDigraph
   342     checkConcept<Digraph, FullDigraph>();
   347     checkConcept<Digraph, FullDigraph>();
   343   }
   348   }
   344 }
   349 }
   345 
   350 
   392 
   397 
   393   check(!g.valid(g.nodeFromId(-1)), "Wrong validity check");
   398   check(!g.valid(g.nodeFromId(-1)), "Wrong validity check");
   394   check(!g.valid(g.arcFromId(-1)), "Wrong validity check");
   399   check(!g.valid(g.arcFromId(-1)), "Wrong validity check");
   395 }
   400 }
   396 
   401 
       
   402 template <typename GR>
   397 void checkStaticDigraph() {
   403 void checkStaticDigraph() {
   398   SmartDigraph g;
   404   SmartDigraph g;
   399   SmartDigraph::NodeMap<StaticDigraph::Node> nref(g);
   405   SmartDigraph::NodeMap<typename GR::Node> nref(g);
   400   SmartDigraph::ArcMap<StaticDigraph::Arc> aref(g);
   406   SmartDigraph::ArcMap<typename GR::Arc> aref(g);
   401 
   407 
   402   StaticDigraph G;
   408   GR G;
   403 
   409 
   404   checkGraphNodeList(G, 0);
   410   checkGraphNodeList(G, 0);
   405   checkGraphArcList(G, 0);
   411   checkGraphArcList(G, 0);
   406 
   412 
   407   G.build(g, nref, aref);
   413   G.build(g, nref, aref);
   553     checkDigraphSplit<SmartDigraph>();
   559     checkDigraphSplit<SmartDigraph>();
   554     checkDigraphSnapshot<SmartDigraph>();
   560     checkDigraphSnapshot<SmartDigraph>();
   555     checkDigraphValidity<SmartDigraph>();
   561     checkDigraphValidity<SmartDigraph>();
   556   }
   562   }
   557   { // Checking StaticDigraph
   563   { // Checking StaticDigraph
   558     checkStaticDigraph();
   564     checkStaticDigraph<StaticDigraph>();
       
   565     checkStaticDigraph<CompactDigraph>();
   559   }
   566   }
   560   { // Checking FullDigraph
   567   { // Checking FullDigraph
   561     checkFullDigraph(8);
   568     checkFullDigraph(8);
   562   }
   569   }
   563 }
   570 }