diff -r c6c6e1d863c4 -r 99f1bdf8f7db test/digraph_test.cc --- a/test/digraph_test.cc Wed Oct 29 15:29:34 2008 +0100 +++ b/test/digraph_test.cc Tue Nov 04 10:21:22 2008 +0000 @@ -19,7 +19,7 @@ #include #include #include -//#include +#include //#include #include "test_tools.h" @@ -79,6 +79,39 @@ } +void checkFullDigraph(int num) { + typedef FullDigraph Digraph; + DIGRAPH_TYPEDEFS(Digraph); + Digraph G(num); + + checkGraphNodeList(G, num); + checkGraphArcList(G, num * num); + + for (NodeIt n(G); n != INVALID; ++n) { + checkGraphOutArcList(G, n, num); + checkGraphInArcList(G, n, num); + } + + checkGraphConArcList(G, num * num); + + checkNodeIds(G); + checkArcIds(G); + checkGraphNodeMap(G); + checkGraphArcMap(G); + + for (int i = 0; i < G.nodeNum(); ++i) { + check(G.index(G(i)) == i, "Wrong index"); + } + + for (NodeIt s(G); s != INVALID; ++s) { + for (NodeIt t(G); t != INVALID; ++t) { + Arc a = G.arc(s, t); + check(G.source(a) == s && G.target(a) == t, "Wrong arc lookup"); + } + } + +} + void checkConcepts() { { // Checking digraph components @@ -109,9 +142,9 @@ checkConcept, SmartDigraph>(); checkConcept, SmartDigraph>(); } -// { // Checking FullDigraph -// checkConcept(); -// } + { // Checking FullDigraph + checkConcept(); + } // { // Checking HyperCubeDigraph // checkConcept(); // } @@ -176,6 +209,9 @@ checkDigraph(); checkDigraphValidity(); } + { // Checking FullDigraph + checkFullDigraph(8); + } } int main() {