Loading isis/tests/Fixtures.cpp +30 −9 Original line number Diff line number Diff line Loading @@ -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(); Loading @@ -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"); } Loading isis/tests/Fixtures.h +10 −0 Original line number Diff line number Diff line Loading @@ -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; Loading isis/tests/FunctionalTestsEnlarge.cpp +9 −9 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading @@ -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; Loading @@ -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; Loading @@ -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; Loading @@ -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; Loading isis/tests/data/defaultImage/defaultCube.pvl −1.47 MiB (4.19 KiB) File changed.No diff preview for this file type. View original file View changed file Loading
isis/tests/Fixtures.cpp +30 −9 Original line number Diff line number Diff line Loading @@ -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(); Loading @@ -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"); } Loading
isis/tests/Fixtures.h +10 −0 Original line number Diff line number Diff line Loading @@ -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; Loading
isis/tests/FunctionalTestsEnlarge.cpp +9 −9 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading @@ -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; Loading @@ -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; Loading @@ -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; Loading @@ -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; Loading
isis/tests/data/defaultImage/defaultCube.pvl −1.47 MiB (4.19 KiB) File changed.No diff preview for this file type. View original file View changed file