Skip to content

Commit

Permalink
Adds apollo fixture (#4080)
Browse files Browse the repository at this point in the history
* jigsaw to app conversion and remove unnecessary tests

* Updated based on comments

* Updated spacing

* Adds apollo fixture for jigsaw tests

* Updated to use pvl control network

* Updated based on comments

* remove accidental jigsaw test commit

* Update Jigsaw apollo test based on feedback

* Updated botched merge

* Remove accidentally updated files

* Adding a space to try to trigger Jenkins
  • Loading branch information
krlberry authored Oct 29, 2020
1 parent 72da4da commit bee0df2
Show file tree
Hide file tree
Showing 17 changed files with 25,061 additions and 3 deletions.
150 changes: 148 additions & 2 deletions isis/tests/Fixtures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "Fixtures.h"
#include "LineManager.h"
#include "SpecialPixel.h"
#include "ControlNet.h"

namespace Isis {

Expand Down Expand Up @@ -253,7 +254,153 @@ namespace Isis {
delete threeImageOverlapFile;
delete twoImageOverlapFile;
}


void ApolloNetwork::SetUp() {
TempTestingFiles::SetUp();

isdFile1 = new FileName("data/apolloNetwork/apolloImage1.isd");
isdFile2 = new FileName("data/apolloNetwork/apolloImage2.isd");
isdFile3 = new FileName("data/apolloNetwork/apolloImage3.isd");
isdFile4 = new FileName("data/apolloNetwork/apolloImage4.isd");
isdFile5 = new FileName("data/apolloNetwork/apolloImage5.isd");
isdFile6 = new FileName("data/apolloNetwork/apolloImage6.isd");
isdFile7 = new FileName("data/apolloNetwork/apolloImage7.isd");

label1 = new FileName("data/apolloNetwork/apolloImage1.pvl");
label2 = new FileName("data/apolloNetwork/apolloImage2.pvl");
label3 = new FileName("data/apolloNetwork/apolloImage3.pvl");
label4 = new FileName("data/apolloNetwork/apolloImage4.pvl");
label5 = new FileName("data/apolloNetwork/apolloImage5.pvl");
label6 = new FileName("data/apolloNetwork/apolloImage6.pvl");
label7 = new FileName("data/apolloNetwork/apolloImage7.pvl");

cube1 = new Cube();
cube1->fromIsd(tempDir.path() + "/cube1.cub", *label1, *isdFile1, "rw");

cube2 = new Cube();
cube2->fromIsd(tempDir.path() + "/cube2.cub", *label2, *isdFile2, "rw");

cube3 = new Cube();
cube3->fromIsd(tempDir.path() + "/cube3.cub", *label3, *isdFile3, "rw");

cube4 = new Cube();
cube4->fromIsd(tempDir.path() + "/cube4.cub", *label4, *isdFile4, "rw");

cube5 = new Cube();
cube5->fromIsd(tempDir.path() + "/cube5.cub", *label5, *isdFile5, "rw");

cube6 = new Cube();
cube6->fromIsd(tempDir.path() + "/cube6.cub", *label6, *isdFile6, "rw");

cube7 = new Cube();
cube7->fromIsd(tempDir.path() + "/cube7.cub", *label7, *isdFile7, "rw");

cubeList = new FileList();
cubeList->append(cube1->fileName());
cubeList->append(cube2->fileName());
cubeList->append(cube3->fileName());
cubeList->append(cube4->fileName());
cubeList->append(cube5->fileName());
cubeList->append(cube6->fileName());
cubeList->append(cube7->fileName());

cubeListFile = tempDir.path() + "/cubes.lis";
cubeList->write(cubeListFile);

ControlNet inputNet("data/apolloNetwork/apolloNet.pvl");
controlNetPath = tempDir.path() + "/apolloNet.net";
inputNet.Write(controlNetPath);
}

void ApolloNetwork::TearDown() {
if (cube1->isOpen()) {
cube1->close();
}

if (cube2->isOpen()) {
cube1->close();
}

if (cube3->isOpen()) {
cube1->close();
}

if (cube4->isOpen()) {
cube1->close();
}

if (cube5->isOpen()) {
cube1->close();
}

if (cube6->isOpen()) {
cube1->close();
}

if (cube7->isOpen()) {
cube1->close();
}

if (isdFile1) {
delete isdFile1;
}

if (isdFile2) {
delete isdFile2;
}

if (isdFile3) {
delete isdFile3;
}

if (isdFile4) {
delete isdFile4;
}

if (isdFile5) {
delete isdFile5;
}

if (isdFile6) {
delete isdFile6;
}

if (isdFile7) {
delete isdFile7;
}

if (cube1) {
delete cube1;
}

if (cube2) {
delete cube2;
}

if (cube3) {
delete cube3;
}

if (cube4) {
delete cube4;
}

if (cube5) {
delete cube5;
}

if (cube6) {
delete cube6;
}

if (cube7) {
delete cube7;
}

if (cubeList) {
delete cubeList;
}
}

void ObservationPair::SetUp() {
FileName labelPathL = FileName("data/observationPair/observationImageL.pvl");
Expand Down Expand Up @@ -453,5 +600,4 @@ namespace Isis {
FAIL() << "Failed to create Jitter file" << std::endl;
}
}

}
14 changes: 13 additions & 1 deletion isis/tests/Fixtures.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,19 @@ namespace Isis {
void TearDown() override;
};

class ApolloNetwork: public TempTestingFiles {
protected:
Cube *cube1, *cube2, *cube3, *cube4, *cube5, *cube6, *cube7;
FileName *isdFile1, *isdFile2, *isdFile3, *isdFile4, *isdFile5, *isdFile6, *isdFile7,
*cubeLabel, *label1, *label2, *label3, *label4, *label5, *label6, *label7;

FileList *cubeList;
QString cubeListFile;
QString controlNetPath;

void SetUp() override;
void TearDown() override;
};

class ObservationPair : public TempTestingFiles {
protected:
Expand Down Expand Up @@ -153,7 +166,6 @@ namespace Isis {

void setInstrument(QString ikid, QString instrumentId, QString spacecraftName);
};

}

#endif
Loading

0 comments on commit bee0df2

Please sign in to comment.