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

Testing changes to getsnalltrue #4020

Closed
wants to merge 13 commits into from
23 changes: 12 additions & 11 deletions isis/tests/FunctionalTestsGetsn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,19 @@ static QString APP_XML = FileName("$ISISROOT/bin/xml/getsn.xml").expanded();

// check for all correct outputs
TEST_F(DefaultCube, FunctionalTestGetsnAllTrue) {
QString d_APP_XML = FileName("$ISISROOT/bin/xml/getsn.xml").expanded();
QString expectedSN = "Viking1/VISB/33322515";
QString expectedON = "Viking1/VISB/33322515";
QVector<QString> args = {
"FILE=TRUE",
QVector<QString> args = { "FILE=TRUE",
"SN=TRUE",
"OBSERVATION=TRUE"};
UserInterface options(APP_XML, args);
UserInterface options(d_APP_XML, args);
Pvl appLog;

ASSERT_TRUE(1==1);
getsn( testCube, options, &appLog );
PvlGroup results = appLog.findGroup("Results");
PvlGroup results = appLog.findGroup("Results");

EXPECT_PRED_FORMAT2(AssertQStringsEqual, results.findKeyword("Filename"), testCube->fileName());
EXPECT_PRED_FORMAT2(AssertQStringsEqual, results.findKeyword("SerialNumber"), expectedSN);
EXPECT_PRED_FORMAT2(AssertQStringsEqual, results.findKeyword("ObservationNumber"), expectedON);
Expand Down Expand Up @@ -66,9 +67,9 @@ TEST_F(DefaultCube, FunctionalTestGetsnDefaultTrue) {
Pvl appLog;
Pvl *testLabel = testCube->label();
testLabel->findObject( "IsisCube" ).deleteGroup( "Instrument" );

getsn( testCube, options, &appLog );
PvlGroup results = appLog.findGroup("Results");
PvlGroup results = appLog.findGroup("Results");

EXPECT_PRED_FORMAT2(AssertQStringsEqual, fileName , results.findKeyword("SerialNumber"));
}
Expand All @@ -83,9 +84,9 @@ TEST_F(DefaultCube, FunctionalTestGetsnDefaultFalse) {
Pvl appLog;
Pvl *testLabel = testCube->label();
testLabel->findObject( "IsisCube" ).deleteGroup( "Instrument" );

getsn( testCube, options, &appLog );
PvlGroup results = appLog.findGroup("Results");
PvlGroup results = appLog.findGroup("Results");

EXPECT_PRED_FORMAT2(AssertQStringsEqual, fileName , results.findKeyword("SerialNumber"));
}
Expand Down Expand Up @@ -114,7 +115,7 @@ TEST_F(DefaultCube, FunctionalTestGetsnFlat) {
// Test that append true appends to file
TEST_F(DefaultCube, FunctionalTestGetsnAppend) {
QFile flatFile(tempDir.path()+"testOut.txt");
QVector<QString> args = {
QVector<QString> args = {
"FORMAT=FLAT",
"TO="+flatFile.fileName(),
"APPEND=TRUE"};
Expand All @@ -133,7 +134,7 @@ TEST_F(DefaultCube, FunctionalTestGetsnAppend) {
// Test that append false overwrites file
TEST_F(DefaultCube, FunctionalTestGetsnOverwrite) {
QFile flatFile(tempDir.path()+"testOut.txt");
QVector<QString> args = {
QVector<QString> args = {
"FORMAT=FLAT",
"TO="+flatFile.fileName(),
"APPEND=FALSE"};
Expand Down