test/graph_test.cc
changeset 796 7e368d9b67f7
parent 440 88ed40ad0d4f
child 807 3e711ee55d31
equal deleted inserted replaced
16:78f0965376d1 17:5fd645e21400
    61   checkGraphConEdgeList(G, 1);
    61   checkGraphConEdgeList(G, 1);
    62   checkGraphConArcList(G, 2);
    62   checkGraphConArcList(G, 2);
    63 
    63 
    64   Edge e2 = G.addEdge(n2, n1),
    64   Edge e2 = G.addEdge(n2, n1),
    65        e3 = G.addEdge(n2, n3);
    65        e3 = G.addEdge(n2, n3);
       
    66   ignore_unused_variable_warning(e2,e3);
    66 
    67 
    67   checkGraphNodeList(G, 3);
    68   checkGraphNodeList(G, 3);
    68   checkGraphEdgeList(G, 3);
    69   checkGraphEdgeList(G, 3);
    69   checkGraphArcList(G, 6);
    70   checkGraphArcList(G, 6);
    70 
    71 
    93   Node n1 = G.addNode(), n2 = G.addNode(),
    94   Node n1 = G.addNode(), n2 = G.addNode(),
    94        n3 = G.addNode(), n4 = G.addNode();
    95        n3 = G.addNode(), n4 = G.addNode();
    95   Edge e1 = G.addEdge(n1, n2), e2 = G.addEdge(n2, n1),
    96   Edge e1 = G.addEdge(n1, n2), e2 = G.addEdge(n2, n1),
    96        e3 = G.addEdge(n2, n3), e4 = G.addEdge(n1, n4),
    97        e3 = G.addEdge(n2, n3), e4 = G.addEdge(n1, n4),
    97        e5 = G.addEdge(n4, n3);
    98        e5 = G.addEdge(n4, n3);
       
    99   ignore_unused_variable_warning(e1,e3,e4,e5);
    98 
   100 
    99   checkGraphNodeList(G, 4);
   101   checkGraphNodeList(G, 4);
   100   checkGraphEdgeList(G, 5);
   102   checkGraphEdgeList(G, 5);
   101   checkGraphArcList(G, 10);
   103   checkGraphArcList(G, 10);
   102 
   104 
   172   Node n1 = G.addNode(), n2 = G.addNode(),
   174   Node n1 = G.addNode(), n2 = G.addNode(),
   173        n3 = G.addNode(), n4 = G.addNode();
   175        n3 = G.addNode(), n4 = G.addNode();
   174   Edge e1 = G.addEdge(n1, n2), e2 = G.addEdge(n2, n1),
   176   Edge e1 = G.addEdge(n1, n2), e2 = G.addEdge(n2, n1),
   175        e3 = G.addEdge(n2, n3), e4 = G.addEdge(n1, n4),
   177        e3 = G.addEdge(n2, n3), e4 = G.addEdge(n1, n4),
   176        e5 = G.addEdge(n4, n3);
   178        e5 = G.addEdge(n4, n3);
       
   179   ignore_unused_variable_warning(e1,e3,e4,e5);
   177 
   180 
   178   // Check edge deletion
   181   // Check edge deletion
   179   G.erase(e2);
   182   G.erase(e2);
   180 
   183 
   181   checkGraphNodeList(G, 4);
   184   checkGraphNodeList(G, 4);
   212 
   215 
   213   Graph G;
   216   Graph G;
   214   Node n1 = G.addNode(), n2 = G.addNode(), n3 = G.addNode();
   217   Node n1 = G.addNode(), n2 = G.addNode(), n3 = G.addNode();
   215   Edge e1 = G.addEdge(n1, n2), e2 = G.addEdge(n2, n1),
   218   Edge e1 = G.addEdge(n1, n2), e2 = G.addEdge(n2, n1),
   216        e3 = G.addEdge(n2, n3);
   219        e3 = G.addEdge(n2, n3);
       
   220   ignore_unused_variable_warning(e1,e2,e3);
   217 
   221 
   218   checkGraphNodeList(G, 3);
   222   checkGraphNodeList(G, 3);
   219   checkGraphEdgeList(G, 3);
   223   checkGraphEdgeList(G, 3);
   220   checkGraphArcList(G, 6);
   224   checkGraphArcList(G, 6);
   221 
   225 
   360     n3 = g.addNode();
   364     n3 = g.addNode();
   361 
   365 
   362   Edge
   366   Edge
   363     e1 = g.addEdge(n1, n2),
   367     e1 = g.addEdge(n1, n2),
   364     e2 = g.addEdge(n2, n3);
   368     e2 = g.addEdge(n2, n3);
       
   369   ignore_unused_variable_warning(e2);
   365 
   370 
   366   check(g.valid(n1), "Wrong validity check");
   371   check(g.valid(n1), "Wrong validity check");
   367   check(g.valid(e1), "Wrong validity check");
   372   check(g.valid(e1), "Wrong validity check");
   368   check(g.valid(g.direct(e1, true)), "Wrong validity check");
   373   check(g.valid(g.direct(e1, true)), "Wrong validity check");
   369 
   374 
   489   checkGraphNodeList(G, 1 << dim);
   494   checkGraphNodeList(G, 1 << dim);
   490   checkGraphEdgeList(G, dim * (1 << (dim-1)));
   495   checkGraphEdgeList(G, dim * (1 << (dim-1)));
   491   checkGraphArcList(G, dim * (1 << dim));
   496   checkGraphArcList(G, dim * (1 << dim));
   492 
   497 
   493   Node n = G.nodeFromId(dim);
   498   Node n = G.nodeFromId(dim);
       
   499   ignore_unused_variable_warning(n);
   494 
   500 
   495   for (NodeIt n(G); n != INVALID; ++n) {
   501   for (NodeIt n(G); n != INVALID; ++n) {
   496     checkGraphIncEdgeList(G, n, dim);
   502     checkGraphIncEdgeList(G, n, dim);
   497     for (IncEdgeIt e(G, n); e != INVALID; ++e) {
   503     for (IncEdgeIt e(G, n); e != INVALID; ++e) {
   498       check( (G.u(e) == n &&
   504       check( (G.u(e) == n &&