test/digraph_test.cc
changeset 353 37557a46e298
parent 228 b6732e0d38c5
child 354 80a4d0742e98
     1.1 --- a/test/digraph_test.cc	Mon Aug 04 22:00:36 2008 +0200
     1.2 +++ b/test/digraph_test.cc	Thu Aug 14 21:49:39 2008 +0200
     1.3 @@ -19,7 +19,7 @@
     1.4  #include <lemon/concepts/digraph.h>
     1.5  #include <lemon/list_graph.h>
     1.6  #include <lemon/smart_graph.h>
     1.7 -//#include <lemon/full_graph.h>
     1.8 +#include <lemon/full_graph.h>
     1.9  //#include <lemon/hypercube_graph.h>
    1.10  
    1.11  #include "test_tools.h"
    1.12 @@ -79,6 +79,39 @@
    1.13  
    1.14  }
    1.15  
    1.16 +void checkFullDigraph(int num) {
    1.17 +  typedef FullDigraph Digraph;
    1.18 +  DIGRAPH_TYPEDEFS(Digraph);
    1.19 +  Digraph G(num);
    1.20 +
    1.21 +  checkGraphNodeList(G, num);
    1.22 +  checkGraphArcList(G, num * num);
    1.23 +
    1.24 +  for (NodeIt n(G); n != INVALID; ++n) {
    1.25 +    checkGraphOutArcList(G, n, num);
    1.26 +    checkGraphInArcList(G, n, num);
    1.27 +  }
    1.28 +
    1.29 +  checkGraphConArcList(G, num * num);
    1.30 +
    1.31 +  checkNodeIds(G);
    1.32 +  checkArcIds(G);
    1.33 +  checkGraphNodeMap(G);
    1.34 +  checkGraphArcMap(G);
    1.35 +
    1.36 +  for (int i = 0; i < G.nodeNum(); ++i) {
    1.37 +    check(G.index(G(i)) == i, "Wrong index");
    1.38 +  }
    1.39 +
    1.40 +  for (NodeIt s(G); s != INVALID; ++s) {
    1.41 +    for (NodeIt t(G); t != INVALID; ++t) {
    1.42 +      Arc a = G.arc(s, t);
    1.43 +      check(G.source(a) == s && G.target(a) == t, "Wrong arc lookup");
    1.44 +    }
    1.45 +  }
    1.46 +
    1.47 +}
    1.48 +
    1.49  
    1.50  void checkConcepts() {
    1.51    { // Checking digraph components
    1.52 @@ -176,6 +209,9 @@
    1.53      checkDigraph<SmartDigraph>();
    1.54      checkDigraphValidity<SmartDigraph>();
    1.55    }
    1.56 +  { // Checking FullDigraph
    1.57 +    checkFullDigraph(8);
    1.58 +  }
    1.59  }
    1.60  
    1.61  int main() {