src/test/kruskal_test.cc
changeset 890 3a48bc350e0f
parent 880 9d0bfd35b97c
child 906 17f31d280385
equal deleted inserted replaced
1:8a9778868c97 2:6617d9156338
    79   check(kruskalEdgeMap_IteratorOut(G, edge_cost_map,
    79   check(kruskalEdgeMap_IteratorOut(G, edge_cost_map,
    80 				   back_inserter(tree_edge_vec))
    80 				   back_inserter(tree_edge_vec))
    81 	==-31,
    81 	==-31,
    82 	"Total cost should be -31.");
    82 	"Total cost should be -31.");
    83 
    83 
       
    84   tree_edge_vec.clear();
       
    85 
       
    86   //The above test could also be coded like this:
       
    87   check(kruskal(G,
       
    88 		makeKruskalMapInput(G, edge_cost_map),
       
    89 		makeKruskalSequenceOutput(back_inserter(tree_edge_vec)))
       
    90 	==-31,
       
    91 	"Total cost should be -31.");
       
    92 
    84   check(tree_edge_vec.size()==5,"The tree should have 5 edges.");
    93   check(tree_edge_vec.size()==5,"The tree should have 5 edges.");
    85 
    94 
    86   check(tree_edge_vec[0]==e1 &&
    95   check(tree_edge_vec[0]==e1 &&
    87 	tree_edge_vec[1]==e2 &&
    96 	tree_edge_vec[1]==e2 &&
    88 	tree_edge_vec[2]==e5 &&
    97 	tree_edge_vec[2]==e5 &&