@@ -331,11 +331,20 @@ TEST(ComplicatedBadSolutionTest, PetyaWins) {
331
331
<< " #000#000#0#\n "
332
332
<< " #0###0#####\n\n " ;
333
333
334
+ auto maze = ss.str ();
335
+
334
336
std::stringstream output;
335
337
336
338
ComplicatedBadSolution (ss, output);
337
339
EXPECT_EQ (output.str (), " Petya! with 6\n " );
338
340
341
+ ss << maze;
342
+
343
+ std::stringstream output_12;
344
+
345
+ GoodSolution (ss, output_12);
346
+ EXPECT_EQ (output_12.str (), " Petya! with 6\n " );
347
+
339
348
std::stringstream ss_2;
340
349
ss_2 << " #########V##\n "
341
350
<< " #000000#000#\n "
@@ -349,10 +358,19 @@ TEST(ComplicatedBadSolutionTest, PetyaWins) {
349
358
<< " #00000000000\n "
350
359
<< " ##P#########\n\n " ;
351
360
361
+ maze = ss_2.str ();
362
+
352
363
std::stringstream output_2;
353
364
354
365
ComplicatedBadSolution (ss_2, output_2);
355
366
EXPECT_EQ (output_2.str (), " Petya! with 8\n " );
367
+
368
+ ss_2 << maze;
369
+
370
+ std::stringstream output_22;
371
+
372
+ GoodSolution (ss_2, output_22);
373
+ EXPECT_EQ (output_22.str (), " Petya! with 8\n " );
356
374
}
357
375
358
376
TEST (ComplicatedBadSolutionTest, VasyaWins) {
@@ -369,11 +387,20 @@ TEST(ComplicatedBadSolutionTest, VasyaWins) {
369
387
<< " #000#000#0#\n "
370
388
<< " #####0#####\n\n " ;
371
389
390
+ auto maze = ss.str ();
391
+
372
392
std::stringstream output;
373
393
374
394
ComplicatedBadSolution (ss, output);
375
395
EXPECT_EQ (output.str (), " Vasya! with 21\n " );
376
396
397
+ ss << maze;
398
+
399
+ std::stringstream output_12;
400
+
401
+ GoodSolution (ss, output_12);
402
+ EXPECT_EQ (output_12.str (), " Vasya! with 21\n " );
403
+
377
404
std::stringstream ss_2;
378
405
ss_2 << " ###V#########\n "
379
406
<< " #00000000#00#\n "
@@ -387,13 +414,22 @@ TEST(ComplicatedBadSolutionTest, VasyaWins) {
387
414
<< " #0000#000000#\n "
388
415
<< " ####0##P#####\n\n " ;
389
416
417
+ maze = ss_2.str ();
418
+
390
419
std::stringstream output_2;
391
420
392
421
ComplicatedBadSolution (ss_2, output_2);
393
422
EXPECT_EQ (output_2.str (), " Vasya! with 6\n " );
423
+
424
+ ss_2 << maze;
425
+
426
+ std::stringstream output_22;
427
+
428
+ GoodSolution (ss_2, output_22);
429
+ EXPECT_EQ (output_22.str (), " Vasya! with 6\n " );
394
430
}
395
431
396
- TEST (ComplicatedBadSolutionTest, PetyaWinsHard ) {
432
+ TEST (ComplicatedBadSolutionTest, PetyaWinsHardDAGRelaxation ) {
397
433
std::stringstream ss;
398
434
ss << " ###V###\n "
399
435
<< " #00000#\n "
@@ -411,6 +447,24 @@ TEST(ComplicatedBadSolutionTest, PetyaWinsHard) {
411
447
EXPECT_EQ (output.str (), " Petya! with 6\n " );
412
448
}
413
449
450
+ TEST (ComplicatedBadSolutionTest, PetyaWinsHardAStar) {
451
+ std::stringstream ss;
452
+ ss << " ###V###\n "
453
+ << " #00000#\n "
454
+ << " #00000#\n "
455
+ << " #00000#\n "
456
+ << " #000000\n "
457
+ << " #00000#\n "
458
+ << " #00000#\n "
459
+ << " #00000#\n "
460
+ << " ####P##\n\n " ;
461
+
462
+ std::stringstream output;
463
+
464
+ GoodSolution (ss, output);
465
+ EXPECT_EQ (output.str (), " Petya! with 6\n " );
466
+ }
467
+
414
468
TEST (ComplicatedBadSolutionTest, Draw) {
415
469
std::stringstream ss;
416
470
ss << " ##V########\n "
@@ -425,10 +479,19 @@ TEST(ComplicatedBadSolutionTest, Draw) {
425
479
<< " #000#000#0#\n "
426
480
<< " ###########\n\n " ;
427
481
482
+ auto maze = ss.str ();
483
+
428
484
std::stringstream output;
429
485
430
486
ComplicatedBadSolution (ss, output);
431
487
EXPECT_EQ (output.str (), " Draw! with 25\n " );
488
+
489
+ ss << maze;
490
+
491
+ std::stringstream output_12;
492
+
493
+ GoodSolution (ss, output_12);
494
+ EXPECT_EQ (output_12.str (), " Draw! with 25\n " );
432
495
}
433
496
434
497
TEST (ComplicatedBadSolutionTest, ValeryWins) {
@@ -445,8 +508,17 @@ TEST(ComplicatedBadSolutionTest, ValeryWins) {
445
508
<< " #000#000#0#\n "
446
509
<< " ###########\n\n " ;
447
510
511
+ auto maze = ss.str ();
512
+
448
513
std::stringstream output;
449
514
450
515
ComplicatedBadSolution (ss, output);
451
516
EXPECT_EQ (output.str (), " Deadlock! Valery!\n " );
517
+
518
+ ss << maze;
519
+
520
+ std::stringstream output_12;
521
+
522
+ GoodSolution (ss, output_12);
523
+ EXPECT_EQ (output_12.str (), " Deadlock! Valery!\n " );
452
524
}
0 commit comments