* CompareNetsReportFirst * * Runs 4 comparisons between binary control nets (reporting only * the first difference)... * a) cnet1 vs cnet1, should be identical * b) cnet2 vs cnet2, should be identical * c) cnet1 vs cnet2 * d) cnet1 vs cnet2 with sample residual tolerance of 1.5 * given in the input file diffs1.txt */
| 576 | * given in the input file diffs1.txt |
| 577 | */ |
| 578 | TEST_F(CompareNetsReportFirstDiff, FunctionalTestCnetdiffReportFirst) { |
| 579 | QVector<QString> args = {"from=" + cnetFile1, |
| 580 | "from2=" + cnetFile1, |
| 581 | "to=" + tempDir.path() + "/compareSame1.txt" |
| 582 | }; |
| 583 | |
| 584 | UserInterface ui1(APP_XML, args); |
| 585 | |
| 586 | Pvl log; |
| 587 | |
| 588 | try { |
| 589 | log = cnetdiff(ui1); |
| 590 | } |
| 591 | catch(IException &e) { |
| 592 | FAIL() << e.toString().toStdString().c_str() << std::endl; |
| 593 | } |
| 594 | |
| 595 | // read back CompareSame1 output file |
| 596 | Pvl comparePvlSame1; |
| 597 | try { |
| 598 | comparePvlSame1.read(tempDir.path()+ "/compareSame1.txt"); |
| 599 | } |
| 600 | catch (IException &e) { |
| 601 | FAIL() << "Unable to open error log pvl file: " << e.what() << std::endl; |
| 602 | } |
| 603 | |
| 604 | PvlGroup &results = comparePvlSame1.findGroup("Results", Pvl::Traverse); |
| 605 | EXPECT_EQ(results["Compare"][0].toStdString(), "Identical"); |
| 606 | |
| 607 | // cnet2 vs cnet2 |
| 608 | args = {"from=" + cnetFile2, |
| 609 | "from2=" + cnetFile2, |
| 610 | "to=" + tempDir.path() + "/compareSame2.txt" |
| 611 | }; |
| 612 | |
| 613 | UserInterface ui2(APP_XML, args); |
| 614 | |
| 615 | try { |
| 616 | log = cnetdiff(ui2); |
| 617 | } |
| 618 | catch(IException &e) { |
| 619 | FAIL() << e.toString().toStdString().c_str() << std::endl; |
| 620 | } |
| 621 | |
| 622 | // read back CompareSame2 output file |
| 623 | Pvl comparePvlSame2; |
| 624 | try { |
| 625 | comparePvlSame2.read(tempDir.path()+ "/compareSame2.txt"); |
| 626 | } |
| 627 | catch (IException &e) { |
| 628 | FAIL() << "Unable to open error log pvl file: " << e.what() << std::endl; |
| 629 | } |
| 630 | |
| 631 | results = comparePvlSame2.findGroup("Results", Pvl::Traverse); |
| 632 | EXPECT_EQ(results["Compare"][0].toStdString(), "Identical"); |
| 633 | |
| 634 | // cnet1 vs cnet2 |
| 635 | args = {"from=" + cnetFile1, |
nothing calls this directly
no test coverage detected