test/graph_utils_test.cc
changeset 2316 c0fae4bbaa5c
parent 2236 9f329faa4aee
child 2391 14a343be7a5a
equal deleted inserted replaced
7:1f0d188f3803 8:3c27a65748cd
   114       nodes[i] = graph.addNode();
   114       nodes[i] = graph.addNode();
   115     }
   115     }
   116     std::vector<ListGraph::Edge> edges(edgeNum);
   116     std::vector<ListGraph::Edge> edges(edgeNum);
   117     for (int i = 0; i < edgeNum; ++i) {
   117     for (int i = 0; i < edgeNum; ++i) {
   118       edges[i] = 
   118       edges[i] = 
   119 	graph.addEdge(nodes[urandom(nodeNum)], nodes[urandom(nodeNum)]);
   119 	graph.addEdge(nodes[rnd[nodeNum]], nodes[rnd[nodeNum]]);
   120     }
   120     }
   121     for (int i = 0; i < nodeNum; ++i) {
   121     for (int i = 0; i < nodeNum; ++i) {
   122       check(inDeg[nodes[i]] == countInEdges(graph, nodes[i]), 
   122       check(inDeg[nodes[i]] == countInEdges(graph, nodes[i]), 
   123 	    "Wrong in degree map");
   123 	    "Wrong in degree map");
   124     }
   124     }