gravatar
kpeter (Peter Kovacs)
kpeter@inf.elte.hu
Also test fullInit() in suurballe_test (#181, #323)
0 1 0
default
1 file changed with 21 insertions and 7 deletions:
↑ Collapse diff ↑
Show white space 2 line context
... ...
@@ -207,5 +207,7 @@
207 207

	
208
  // Find 2 paths
208
  // Check run()
209 209
  {
210 210
    Suurballe<ListDigraph> suurballe(digraph, length);
211
    
212
    // Find 2 paths
211 213
    check(suurballe.run(s, t) == 2, "Wrong number of paths");
... ...
@@ -219,7 +221,4 @@
219 221
      check(checkPath(digraph, suurballe.path(i), s, t), "Wrong path");
220
  }
221 222

	
222 223
  // Find 3 paths
223
  {
224
    Suurballe<ListDigraph> suurballe(digraph, length);
225 224
    check(suurballe.run(s, t, 3) == 3, "Wrong number of paths");
... ...
@@ -233,7 +232,4 @@
233 232
      check(checkPath(digraph, suurballe.path(i), s, t), "Wrong path");
234
  }
235 233

	
236 234
  // Find 5 paths (only 3 can be found)
237
  {
238
    Suurballe<ListDigraph> suurballe(digraph, length);
239 235
    check(suurballe.run(s, t, 5) == 3, "Wrong number of paths");
... ...
@@ -249,2 +245,20 @@
249 245

	
246
  // Check fullInit() + start()
247
  {
248
    Suurballe<ListDigraph> suurballe(digraph, length);
249
    suurballe.fullInit(s);
250
    
251
    // Find 2 paths
252
    check(suurballe.start(t) == 2, "Wrong number of paths");
253
    check(suurballe.totalLength() == 510, "The flow is not optimal");
254

	
255
    // Find 3 paths
256
    check(suurballe.start(t, 3) == 3, "Wrong number of paths");
257
    check(suurballe.totalLength() == 1040, "The flow is not optimal");
258

	
259
    // Find 5 paths (only 3 can be found)
260
    check(suurballe.start(t, 5) == 3, "Wrong number of paths");
261
    check(suurballe.totalLength() == 1040, "The flow is not optimal");
262
  }
263

	
250 264
  return 0;
0 comments (0 inline)