Changeset 821:f4b5c2d5449d in lemon for test/digraph_test.cc
- Timestamp:
- 08/25/09 13:58:43 (15 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/digraph_test.cc
r463 r821 20 20 #include <lemon/list_graph.h> 21 21 #include <lemon/smart_graph.h> 22 #include <lemon/static_graph.h> 22 23 #include <lemon/full_graph.h> 23 24 … … 318 319 checkConcept<ClearableDigraphComponent<>, SmartDigraph>(); 319 320 } 321 { // Checking StaticDigraph 322 checkConcept<Digraph, StaticDigraph>(); 323 checkConcept<ClearableDigraphComponent<>, StaticDigraph>(); 324 } 320 325 { // Checking FullDigraph 321 326 checkConcept<Digraph, FullDigraph>(); … … 371 376 check(!g.valid(g.nodeFromId(-1)), "Wrong validity check"); 372 377 check(!g.valid(g.arcFromId(-1)), "Wrong validity check"); 378 } 379 380 void checkStaticDigraph() { 381 SmartDigraph g; 382 SmartDigraph::NodeMap<StaticDigraph::Node> nref(g); 383 SmartDigraph::ArcMap<StaticDigraph::Arc> aref(g); 384 385 StaticDigraph G; 386 387 checkGraphNodeList(G, 0); 388 checkGraphArcList(G, 0); 389 390 G.build(g, nref, aref); 391 392 checkGraphNodeList(G, 0); 393 checkGraphArcList(G, 0); 394 395 SmartDigraph::Node 396 n1 = g.addNode(), 397 n2 = g.addNode(), 398 n3 = g.addNode(); 399 400 G.build(g, nref, aref); 401 402 checkGraphNodeList(G, 3); 403 checkGraphArcList(G, 0); 404 405 SmartDigraph::Arc a1 = g.addArc(n1, n2); 406 407 G.build(g, nref, aref); 408 409 check(G.source(aref[a1]) == nref[n1] && G.target(aref[a1]) == nref[n2], 410 "Wrong arc or wrong references"); 411 checkGraphNodeList(G, 3); 412 checkGraphArcList(G, 1); 413 414 checkGraphOutArcList(G, nref[n1], 1); 415 checkGraphOutArcList(G, nref[n2], 0); 416 checkGraphOutArcList(G, nref[n3], 0); 417 418 checkGraphInArcList(G, nref[n1], 0); 419 checkGraphInArcList(G, nref[n2], 1); 420 checkGraphInArcList(G, nref[n3], 0); 421 422 checkGraphConArcList(G, 1); 423 424 SmartDigraph::Arc 425 a2 = g.addArc(n2, n1), 426 a3 = g.addArc(n2, n3), 427 a4 = g.addArc(n2, n3); 428 429 digraphCopy(g, G).nodeRef(nref).run(); 430 431 checkGraphNodeList(G, 3); 432 checkGraphArcList(G, 4); 433 434 checkGraphOutArcList(G, nref[n1], 1); 435 checkGraphOutArcList(G, nref[n2], 3); 436 checkGraphOutArcList(G, nref[n3], 0); 437 438 checkGraphInArcList(G, nref[n1], 1); 439 checkGraphInArcList(G, nref[n2], 1); 440 checkGraphInArcList(G, nref[n3], 2); 441 442 checkGraphConArcList(G, 4); 443 444 checkNodeIds(G); 445 checkArcIds(G); 446 checkGraphNodeMap(G); 447 checkGraphArcMap(G); 373 448 } 374 449 … … 420 495 checkDigraphValidity<SmartDigraph>(); 421 496 } 497 { // Checking StaticDigraph 498 checkStaticDigraph(); 499 } 422 500 { // Checking FullDigraph 423 501 checkFullDigraph(8);
Note: See TracChangeset
for help on using the changeset viewer.