# Changeset 932:9f6ed854d409 in lemon for test

Ignore:
Timestamp:
03/02/10 10:27:47 (10 years ago)
Branch:
default
Phase:
public
Message:

Also test fullInit() in suurballe_test (#181, #323)

File:
1 edited

Unmodified
Added
Removed
• ## test/suurballe_test.cc

 r931 run(); // Find 2 paths // Check run() { Suurballe suurballe(digraph, length); // Find 2 paths check(suurballe.run(s, t) == 2, "Wrong number of paths"); check(checkFlow(digraph, suurballe.flowMap(), s, t, 2), for (int i = 0; i < suurballe.pathNum(); ++i) check(checkPath(digraph, suurballe.path(i), s, t), "Wrong path"); } // Find 3 paths { Suurballe suurballe(digraph, length); // Find 3 paths check(suurballe.run(s, t, 3) == 3, "Wrong number of paths"); check(checkFlow(digraph, suurballe.flowMap(), s, t, 3), for (int i = 0; i < suurballe.pathNum(); ++i) check(checkPath(digraph, suurballe.path(i), s, t), "Wrong path"); } // Find 5 paths (only 3 can be found) { Suurballe suurballe(digraph, length); // Find 5 paths (only 3 can be found) check(suurballe.run(s, t, 5) == 3, "Wrong number of paths"); check(checkFlow(digraph, suurballe.flowMap(), s, t, 3), check(checkPath(digraph, suurballe.path(i), s, t), "Wrong path"); } // Check fullInit() + start() { Suurballe suurballe(digraph, length); suurballe.fullInit(s); // Find 2 paths check(suurballe.start(t) == 2, "Wrong number of paths"); check(suurballe.totalLength() == 510, "The flow is not optimal"); // Find 3 paths check(suurballe.start(t, 3) == 3, "Wrong number of paths"); check(suurballe.totalLength() == 1040, "The flow is not optimal"); // Find 5 paths (only 3 can be found) check(suurballe.start(t, 5) == 3, "Wrong number of paths"); check(suurballe.totalLength() == 1040, "The flow is not optimal"); } return 0;
Note: See TracChangeset for help on using the changeset viewer.