test/bpgraph_test.cc
changeset 1030 4936be66d2f5
parent 1025 c8fa41fcc4a7
child 1092 dceba191c00d
equal deleted inserted replaced
4:5a4fab728cd8 5:6aabae7de0d0
    99   checkBlueNodeIds(G);
    99   checkBlueNodeIds(G);
   100   checkArcIds(G);
   100   checkArcIds(G);
   101   checkEdgeIds(G);
   101   checkEdgeIds(G);
   102 
   102 
   103   checkGraphNodeMap(G);
   103   checkGraphNodeMap(G);
   104   checkGraphRedMap(G);
   104   checkGraphRedNodeMap(G);
   105   checkGraphBlueMap(G);
   105   checkGraphBlueNodeMap(G);
   106   checkGraphArcMap(G);
   106   checkGraphArcMap(G);
   107   checkGraphEdgeMap(G);
   107   checkGraphEdgeMap(G);
   108 }
   108 }
   109 
   109 
   110 template <class BpGraph>
   110 template <class BpGraph>
   258   checkBlueNodeIds(G);
   258   checkBlueNodeIds(G);
   259   checkArcIds(G);
   259   checkArcIds(G);
   260   checkEdgeIds(G);
   260   checkEdgeIds(G);
   261 
   261 
   262   checkGraphNodeMap(G);
   262   checkGraphNodeMap(G);
   263   checkGraphRedMap(G);
   263   checkGraphRedNodeMap(G);
   264   checkGraphBlueMap(G);
   264   checkGraphBlueNodeMap(G);
   265   checkGraphArcMap(G);
   265   checkGraphArcMap(G);
   266   checkGraphEdgeMap(G);
   266   checkGraphEdgeMap(G);
   267 
   267 
   268   G.addRedNode();
   268   G.addRedNode();
   269   snapshot.save(G);
   269   snapshot.save(G);
   367   checkGraphRedNodeList(G, redNum);
   367   checkGraphRedNodeList(G, redNum);
   368   checkGraphBlueNodeList(G, blueNum);
   368   checkGraphBlueNodeList(G, blueNum);
   369   checkGraphEdgeList(G, redNum * blueNum);
   369   checkGraphEdgeList(G, redNum * blueNum);
   370   checkGraphArcList(G, 2 * redNum * blueNum);
   370   checkGraphArcList(G, 2 * redNum * blueNum);
   371 
   371 
   372   for (RedIt n(G); n != INVALID; ++n) {
   372   for (RedNodeIt n(G); n != INVALID; ++n) {
   373     checkGraphOutArcList(G, n, blueNum);
   373     checkGraphOutArcList(G, n, blueNum);
   374     checkGraphInArcList(G, n, blueNum);
   374     checkGraphInArcList(G, n, blueNum);
   375     checkGraphIncEdgeList(G, n, blueNum);
   375     checkGraphIncEdgeList(G, n, blueNum);
   376   }
   376   }
   377 
   377 
   378   for (BlueIt n(G); n != INVALID; ++n) {
   378   for (BlueNodeIt n(G); n != INVALID; ++n) {
   379     checkGraphOutArcList(G, n, redNum);
   379     checkGraphOutArcList(G, n, redNum);
   380     checkGraphInArcList(G, n, redNum);
   380     checkGraphInArcList(G, n, redNum);
   381     checkGraphIncEdgeList(G, n, redNum);
   381     checkGraphIncEdgeList(G, n, redNum);
   382   }
   382   }
   383 
   383 
   391   checkBlueNodeIds(G);
   391   checkBlueNodeIds(G);
   392   checkArcIds(G);
   392   checkArcIds(G);
   393   checkEdgeIds(G);
   393   checkEdgeIds(G);
   394 
   394 
   395   checkGraphNodeMap(G);
   395   checkGraphNodeMap(G);
   396   checkGraphRedMap(G);
   396   checkGraphRedNodeMap(G);
   397   checkGraphBlueMap(G);
   397   checkGraphBlueNodeMap(G);
   398   checkGraphArcMap(G);
   398   checkGraphArcMap(G);
   399   checkGraphEdgeMap(G);
   399   checkGraphEdgeMap(G);
   400 
   400 
   401   for (int i = 0; i < G.redNum(); ++i) {
   401   for (int i = 0; i < G.redNum(); ++i) {
   402     check(G.red(G.redNode(i)), "Wrong node");
   402     check(G.red(G.redNode(i)), "Wrong node");