test/digraph_test.cc
changeset 817 432c54cec63c
parent 784 9d6c3e8b2421
child 827 580af8cf2f6a
     1.1 --- a/test/digraph_test.cc	Tue Aug 18 10:08:28 2009 +0200
     1.2 +++ b/test/digraph_test.cc	Thu Nov 05 08:39:49 2009 +0100
     1.3 @@ -35,6 +35,9 @@
     1.4    checkGraphNodeList(G, 0);
     1.5    checkGraphArcList(G, 0);
     1.6  
     1.7 +  G.reserveNode(3);
     1.8 +  G.reserveArc(4);
     1.9 +
    1.10    Node
    1.11      n1 = G.addNode(),
    1.12      n2 = G.addNode(),
    1.13 @@ -283,6 +286,14 @@
    1.14    G.addArc(G.addNode(), G.addNode());
    1.15  
    1.16    snapshot.restore();
    1.17 +  snapshot.save(G);
    1.18 +
    1.19 +  checkGraphNodeList(G, 4);
    1.20 +  checkGraphArcList(G, 4);
    1.21 +
    1.22 +  G.addArc(G.addNode(), G.addNode());
    1.23 +
    1.24 +  snapshot.restore();
    1.25  
    1.26    checkGraphNodeList(G, 4);
    1.27    checkGraphArcList(G, 4);
    1.28 @@ -375,7 +386,12 @@
    1.29  void checkFullDigraph(int num) {
    1.30    typedef FullDigraph Digraph;
    1.31    DIGRAPH_TYPEDEFS(Digraph);
    1.32 +
    1.33    Digraph G(num);
    1.34 +  check(G.nodeNum() == num && G.arcNum() == num * num, "Wrong size");
    1.35 +
    1.36 +  G.resize(num);
    1.37 +  check(G.nodeNum() == num && G.arcNum() == num * num, "Wrong size");
    1.38  
    1.39    checkGraphNodeList(G, num);
    1.40    checkGraphArcList(G, num * num);