Changeset 1159:7fdaa05a69a1 in lemon for test/graph_test.cc
- Timestamp:
- 09/13/12 11:56:19 (12 years ago)
- Branch:
- default
- Children:
- 1160:00f8d9f9920d, 1401:cd72eae05bdf
- Parents:
- 1153:4bb9e72e1a41 (diff), 1157:761fe0846f49 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
test/graph_test.cc
r956 r1159 67 67 Edge e2 = G.addEdge(n2, n1), 68 68 e3 = G.addEdge(n2, n3); 69 ignore_unused_variable_warning(e2,e3); 69 70 70 71 checkGraphNodeList(G, 3); … … 99 100 e3 = G.addEdge(n2, n3), e4 = G.addEdge(n1, n4), 100 101 e5 = G.addEdge(n4, n3); 102 ignore_unused_variable_warning(e1,e3,e4,e5); 101 103 102 104 checkGraphNodeList(G, 4); … … 178 180 e3 = G.addEdge(n2, n3), e4 = G.addEdge(n1, n4), 179 181 e5 = G.addEdge(n4, n3); 182 ignore_unused_variable_warning(e1,e3,e4,e5); 180 183 181 184 // Check edge deletion … … 218 221 Edge e1 = G.addEdge(n1, n2), e2 = G.addEdge(n2, n1), 219 222 e3 = G.addEdge(n2, n3); 223 ignore_unused_variable_warning(e1,e2,e3); 220 224 221 225 checkGraphNodeList(G, 3); … … 382 386 e1 = g.addEdge(n1, n2), 383 387 e2 = g.addEdge(n2, n3); 388 ignore_unused_variable_warning(e2); 384 389 385 390 check(g.valid(n1), "Wrong validity check"); … … 520 525 521 526 Node n = G.nodeFromId(dim); 527 ignore_unused_variable_warning(n); 522 528 523 529 for (NodeIt n(G); n != INVALID; ++n) { -
test/graph_test.cc
r1157 r1159 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 095 * Copyright (C) 2003-2010 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 39 39 checkGraphArcList(G, 0); 40 40 41 G.reserveNode(3); 42 G.reserveEdge(3); 43 41 44 Node 42 45 n1 = G.addNode(), … … 261 264 262 265 snapshot.restore(); 266 snapshot.save(G); 263 267 264 268 checkGraphNodeList(G, 4); 265 269 checkGraphEdgeList(G, 3); 266 270 checkGraphArcList(G, 6); 271 272 G.addEdge(G.addNode(), G.addNode()); 273 274 snapshot.restore(); 275 276 checkGraphNodeList(G, 4); 277 checkGraphEdgeList(G, 3); 278 checkGraphArcList(G, 6); 267 279 } 268 280 … … 272 284 273 285 Graph G(num); 286 check(G.nodeNum() == num && G.edgeNum() == num * (num - 1) / 2, 287 "Wrong size"); 288 289 G.resize(num); 290 check(G.nodeNum() == num && G.edgeNum() == num * (num - 1) / 2, 291 "Wrong size"); 292 274 293 checkGraphNodeList(G, num); 275 294 checkGraphEdgeList(G, num * (num - 1) / 2); … … 417 436 check(G.height() == height, "Wrong row number"); 418 437 438 G.resize(width, height); 439 check(G.width() == width, "Wrong column number"); 440 check(G.height() == height, "Wrong row number"); 441 419 442 for (int i = 0; i < width; ++i) { 420 443 for (int j = 0; j < height; ++j) { … … 492 515 493 516 HypercubeGraph G(dim); 517 check(G.dimension() == dim, "Wrong dimension"); 518 519 G.resize(dim); 520 check(G.dimension() == dim, "Wrong dimension"); 521 494 522 checkGraphNodeList(G, 1 << dim); 495 523 checkGraphEdgeList(G, dim * (1 << (dim-1)));
Note: See TracChangeset
for help on using the changeset viewer.