Unverified Commit b92d876b authored by Jesse Mapel's avatar Jesse Mapel Committed by GitHub
Browse files

Added small cube with image data fixture (#3893)

* Added small cube fixture

* fixed double definition
parent 9a9c3505
Loading
Loading
Loading
Loading
+30 −9
Original line number Diff line number Diff line
@@ -9,6 +9,35 @@ namespace Isis {
  }


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

    testCube = new Cube();
    testCube->setDimensions(10, 10, 10);
    testCube->create(tempDir.path() + "/small.cub");

    LineManager line(*testCube);
    double pixelValue = 0.0;
    for(line.begin(); !line.end(); line++) {
      for(int i = 0; i < line.size(); i++) {
        line[i] = (double) pixelValue++;
      }
      testCube->write(line);
    }

  }

  void SmallCube::TearDown() {
    if (testCube->isOpen()) {
      testCube->close();
    }

    if (testCube) {
      delete testCube;
    }
  }


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

@@ -23,14 +52,6 @@ namespace Isis {
    testCube = new Cube();
    testCube->fromIsd(tempDir.path() + "/default.cub", label, isd, "rw");

    LineManager line(*testCube);
    for(line.begin(); !line.end(); line++) {
      for(int i = 0; i < line.size(); i++) {
        line[i] = (double) 1;
      }
      testCube->write(line);
    }

    projTestCube = new Cube();
    projTestCube->fromIsd(tempDir.path() + "/default.level2.cub", projLabel, isd, "rw");
  }
+10 −0
Original line number Diff line number Diff line
@@ -32,6 +32,16 @@ namespace Isis {
  };



  class SmallCube : public TempTestingFiles {
    protected:
      Cube *testCube;

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


  class DefaultCube : public TempTestingFiles {
    protected:
      Cube *testCube;
+9 −9
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ using namespace Isis;

static QString APP_XML = FileName("$ISISROOT/bin/xml/enlarge.xml").expanded();

TEST_F(DefaultCube, FunctionalTestEnlargeDefaultParameters) {
TEST_F(SmallCube, FunctionalTestEnlargeDefaultParameters) {
  QVector<QString> args = {"to=" + tempDir.path()+"/output.cub"};
  UserInterface options(APP_XML, args);
  Pvl appLog;
@@ -34,7 +34,7 @@ TEST_F(DefaultCube, FunctionalTestEnlargeDefaultParameters) {
  EXPECT_DOUBLE_EQ( (double) groundPoint.findKeyword("OutputSamples"), 10);
}

TEST_F(DefaultCube, FunctionalTestEnlargeScale) {
TEST_F(SmallCube, FunctionalTestEnlargeScale) {
  QVector<QString> args = {"to=" + tempDir.path()+"/output.cub", "sscale=2", "lscale=4"};
  UserInterface options(APP_XML, args);
  Pvl appLog;
@@ -48,7 +48,7 @@ TEST_F(DefaultCube, FunctionalTestEnlargeScale) {
  EXPECT_DOUBLE_EQ( (double) groundPoint.findKeyword("OutputSamples"), 20);
}

TEST_F(DefaultCube, FunctionalTestEnlargeTotal) {
TEST_F(SmallCube, FunctionalTestEnlargeTotal) {
  QVector<QString> args = {"to=" + tempDir.path()+"/output.cub", "mode=total", "ons=20", "onl=40"};
  UserInterface options(APP_XML, args);
  Pvl appLog;
@@ -62,7 +62,7 @@ TEST_F(DefaultCube, FunctionalTestEnlargeTotal) {
  EXPECT_DOUBLE_EQ( (double) groundPoint.findKeyword("OutputSamples"), 20);
}

TEST_F(DefaultCube, FunctionalTestEnlargeSmallDimensions) {
TEST_F(SmallCube, FunctionalTestEnlargeSmallDimensions) {
  QVector<QString> args = {"to=" + tempDir.path()+"/output.cub", "mode=total", "ons=10", "onl=1"};
  UserInterface options(APP_XML, args);
  Pvl appLog;
@@ -80,7 +80,7 @@ TEST_F(DefaultCube, FunctionalTestEnlargeSmallDimensions) {
  }
}

TEST_F(DefaultCube, FunctionalTestEnlargeNearestNeighbor) {
TEST_F(SmallCube, FunctionalTestEnlargeNearestNeighbor) {
  QVector<QString> args = {"to=" + tempDir.path()+"/output.cub", "interp=nearestneighbor"};
  UserInterface options(APP_XML, args);
  Pvl appLog;
@@ -95,7 +95,7 @@ TEST_F(DefaultCube, FunctionalTestEnlargeNearestNeighbor) {
  EXPECT_DOUBLE_EQ( (double) groundPoint.findKeyword("OutputSamples"), 10);
}

TEST_F(DefaultCube, FunctionalTestEnlargeBilinear) {
TEST_F(SmallCube, FunctionalTestEnlargeBilinear) {
  QVector<QString> args = {"to=" + tempDir.path()+"/output.cub", "interp=bilinear"};
  UserInterface options(APP_XML, args);
  Pvl appLog;
−1.47 MiB (4.19 KiB)

File changed.

No diff preview for this file type.