Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added error tests for jigsaw #4093

Merged
merged 6 commits into from
Oct 30, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added last test
  • Loading branch information
Kelvin committed Oct 27, 2020
commit 8fa9ba3b7014eb456e0ba8ed77bee8ff89a6f93c
35 changes: 35 additions & 0 deletions isis/tests/FunctionalTestsJigsaw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ TEST_F(ObservationPair, FunctionalTestJigsawErrorNoNet) {
}
}


TEST_F(ObservationPair, FunctionalTestJigsawErrorTBParamsNoTarget) {
QTemporaryDir prefix;
QString outCnetFileName = prefix.path() + "/outTemp.net";
Expand All @@ -204,3 +205,37 @@ TEST_F(ObservationPair, FunctionalTestJigsawErrorTBParamsNoTarget) {
EXPECT_THAT(e.what(), HasSubstr("Input Target parameters file missing main Target object"));
}
}


TEST_F(ObservationPair, FunctionalTestJigsawErrorTBParamsNoSolve) {
QTemporaryDir prefix;
QString outCnetFileName = prefix.path() + "/outTemp.net";

std::istringstream iss(R"(
Object = Target
Group = "NAME"
Name=Enceladus
EndGroup
END_OBJECT
)");

QString tbsolvepath = "/tmp/tbsolve.pvl";
Pvl tbsolve;
iss >> tbsolve;
tbsolve.write(tbsolvepath);

// just use isdPath for a valid PVL file without the wanted groups
QVector<QString> args = {"fromlist="+cubeListFile, "cnet="+cnetPath, "onet="+outCnetFileName, "SOLVETARGETBODY=TRUE", "tbparameters="+tbsolvepath};

UserInterface options(APP_XML, args);

Pvl log;

try {
jigsaw(options, &log);
FAIL() << "Should throw an exception" << std::endl;
}
catch (IException &e) {
EXPECT_THAT(e.what(), HasSubstr("Must solve for at least one target body option"));
}
}