diff -r f1158744a112 -r 37557a46e298 test/digraph_test.cc --- a/test/digraph_test.cc Mon Aug 04 22:00:36 2008 +0200 +++ b/test/digraph_test.cc Thu Aug 14 21:49:39 2008 +0200 @@ -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 @@ -176,6 +209,9 @@ checkDigraph(); checkDigraphValidity(); } + { // Checking FullDigraph + checkFullDigraph(8); + } } int main() {