diff -r 636dadefe1e6 -r 61120524af27 test/matching_test.cc --- a/test/matching_test.cc Fri Sep 25 21:51:36 2009 +0200 +++ b/test/matching_test.cc Sat Sep 26 10:17:31 2009 +0200 @@ -401,22 +401,46 @@ graphReader(graph, lgfs). edgeMap("weight", weight).run(); - MaxMatching mm(graph); - mm.run(); - checkMatching(graph, mm); + bool perfect; + { + MaxMatching mm(graph); + mm.run(); + checkMatching(graph, mm); + perfect = 2 * mm.matchingSize() == countNodes(graph); + } - MaxWeightedMatching mwm(graph, weight); - mwm.run(); - checkWeightedMatching(graph, weight, mwm); + { + MaxWeightedMatching mwm(graph, weight); + mwm.run(); + checkWeightedMatching(graph, weight, mwm); + } - MaxWeightedPerfectMatching mwpm(graph, weight); - bool perfect = mwpm.run(); + { + MaxWeightedMatching mwm(graph, weight); + mwm.init(); + mwm.start(); + checkWeightedMatching(graph, weight, mwm); + } - check(perfect == (mm.matchingSize() * 2 == countNodes(graph)), - "Perfect matching found"); + { + MaxWeightedPerfectMatching mwpm(graph, weight); + bool result = mwpm.run(); + + check(result == perfect, "Perfect matching found"); + if (perfect) { + checkWeightedPerfectMatching(graph, weight, mwpm); + } + } - if (perfect) { - checkWeightedPerfectMatching(graph, weight, mwpm); + { + MaxWeightedPerfectMatching mwpm(graph, weight); + mwpm.init(); + bool result = mwpm.start(); + + check(result == perfect, "Perfect matching found"); + if (perfect) { + checkWeightedPerfectMatching(graph, weight, mwpm); + } } }