From 4704e2d6143191afa63c1dffb6973ee144806413 Mon Sep 17 00:00:00 2001 From: amystamile-usgs Date: Wed, 18 Sep 2024 13:47:59 -0700 Subject: [PATCH] final updates --- isis/src/near/apps/msi2isis/msi2isis.cpp | 34 ++--- isis/src/near/objs/MsiCamera/MsiCamera.cpp | 6 +- .../apps/leisa2isis/leisa2isis.cpp | 40 ++--- .../apps/lorri2isis/lorri2isis.cpp | 24 +-- .../newhorizons/apps/mvic2isis/mvic2isis.cpp | 44 +++--- .../NewHorizonsLeisaCamera.cpp | 4 +- .../objs/NewHorizonsLeisaCamera/unitTest.cpp | 10 +- .../NewHorizonsLorriCamera.cpp | 20 +-- .../objs/NewHorizonsLorriCamera/unitTest.cpp | 10 +- .../NewHorizonsMvicFrameCamera.cpp | 4 +- .../NewHorizonsMvicFrameCamera/unitTest.cpp | 10 +- .../NewHorizonsMvicTdiCamera.cpp | 4 +- .../NewHorizonsMvicTdiCamera/unitTest.cpp | 10 +- isis/src/odyssey/apps/thm2isis/thm2isis.cpp | 14 +- isis/src/odyssey/apps/thmbasemap1/main.cpp | 70 ++++----- isis/src/odyssey/apps/thmnoseam/main.cpp | 8 +- isis/src/odyssey/apps/thmproc/main.cpp | 10 +- isis/src/odyssey/apps/thmvisflat/main.cpp | 16 +- isis/src/odyssey/apps/thmvistrim/main.cpp | 2 +- .../odyssey/objs/ThemisIrCamera/unitTest.cpp | 10 +- .../objs/ThemisVisCamera/ThemisVisCamera.cpp | 4 +- .../odyssey/objs/ThemisVisCamera/unitTest.cpp | 4 +- isis/src/osirisrex/apps/ocams2isis/main.cpp | 10 +- .../apps/tagcams2isis/tagcams2isis.cpp | 22 +-- .../OsirisRexDistortionMap.cpp | 8 +- .../OsirisRexOcamsCamera.cpp | 2 +- .../OsirisRexOcamsDistortionMap.cpp | 10 +- .../OsirisRexTagcamsCamera.cpp | 2 +- .../OsirisRexTagcamsDistortionMap.cpp | 4 +- isis/src/rolo/apps/rolo2isis/main.cpp | 10 +- isis/src/rosetta/apps/rososiris2isis/main.cpp | 34 ++--- isis/src/rosetta/apps/rosvirtis2isis/main.cpp | 24 +-- .../RosettaOsirisCamera.cpp | 2 +- .../objs/RosettaOsirisCamera/unitTest.cpp | 16 +- .../RosettaVirtisCamera.cpp | 16 +- .../objs/RosettaVirtisCamera/unitTest.cpp | 10 +- .../socetlinescankeywords.cpp | 4 +- .../apps/tgocassis2isis/tgocassis2isis.cpp | 80 +++++----- .../tgo/apps/tgocassismos/tgocassismos.cpp | 8 +- .../apps/tgocassisrdrgen/tgocassisrdrgen.cpp | 6 +- .../apps/tgocassisstitch/tgocassisstitch.cpp | 42 +++--- .../tgocassisunstitch/tgocassisunstitch.cpp | 20 +-- .../objs/TgoCassisCamera/TgoCassisCamera.cpp | 2 +- .../TgoCassisDistortionMap.cpp | 8 +- .../src/tgo/objs/TgoCassisCamera/unitTest.cpp | 2 +- isis/src/viking/apps/vik2isis/main.cpp | 12 +- isis/src/viking/apps/vikcal/CalParameters.cpp | 116 +++++++-------- isis/src/viking/apps/vikcal/main.cpp | 6 +- isis/src/viking/apps/vikcal/vikcal.cpp | 8 +- isis/src/viking/apps/viknobutter/main.cpp | 8 +- .../viking/objs/VikingCamera/VikingCamera.cpp | 10 +- .../src/viking/objs/VikingCamera/unitTest.cpp | 14 +- isis/src/voyager/apps/voy2isis/main.cpp | 46 +++--- isis/src/voyager/apps/voycal/main.cpp | 20 +-- isis/src/voyager/apps/voyramp/main.cpp | 10 +- .../objs/VoyagerCamera/VoyagerCamera.cpp | 10 +- .../voyager/objs/VoyagerCamera/unitTest.cpp | 12 +- isis/tests/AffineTests.cpp | 4 +- isis/tests/AngleTest.cpp | 39 ++--- isis/tests/Area3DTests.cpp | 6 +- isis/tests/AutoseedTests.cpp | 16 +- isis/tests/BasisFunctionTests.cpp | 12 +- .../BundleObservationSolveSettingsTests.cpp | 30 ++-- isis/tests/BundleResultsTests.cpp | 12 +- isis/tests/BundleSettingsTests.cpp | 36 ++--- isis/tests/BundleSolutionInfoTests.cpp | 16 +- isis/tests/CSMCameraTests.cpp | 44 +++--- isis/tests/Cam2mapTests.cpp | 24 +-- isis/tests/CameraFixtures.cpp | 46 +++--- isis/tests/CnetWinnowTests.cpp | 2 +- isis/tests/ColorTests.cpp | 2 +- isis/tests/ColumnTests.cpp | 10 +- isis/tests/CsmFixtures.cpp | 12 +- isis/tests/CubeFixtures.cpp | 2 +- isis/tests/CubeTests.cpp | 2 +- isis/tests/DisplacementTests.cpp | 8 +- isis/tests/DistanceTests.cpp | 16 +- isis/tests/EndianTests.cpp | 5 +- isis/tests/FileNameTests.cpp | 44 +++--- isis/tests/FitsToJsonTests.cpp | 4 +- isis/tests/FunctionalTestsApollocal.cpp | 4 +- isis/tests/FunctionalTestsApollofindrx.cpp | 2 +- .../FunctionalTestsApollopanstitcher.cpp | 6 +- isis/tests/FunctionalTestsApolloremrx.cpp | 6 +- isis/tests/FunctionalTestsAutomos.cpp | 38 ++--- isis/tests/FunctionalTestsBandnorm.cpp | 12 +- isis/tests/FunctionalTestsBandtrim.cpp | 10 +- isis/tests/FunctionalTestsCam2cam.cpp | 8 +- isis/tests/FunctionalTestsCamdev.cpp | 4 +- isis/tests/FunctionalTestsCaminfo.cpp | 2 +- isis/tests/FunctionalTestsCampt.cpp | 10 +- isis/tests/FunctionalTestsCamrange.cpp | 2 +- isis/tests/FunctionalTestsCamstats.cpp | 2 +- isis/tests/FunctionalTestsChan1m32isis.cpp | 26 ++-- isis/tests/FunctionalTestsCiss2isis.cpp | 14 +- isis/tests/FunctionalTestsCkwriter.cpp | 24 +-- isis/tests/FunctionalTestsCnetbin2pvl.cpp | 2 +- isis/tests/FunctionalTestsCnetcheck.cpp | 2 +- isis/tests/FunctionalTestsCnetcombinept.cpp | 2 +- isis/tests/FunctionalTestsCnetdiff.cpp | 18 +-- isis/tests/FunctionalTestsCnetedit.cpp | 54 +++---- isis/tests/FunctionalTestsCnetextract.cpp | 38 ++--- isis/tests/FunctionalTestsCnetpvl2bin.cpp | 2 +- isis/tests/FunctionalTestsCnetstats.cpp | 4 +- isis/tests/FunctionalTestsCnetthinner.cpp | 40 ++--- isis/tests/FunctionalTestsCrism2isis.cpp | 18 +-- isis/tests/FunctionalTestsCrop.cpp | 14 +- isis/tests/FunctionalTestsCsminit.cpp | 10 +- isis/tests/FunctionalTestsCtxcal.cpp | 14 +- isis/tests/FunctionalTestsCubeatt.cpp | 14 +- isis/tests/FunctionalTestsDemprep.cpp | 22 +-- isis/tests/FunctionalTestsEis2isis.cpp | 16 +- isis/tests/FunctionalTestsEnlarge.cpp | 4 +- isis/tests/FunctionalTestsFillGap.cpp | 40 ++--- isis/tests/FunctionalTestsFindGaps.cpp | 14 +- isis/tests/FunctionalTestsFindfeatures.cpp | 6 +- .../FunctionalTestsFindimageoverlaps.cpp | 24 +-- isis/tests/FunctionalTestsFits2isis.cpp | 16 +- isis/tests/FunctionalTestsFootprintinit.cpp | 2 +- isis/tests/FunctionalTestsFrameStitch.cpp | 34 ++--- isis/tests/FunctionalTestsGaussstretch.cpp | 4 +- isis/tests/FunctionalTestsGetsn.cpp | 14 +- isis/tests/FunctionalTestsGllssical.cpp | 8 +- isis/tests/FunctionalTestsGrid.cpp | 4 +- isis/tests/FunctionalTestsHi2isis.cpp | 8 +- isis/tests/FunctionalTestsHical.cpp | 22 +-- isis/tests/FunctionalTestsHicolormos.cpp | 4 +- isis/tests/FunctionalTestsHicrop.cpp | 16 +- isis/tests/FunctionalTestsHicubeit.cpp | 6 +- isis/tests/FunctionalTestsHicubenorm.cpp | 12 +- isis/tests/FunctionalTestsHidtmgen.cpp | 20 +-- isis/tests/FunctionalTestsHimos.cpp | 42 +++--- isis/tests/FunctionalTestsHist.cpp | 2 +- isis/tests/FunctionalTestsHrsc2isis.cpp | 14 +- isis/tests/FunctionalTestsHyb2onc2isis.cpp | 6 +- isis/tests/FunctionalTestsIsis2Std.cpp | 20 +-- isis/tests/FunctionalTestsIsis2ascii.cpp | 2 +- isis/tests/FunctionalTestsIsis2pds.cpp | 4 +- isis/tests/FunctionalTestsIsisDataEval.cpp | 10 +- isis/tests/FunctionalTestsIsisImport.cpp | 2 +- .../FunctionalTestsIsisImportCassiniISS.cpp | 14 +- isis/tests/FunctionalTestsIsisImportEis.cpp | 18 +-- .../FunctionalTestsIsisImportKaguyaMI.cpp | 30 ++-- .../FunctionalTestsIsisImportKaguyaTC.cpp | 2 +- isis/tests/FunctionalTestsIsisImportLo.cpp | 22 +-- .../tests/FunctionalTestsIsisImportLroNac.cpp | 11 +- isis/tests/FunctionalTestsIsisImportMerMI.cpp | 2 +- isis/tests/FunctionalTestsIsisexport.cpp | 4 +- isis/tests/FunctionalTestsJigsaw.cpp | 44 +++--- isis/tests/FunctionalTestsJitterfit.cpp | 4 +- isis/tests/FunctionalTestsKaguyami2isis.cpp | 30 ++-- isis/tests/FunctionalTestsKaguyatc2isis.cpp | 10 +- isis/tests/FunctionalTestsKerneldbgen.cpp | 2 +- isis/tests/FunctionalTestsLeisa2isis.cpp | 36 ++--- isis/tests/FunctionalTestsLo2isis.cpp | 22 +-- isis/tests/FunctionalTestsLorri2isis.cpp | 16 +- isis/tests/FunctionalTestsLrolola2isis.cpp | 6 +- isis/tests/FunctionalTestsLronac2isis.cpp | 10 +- isis/tests/FunctionalTestsLronac2pds.cpp | 2 +- isis/tests/FunctionalTestsLronaccal.cpp | 48 +++--- isis/tests/FunctionalTestsLronacpho.cpp | 14 +- isis/tests/FunctionalTestsLrowac2isis.cpp | 32 ++-- isis/tests/FunctionalTestsLrowac2pds.cpp | 2 +- isis/tests/FunctionalTestsLrowaccal.cpp | 6 +- isis/tests/FunctionalTestsLrowacphomap.cpp | 10 +- isis/tests/FunctionalTestsMap2map.cpp | 12 +- isis/tests/FunctionalTestsMapmos.cpp | 48 +++--- isis/tests/FunctionalTestsMappt.cpp | 6 +- isis/tests/FunctionalTestsMaptrim.cpp | 10 +- isis/tests/FunctionalTestsMarci2isis.cpp | 14 +- isis/tests/FunctionalTestsMarcical.cpp | 10 +- isis/tests/FunctionalTestsMarciflip.cpp | 6 +- isis/tests/FunctionalTestsMimap2isis.cpp | 18 +-- isis/tests/FunctionalTestsMoccal.cpp | 12 +- isis/tests/FunctionalTestsMosrange.cpp | 14 +- isis/tests/FunctionalTestsMsi2isis.cpp | 22 +-- isis/tests/FunctionalTestsMvic2isis.cpp | 26 ++-- isis/tests/FunctionalTestsNocam2map.cpp | 6 +- isis/tests/FunctionalTestsNoproj.cpp | 50 +++---- isis/tests/FunctionalTestsOverlapstats.cpp | 42 +++--- isis/tests/FunctionalTestsPds2isis.cpp | 40 ++--- isis/tests/FunctionalTestsPhocube.cpp | 22 +-- isis/tests/FunctionalTestsPhotrim.cpp | 22 +-- isis/tests/FunctionalTestsPointreg.cpp | 22 +-- isis/tests/FunctionalTestsReduce.cpp | 12 +- isis/tests/FunctionalTestsRingsautomos.cpp | 16 +- isis/tests/FunctionalTestsSegment.cpp | 18 +-- isis/tests/FunctionalTestsShadow.cpp | 12 +- isis/tests/FunctionalTestsSkypt.cpp | 6 +- .../FunctionalTestsSocetlinescankeywords.cpp | 2 +- isis/tests/FunctionalTestsSpiceinit.cpp | 20 +-- isis/tests/FunctionalTestsSpiceserver.cpp | 8 +- isis/tests/FunctionalTestsSpkwriter.cpp | 24 +-- isis/tests/FunctionalTestsStd2isis.cpp | 12 +- isis/tests/FunctionalTestsStretch.cpp | 6 +- isis/tests/FunctionalTestsSumspice.cpp | 10 +- isis/tests/FunctionalTestsTagcams2isis.cpp | 18 +-- isis/tests/FunctionalTestsTgocassis2isis.cpp | 30 ++-- isis/tests/FunctionalTestsTgocassisstitch.cpp | 10 +- .../FunctionalTestsTgocassisunstitch.cpp | 18 +-- isis/tests/FunctionalTestsThm2isis.cpp | 10 +- isis/tests/FunctionalTestsVikcal.cpp | 8 +- isis/tests/GaussianDistributionTests.cpp | 2 +- isis/tests/IDTests.cpp | 6 +- isis/tests/ImageImporterTests.cpp | 6 +- isis/tests/IsisDataFixtures.cpp | 6 +- isis/tests/LatitudeTests.cpp | 18 +-- isis/tests/LineEquationTests.cpp | 24 +-- isis/tests/Map2camTests.cpp | 4 +- isis/tests/MatrixTests.cpp | 64 ++++---- isis/tests/NetworkFixtures.cpp | 72 ++++----- isis/tests/PvlObjectTests.cpp | 4 +- isis/tests/SensorUtilWrappersTests.cpp | 2 +- isis/tests/SpiceRotationTests.cpp | 2 +- isis/tests/TestUtilities.cpp | 24 +-- isis/tests/TgoCassisModuleTests.cpp | 140 +++++++++--------- isis/tests/UnitTestImagePolygon.cpp | 20 +-- isis/tests/UnitTestMarciCam.cpp | 2 +- isis/tests/UnitTestOsirisRexTagCams.cpp | 4 +- isis/tests/iTimeTests.cpp | 16 +- 220 files changed, 1809 insertions(+), 1810 deletions(-) diff --git a/isis/src/near/apps/msi2isis/msi2isis.cpp b/isis/src/near/apps/msi2isis/msi2isis.cpp index cbd4c6fd6f..66c17e28c5 100644 --- a/isis/src/near/apps/msi2isis/msi2isis.cpp +++ b/isis/src/near/apps/msi2isis/msi2isis.cpp @@ -38,8 +38,8 @@ namespace Isis { void msi2isis( UserInterface &ui, Pvl *log ) { // get the label for the input image - FileName from = ui.GetFileName("FROM"); - if (from.extension().toUpper() != "LBL") { + FileName from = ui.GetFileName("FROM").toStdString(); + if (IString(from.extension()).UpCase() != "LBL") { from = from.setExtension("lbl"); if (!from.fileExists()) { from = from.setExtension("LBL"); @@ -47,7 +47,7 @@ namespace Isis { if (!from.fileExists()) { throw IException(IException::Io, "Unable to find PDS label file for [" - + ui.GetFileName("FROM") + "].", + + ui.GetFileName("FROM").toStdString() + "].", _FILEINFO_); } } @@ -63,7 +63,7 @@ namespace Isis { ProcessImportPds importPds; Pvl inputLabelPvl; - importPds.SetPdsFile(from.expanded(), "", inputLabelPvl); + importPds.SetPdsFile(QString::fromStdString(from.expanded()), "", inputLabelPvl); // from the pds label, verfify that the image is valid before continuing @@ -71,7 +71,7 @@ namespace Isis { throw IException(IException::Io, "The input label [" + from.expanded() + "] has an invalid " "value for INSTRUMENT_ID = [" - + QString::fromStdString(inputLabelPvl["INSTRUMENT_ID"][0]) + + inputLabelPvl["INSTRUMENT_ID"][0] + "]. The msi2isis program requires INSTRUMENT_ID = [MSI].", _FILEINFO_); } @@ -81,14 +81,14 @@ namespace Isis { std::string msg = "The given file [" + from.expanded() + "] does not contain " "a full MSI image. Full NEAR Shoemaker MSI images have " "dimension 537 samples x 244 (or 412) lines. The given image is [" - + QString(toString(samples)) + "] samples by [" - + QString(toString(lines)) + "] lines."; + + toString(samples) + "] samples by [" + + toString(lines) + "] lines."; throw IException(IException::Io, msg, _FILEINFO_); } if (inputLabelPvl["SAMPLE_DISPLAY_DIRECTION"][0] != "RIGHT") { std::string msg = "The input label [" + from.expanded() + "] has an invalid " "value for SAMPLE_DISPLAY_DIRECTION = [" - + QString::fromStdString(inputLabelPvl["SAMPLE_DISPLAY_DIRECTION"][0]) + + inputLabelPvl["SAMPLE_DISPLAY_DIRECTION"][0] + "]. The msi2isis program requires " "SAMPLE_DISPLAY_DIRECTION = [RIGHT]."; throw IException(IException::Io, msg, _FILEINFO_); @@ -96,7 +96,7 @@ namespace Isis { if (inputLabelPvl["LINE_DISPLAY_DIRECTION"][0] != "UP") { std::string msg = "The input label [" + from.expanded() + "] has an invalid " "value for LINE_DISPLAY_DIRECTION = [" - + QString::fromStdString(inputLabelPvl["LINE_DISPLAY_DIRECTION"][0]) + + inputLabelPvl["LINE_DISPLAY_DIRECTION"][0] + "]. The msi2isis program requires " "LINE_DISPLAY_DIRECTION = [UP]."; throw IException(IException::Io, msg, _FILEINFO_); @@ -113,7 +113,7 @@ namespace Isis { // the given input file appears to be valid, continue with the import process FileName importProcessOutCube = FileName::createTempFile("$Temporary/" + from.baseName() + ".import.tmp.cub"); CubeAttributeOutput outatt = CubeAttributeOutput("+Real"); - importPds.SetOutputCube(importProcessOutCube.expanded(), outatt); + importPds.SetOutputCube(QString::fromStdString(importProcessOutCube.expanded()), outatt); importPds.StartProcess(); importPds.Finalize(); importPds.ClearCubes(); @@ -124,8 +124,8 @@ namespace Isis { if ( 412 != lines ) { // The second process will enlarge the imported cube from 537x244 to 537x412 ProcessRubberSheet enlargeProcess; - Cube *cube = enlargeProcess.SetInputCube(importProcessOutCube.expanded(), inatt); - enlargeProcess.SetOutputCube(enlargeProcessOutCube.expanded(), outatt, 537, 412, 1); + Cube *cube = enlargeProcess.SetInputCube(QString::fromStdString(importProcessOutCube.expanded()), inatt); + enlargeProcess.SetOutputCube(QString::fromStdString(enlargeProcessOutCube.expanded()), outatt, 537, 412, 1); // Set up the interpolator QScopedPointer interp; @@ -155,7 +155,7 @@ namespace Isis { // The third (last) process will flip the image lines and set the 33 pixels // along each border (top, bottom, left, and right) to null. ProcessBySample processSamps; - processSamps.SetInputCube(enlargeProcessOutCube.expanded(), inatt); + processSamps.SetInputCube(QString::fromStdString(enlargeProcessOutCube.expanded()), inatt); QString fname = ui.GetCubeName("TO"); CubeAttributeOutput &atts = ui.GetOutputAttribute("TO"); @@ -189,8 +189,8 @@ namespace Isis { translateMsiLabels(inputLabelPvl, isisLabelPvl); } catch ( IException &e) { - remove(importProcessOutCube.expanded().toLatin1()); - remove(enlargeProcessOutCube.expanded().toLatin1()); + remove(importProcessOutCube.expanded().c_str()); + remove(enlargeProcessOutCube.expanded().c_str()); std::string msg = "Unable to translate the labels from [" + from.expanded() + "] to ISIS format using msi2isis."; throw IException(e, IException::Unknown, msg, _FILEINFO_); @@ -245,8 +245,8 @@ namespace Isis { // clean up temp files and "new" pointers - remove(importProcessOutCube.expanded().toLatin1()); - remove(enlargeProcessOutCube.expanded().toLatin1()); + remove(importProcessOutCube.expanded().c_str()); + remove(enlargeProcessOutCube.expanded().c_str()); } diff --git a/isis/src/near/objs/MsiCamera/MsiCamera.cpp b/isis/src/near/objs/MsiCamera/MsiCamera.cpp index d0ba4feec0..9ddc299dfd 100644 --- a/isis/src/near/objs/MsiCamera/MsiCamera.cpp +++ b/isis/src/near/objs/MsiCamera/MsiCamera.cpp @@ -79,12 +79,12 @@ namespace Isis { CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode()); // Make sure to grab lines and samples in the correct order. - double line = Spice::getDouble("INS" + toString(naifIkCode()) + "_BORESIGHT_LINE"); - double sample = Spice::getDouble("INS" + toString(naifIkCode()) + "_BORESIGHT_SAMPLE"); + double line = Spice::getDouble("INS" + QString::number(naifIkCode()) + "_BORESIGHT_LINE"); + double sample = Spice::getDouble("INS" + QString::number(naifIkCode()) + "_BORESIGHT_SAMPLE"); focalMap->SetDetectorOrigin(sample, line); // Setup distortion map - double k1 = Spice::getDouble("INS" + toString(naifIkCode()) + "_K1"); + double k1 = Spice::getDouble("INS" + QString::number(naifIkCode()) + "_K1"); new RadialDistortionMap(this, k1, 1); // Setup the ground and sky map diff --git a/isis/src/newhorizons/apps/leisa2isis/leisa2isis.cpp b/isis/src/newhorizons/apps/leisa2isis/leisa2isis.cpp index bd86d87a5a..c7a8de97b3 100644 --- a/isis/src/newhorizons/apps/leisa2isis/leisa2isis.cpp +++ b/isis/src/newhorizons/apps/leisa2isis/leisa2isis.cpp @@ -34,23 +34,23 @@ namespace Isis { void leisa2isis(UserInterface &ui, Pvl *log) { ProcessImportFits importFits; - importFits.setFitsFile(FileName(ui.GetFileName("FROM"))); + importFits.setFitsFile(FileName(ui.GetFileName("FROM").toStdString())); PvlGroup mainLabel; mainLabel = importFits.fitsImageLabel(0); // Get the first label and make sure this is a New Horizons LEISA file if (!mainLabel.hasKeyword("MISSION") || !mainLabel.hasKeyword("INSTRU")) { - std::string msg = QObject::tr("Input file [%1] does not appear to be a New Horizons LEISA FITS " + QString msg = QObject::tr("Input file [%1] does not appear to be a New Horizons LEISA FITS " "file. Input file label key MISSION or INSTRU is missing"). arg(ui.GetFileName("FROM")); - throw IException(IException::User, msg, _FILEINFO_); + throw IException(IException::User, msg.toStdString(), _FILEINFO_); } else if (mainLabel["MISSION"][0] != "New Horizons" || mainLabel["INSTRU"][0] != "lei") { - std::string msg = QObject::tr("Input file [%1] does not appear to be a New Horizons LEISA FITS " + QString msg = QObject::tr("Input file [%1] does not appear to be a New Horizons LEISA FITS " "file. Input file label value for MISSION is [%2], INSTRU is [%3]"). arg(ui.GetFileName("FROM")).arg(QString::fromStdString(mainLabel["MISSION"][0])). arg(QString::fromStdString(mainLabel["INSTRU"][0])); - throw IException(IException::User, msg, _FILEINFO_); + throw IException(IException::User, msg.toStdString(), _FILEINFO_); } bool replace = ui.GetBoolean("REPLACE"); @@ -81,8 +81,8 @@ namespace Isis { } **/ } catch (IException &e) { - std::string msg = QObject::tr("Unable to find errormap extension in [%1]").arg(ui.GetFileName("FROM")); - throw IException(e, IException::Unknown, msg, _FILEINFO_); + QString msg = QObject::tr("Unable to find errormap extension in [%1]").arg(ui.GetFileName("FROM")); + throw IException(e, IException::Unknown, msg.toStdString(), _FILEINFO_); } } @@ -113,8 +113,8 @@ namespace Isis { } **/ } catch (IException &e) { - std::string msg = QObject::tr("Unable to find quality extension in [%1]").arg(ui.GetFileName("FROM")); - throw IException(e, IException::Unknown, msg, _FILEINFO_); + QString msg = QObject::tr("Unable to find quality extension in [%1]").arg(ui.GetFileName("FROM")); + throw IException(e, IException::Unknown, msg.toStdString(), _FILEINFO_); } } @@ -130,7 +130,7 @@ namespace Isis { if (replace){ outputFile = FileName::createTempFile(FileName("$TEMPORARY/dn.cub")); importFits.SetPixelType(Isis::Real); - output = importFits.SetOutputCube(outputFile.toString(), att); + output = importFits.SetOutputCube(QString::fromStdString(outputFile.toString()), att); } else { if (importFits.PixelType() == Isis::None) { @@ -141,7 +141,7 @@ namespace Isis { } // Get the path where the New Horizons translation tables are. - QString transDir = "$ISISROOT/appdata/translations/"; + std::string transDir = "$ISISROOT/appdata/translations/"; // Temp storage of translated labels Pvl outLabel; @@ -151,7 +151,7 @@ namespace Isis { fitsLabel.addGroup(importFits.fitsImageLabel(0)); // Create an Instrument group FileName insTransFile(transDir + "NewHorizonsLeisaInstrument_fit.trn"); - PvlToPvlTranslationManager insXlater(fitsLabel, insTransFile.expanded()); + PvlToPvlTranslationManager insXlater(fitsLabel, QString::fromStdString(insTransFile.expanded())); insXlater.Auto(outLabel); // Modify/add Instument group keywords not handled by the translater @@ -165,19 +165,19 @@ namespace Isis { // Create an Archive group FileName archiveTransFile(transDir + "NewHorizonsLeisaArchive_fit.trn"); - PvlToPvlTranslationManager archiveXlater(fitsLabel, archiveTransFile.expanded()); + PvlToPvlTranslationManager archiveXlater(fitsLabel, QString::fromStdString(archiveTransFile.expanded())); archiveXlater.Auto(outLabel); output->putGroup(outLabel.findGroup("Archive", Pvl::Traverse)); //Create a Band Bin Group FileName bandTransFile(transDir + "NewHorizonsLeisaBandBin_fit.trn"); - PvlToPvlTranslationManager bandBinXlater(fitsLabel, bandTransFile.expanded()); + PvlToPvlTranslationManager bandBinXlater(fitsLabel, QString::fromStdString(bandTransFile.expanded())); bandBinXlater.Auto(outLabel); output->putGroup(outLabel.findGroup("BandBin", Pvl::Traverse)); // Create a Kernels group FileName kernelsTransFile(transDir + "NewHorizonsLeisaKernels_fit.trn"); - PvlToPvlTranslationManager kernelsXlater(fitsLabel, kernelsTransFile.expanded()); + PvlToPvlTranslationManager kernelsXlater(fitsLabel, QString::fromStdString(kernelsTransFile.expanded())); kernelsXlater.Auto(outLabel); output->putGroup(outLabel.findGroup("Kernels", Pvl::Traverse)); @@ -232,7 +232,7 @@ namespace Isis { cao.setPixelType(Isis::Real); } - outputCubeForLeisa2Isis = importFits.SetOutputCube(qualityFile.toString(), cao); + outputCubeForLeisa2Isis = importFits.SetOutputCube(QString::fromStdString(qualityFile.toString()), cao); importFits.Progress()->SetText("Preparing quality image for comparing against LEISA pixels"); importFits.StartProcess(processFunc); @@ -242,15 +242,15 @@ namespace Isis { // Now we have the temp cube and want to use fx to add it to the DN cube // fx f1=temp_quality.cub f2=temp_dn.cub to=output_name.cub equation="f1 + f2" QString parameters; - parameters += " F1= " + outputFile.toString(); - parameters += " F2= " + qualityFile.toString(); + parameters += " F1= " + QString::fromStdString(outputFile.toString()); + parameters += " F2= " + QString::fromStdString(qualityFile.toString()); parameters += " TO= " + ui.GetCubeName("TO"); parameters += " EQUATION=" + QString("\"f1+f2\""); ProgramLauncher::RunIsisProgram("fx", parameters); // Cleanup by removing temporary cubes - remove(qualityFile.toString().toStdString().c_str()); - remove(outputFile.toString().toStdString().c_str()); + remove(qualityFile.toString().c_str()); + remove(outputFile.toString().c_str()); } // Import the ERRORMAP image. It is the 6th image in the FITS file (i.e., 5th extension) diff --git a/isis/src/newhorizons/apps/lorri2isis/lorri2isis.cpp b/isis/src/newhorizons/apps/lorri2isis/lorri2isis.cpp index 05b607c24d..9986258d91 100644 --- a/isis/src/newhorizons/apps/lorri2isis/lorri2isis.cpp +++ b/isis/src/newhorizons/apps/lorri2isis/lorri2isis.cpp @@ -30,25 +30,25 @@ namespace Isis { ProcessImportFits importFits; - importFits.setFitsFile(FileName(ui.GetFileName("FROM"))); + importFits.setFitsFile(FileName(ui.GetFileName("FROM").toStdString())); // Get the first label and make sure this is a New Horizons LORRI file PvlGroup mainLabel = importFits.fitsImageLabel(0); if (mainLabel["MISSION"][0] != "New Horizons" || mainLabel["INSTRU"][0] != "lor") { - std::string msg = QObject::tr("Input file [%1] does not appear to be a New Horizons LORRI FITS " + QString msg = QObject::tr("Input file [%1] does not appear to be a New Horizons LORRI FITS " "file. Input file label value for MISSION is [%2] and INSTRU is [%3]"). arg(ui.GetFileName("FROM")).arg(QString::fromStdString(mainLabel["MISSION"][0])).arg(QString::fromStdString(mainLabel["INSTRU"][0])); - throw IException(IException::User, msg, _FILEINFO_); + throw IException(IException::User, msg.toStdString(), _FILEINFO_); } // Get the label of extension #1 and make sure this is a New Horizons LORRI Error image if (ui.WasEntered("ERROR")) { PvlGroup errorLabel = importFits.fitsImageLabel(1); if (errorLabel["XTENSION"][0] != "IMAGE" || errorLabel["EXTNAME"][0] != "LORRI Error image") { - std::string msg = QObject::tr("Input file [%1] does not appear to contain a LORRI Error image. " + QString msg = QObject::tr("Input file [%1] does not appear to contain a LORRI Error image. " "Input file label value for EXTNAME is [%2] and XTENSION is [%3]"). arg(ui.GetFileName("FROM")).arg(QString::fromStdString(errorLabel["EXTNAME"][0])).arg(QString::fromStdString(errorLabel["XTENSION"][0])); - throw IException(IException::User, msg, _FILEINFO_); + throw IException(IException::User, msg.toStdString(), _FILEINFO_); } } @@ -57,10 +57,10 @@ namespace Isis { PvlGroup qualityLabel = importFits.fitsImageLabel(2); if (qualityLabel["XTENSION"][0] != "IMAGE" || qualityLabel["EXTNAME"][0] != "LORRI Quality flag image") { - std::string msg = QObject::tr("Input file [%1] does not appear to contain a LORRI Quality image. " + QString msg = QObject::tr("Input file [%1] does not appear to contain a LORRI Quality image. " "Input file label value for EXTNAME is [%2] and XTENSION is [%3]"). arg(ui.GetFileName("FROM")).arg(QString::fromStdString(qualityLabel["EXTNAME"][0])).arg(QString::fromStdString(qualityLabel["XTENSION"][0])); - throw IException(IException::User, msg, _FILEINFO_); + throw IException(IException::User, msg.toStdString(), _FILEINFO_); } } @@ -70,7 +70,7 @@ namespace Isis { Cube *output = importFits.SetOutputCube(ui.GetCubeName("TO"), att); // Get the path where the New Horizons translation tables are. - QString transDir = "$ISISROOT/appdata/translations/"; + std::string transDir = "$ISISROOT/appdata/translations/"; // Temp storage of translated labels Pvl outLabel; @@ -81,7 +81,7 @@ namespace Isis { // Create an Instrument group FileName insTransFile(transDir + "NewHorizonsLorriInstrument_fit.trn"); - PvlToPvlTranslationManager insXlater(fitsLabel, insTransFile.expanded()); + PvlToPvlTranslationManager insXlater(fitsLabel, QString::fromStdString(insTransFile.expanded())); insXlater.Auto(outLabel); // Modify/add Instument group keywords not handled by the translater @@ -95,19 +95,19 @@ namespace Isis { // Create a Band Bin group FileName bandTransFile(transDir + "NewHorizonsLorriBandBin_fit.trn"); - PvlToPvlTranslationManager bandBinXlater(fitsLabel, bandTransFile.expanded()); + PvlToPvlTranslationManager bandBinXlater(fitsLabel, QString::fromStdString(bandTransFile.expanded())); bandBinXlater.Auto(outLabel); output->putGroup(outLabel.findGroup("BandBin", Pvl::Traverse)); // Create an Archive group FileName archiveTransFile(transDir + "NewHorizonsLorriArchive_fit.trn"); - PvlToPvlTranslationManager archiveXlater(fitsLabel, archiveTransFile.expanded()); + PvlToPvlTranslationManager archiveXlater(fitsLabel, QString::fromStdString(archiveTransFile.expanded())); archiveXlater.Auto(outLabel); output->putGroup(outLabel.findGroup("Archive", Pvl::Traverse)); // Create a Kernels group FileName kernelsTransFile(transDir + "NewHorizonsLorriKernels_fit.trn"); - PvlToPvlTranslationManager kernelsXlater(fitsLabel, kernelsTransFile.expanded()); + PvlToPvlTranslationManager kernelsXlater(fitsLabel, QString::fromStdString(kernelsTransFile.expanded())); kernelsXlater.Auto(outLabel); output->putGroup(outLabel.findGroup("Kernels", Pvl::Traverse)); diff --git a/isis/src/newhorizons/apps/mvic2isis/mvic2isis.cpp b/isis/src/newhorizons/apps/mvic2isis/mvic2isis.cpp index d33e6aacd0..0d0e15c7eb 100644 --- a/isis/src/newhorizons/apps/mvic2isis/mvic2isis.cpp +++ b/isis/src/newhorizons/apps/mvic2isis/mvic2isis.cpp @@ -34,7 +34,7 @@ namespace Isis { void mvic2isis(UserInterface &ui, Pvl *log) { ProcessImportFits importFits; - importFits.setFitsFile(FileName(ui.GetFileName("FROM"))); + importFits.setFitsFile(FileName(ui.GetFileName("FROM").toStdString())); // Get the primary FITS label Pvl primaryLabel; @@ -59,7 +59,7 @@ namespace Isis { } if (!mvic) { - FileName in = ui.GetFileName("FROM"); + FileName in = ui.GetFileName("FROM").toStdString(); std::string msg = "Input file [" + in.expanded() + "] does not appear to be " + "in New Horizons/MVIC FITS format."; throw IException(IException::User, msg, _FILEINFO_); @@ -73,9 +73,9 @@ namespace Isis { !QString::fromStdString(undistortedLabel["COMMENT"][0]).startsWith("This is the bias-subtracted, " "flattened, distortion-removed image cube.")) { - std::string msg = QObject::tr("Input file [%1] does not appear to contain an MVIC undistorted " + QString msg = QObject::tr("Input file [%1] does not appear to contain an MVIC undistorted " "image in XTENSION [2]").arg(ui.GetFileName("FROM")); - throw IException(IException::User, msg, _FILEINFO_); + throw IException(IException::User, msg.toStdString(), _FILEINFO_); } } @@ -86,9 +86,9 @@ namespace Isis { if (!errorLabel.hasKeyword("COMMENT") || errorLabel["COMMENT"][0] != "1-sigma error per pixel for the image in extension 1.") { - std::string msg = QObject::tr("Input file [%1] does not appear to contain an MVIC Error image " + QString msg = QObject::tr("Input file [%1] does not appear to contain an MVIC Error image " "in the XTENSION [3]").arg(ui.GetFileName("FROM")); - throw IException(IException::User, msg, _FILEINFO_); + throw IException(IException::User, msg.toStdString(), _FILEINFO_); } } @@ -99,15 +99,15 @@ namespace Isis { if (!qualityLabel.hasKeyword("COMMENT") || qualityLabel["COMMENT"][0] != "Data quality flag for the image in extension 1.") { - std::string msg = QObject::tr("Input file [%1] does not appear to contain an MVIC Quality image " + QString msg = QObject::tr("Input file [%1] does not appear to contain an MVIC Quality image " "in extension [3]").arg(ui.GetFileName("FROM")); - throw IException(IException::User, msg, _FILEINFO_); + throw IException(IException::User, msg.toStdString(), _FILEINFO_); } } // Convert the primary image QString bitpix = QString::fromStdString(primaryLabel.findKeyword("BITPIX", Pvl::Traverse)); - int bytesPerPix = abs(toInt(bitpix)) / 8; + int bytesPerPix = abs(bitpix.toInt()) / 8; importFits.SetDataPrefixBytes(bytesPerPix * 12); importFits.SetDataSuffixBytes(bytesPerPix * 12); importFits.setProcessFileStructure(0); @@ -134,7 +134,7 @@ namespace Isis { PvlGroup undistortedLabel = importFits.fitsImageLabel(1); QString bitpix = QString::fromStdString(undistortedLabel.findKeyword("BITPIX")); - int bytesPerPix = abs(toInt(bitpix)) / 8; + int bytesPerPix = abs(bitpix.toInt()) / 8; importFits.SetDataPrefixBytes(bytesPerPix * 12); importFits.SetDataSuffixBytes(bytesPerPix * 12); importFits.setProcessFileStructure(1); @@ -159,7 +159,7 @@ namespace Isis { // Get the label of the Error image and make sure this is a New Horizons MVIC Error image PvlGroup errorLabel = importFits.fitsImageLabel(2); QString bitpix = QString::fromStdString(errorLabel.findKeyword("BITPIX")); - int bytesPerPix = abs(toInt(bitpix)) / 8; + int bytesPerPix = abs(bitpix.toInt()) / 8; importFits.SetDataPrefixBytes(bytesPerPix * 12); importFits.SetDataSuffixBytes(bytesPerPix * 12); importFits.setProcessFileStructure(2); @@ -184,7 +184,7 @@ namespace Isis { // Get the label of the Error image and make sure this is a New Horizons MVIC Quality image PvlGroup qualityLabel = importFits.fitsImageLabel(3); QString bitpix = QString::fromStdString(qualityLabel.findKeyword("BITPIX")); - int bytesPerPix = abs(toInt(bitpix)) / 8; + int bytesPerPix = abs(bitpix.toInt()) / 8; importFits.SetDataPrefixBytes(bytesPerPix * 12); importFits.SetDataSuffixBytes(bytesPerPix * 12); importFits.setProcessFileStructure(3); @@ -207,12 +207,12 @@ namespace Isis { void translateLabels(Pvl &fitslabel, Cube *ocube) { // Get the path where the New Horizons translation tables are. - QString transDir = "$ISISROOT/appdata/translations/"; + std::string transDir = "$ISISROOT/appdata/translations/"; Pvl *isisLabel = ocube->label(); // Create an Instrument group FileName insTransFile(transDir + "NewHorizonsMvicInstrument_fit.trn"); - PvlToPvlTranslationManager insXlater(fitslabel, insTransFile.expanded()); + PvlToPvlTranslationManager insXlater(fitslabel, QString::fromStdString(insTransFile.expanded())); insXlater.Auto(*(isisLabel)); // Modify/add Instument group keywords not handled by the translater @@ -237,16 +237,16 @@ namespace Isis { // and spacecraft clock kernels to calculate time. NaifStatus::CheckErrors(); // Leapsecond kernel - QString lsk = "$ISISDATA/base/kernels/lsk/naif????.tls"; + std::string lsk = "$ISISDATA/base/kernels/lsk/naif????.tls"; FileName lskName(lsk); lskName = lskName.highestVersion(); - furnsh_c(lskName.expanded().toLatin1().data()); + furnsh_c(lskName.expanded().c_str()); // Spacecraft clock kernel - QString sclk = "$ISISDATA/newhorizons/kernels/sclk/new_horizons_???.tsc"; + std::string sclk = "$ISISDATA/newhorizons/kernels/sclk/new_horizons_???.tsc"; FileName sclkName(sclk); sclkName = sclkName.highestVersion(); - furnsh_c(sclkName.expanded().toLatin1().data()); + furnsh_c(sclkName.expanded().c_str()); SpiceInt sclkCode; if (fitslabel.hasKeyword("SPCSCID", Pvl::Traverse)) { @@ -266,7 +266,7 @@ namespace Isis { // Create a Band Bin group FileName bandTransFile(transDir + "NewHorizonsMvicBandBin_fit.trn"); - PvlToPvlTranslationManager bandBinXlater(fitslabel, bandTransFile.expanded()); + PvlToPvlTranslationManager bandBinXlater(fitslabel, QString::fromStdString(bandTransFile.expanded())); bandBinXlater.Auto(*(isisLabel)); // Add units and OriginalBand keyword PvlGroup &bandBin = isisLabel->findGroup("BandBin", Pvl::Traverse); @@ -296,18 +296,18 @@ namespace Isis { // Create an Archive group FileName archiveTransFile(transDir + "NewHorizonsMvicArchive_fit.trn"); - PvlToPvlTranslationManager archiveXlater(fitslabel, archiveTransFile.expanded()); + PvlToPvlTranslationManager archiveXlater(fitslabel, QString::fromStdString(archiveTransFile.expanded())); archiveXlater.Auto(*(isisLabel)); // Create a Kernels group FileName kernelsTransFile(transDir + "NewHorizonsMvicKernels_fit.trn"); - PvlToPvlTranslationManager kernelsXlater(fitslabel, kernelsTransFile.expanded()); + PvlToPvlTranslationManager kernelsXlater(fitslabel, QString::fromStdString(kernelsTransFile.expanded())); kernelsXlater.Auto(*(isisLabel)); // If Level 2 product, Create a RadiometricCalibration group if (fitslabel.hasKeyword("SOCL2VER", Pvl::Traverse)) { FileName calibrationTransFile(transDir + "NewHorizonsMvicCalibration_fit.trn"); - PvlToPvlTranslationManager calibrationXlater(fitslabel, calibrationTransFile.expanded()); + PvlToPvlTranslationManager calibrationXlater(fitslabel, QString::fromStdString(calibrationTransFile.expanded())); calibrationXlater.Auto(*(isisLabel)); // Add comments to calibration keywords. This is done by hand because the translation tables diff --git a/isis/src/newhorizons/objs/NewHorizonsLeisaCamera/NewHorizonsLeisaCamera.cpp b/isis/src/newhorizons/objs/NewHorizonsLeisaCamera/NewHorizonsLeisaCamera.cpp index ddf34bca3c..7d06d8a449 100644 --- a/isis/src/newhorizons/objs/NewHorizonsLeisaCamera/NewHorizonsLeisaCamera.cpp +++ b/isis/src/newhorizons/objs/NewHorizonsLeisaCamera/NewHorizonsLeisaCamera.cpp @@ -118,10 +118,10 @@ namespace Isis { */ void NewHorizonsLeisaCamera::SetBand(const int vband) { if ( (vband < 1) || (vband > m_originalBand.size())) { - std::string msg = QObject::tr("Band number out of array bounds in NewHorizonsLeisaCamera::SetBand " + QString msg = QObject::tr("Band number out of array bounds in NewHorizonsLeisaCamera::SetBand " "legal bands are [1-%1], input was [%2]"). arg(m_originalBand.size()).arg(vband); - throw IException(IException::Programmer, msg, _FILEINFO_); + throw IException(IException::Programmer, msg.toStdString(), _FILEINFO_); } int band; band = m_originalBand[vband-1]; diff --git a/isis/src/newhorizons/objs/NewHorizonsLeisaCamera/unitTest.cpp b/isis/src/newhorizons/objs/NewHorizonsLeisaCamera/unitTest.cpp index 95a3f14bc7..6fc6b8b220 100644 --- a/isis/src/newhorizons/objs/NewHorizonsLeisaCamera/unitTest.cpp +++ b/isis/src/newhorizons/objs/NewHorizonsLeisaCamera/unitTest.cpp @@ -36,7 +36,7 @@ int main(void) { Cube c("$ISISTESTDATA/isis/src/newhorizons/unitTestData/lsb_0034933739_0x53c_sci_1.cub", "r"); NewHorizonsLeisaCamera *cam = (NewHorizonsLeisaCamera *) CameraFactory::Create(c); - cout << "FileName: " << FileName(c.fileName()).name() << endl; + cout << "FileName: " << FileName(c.fileName().toStdString()).name() << endl; cout << "CK Frame: " << cam->instrumentRotation()->Frame() << endl << endl; cout.setf(std::ios::fixed); cout << setprecision(9); @@ -49,10 +49,10 @@ int main(void) { cout << "SPK Reference ID = " << cam->SpkReferenceId() << endl << endl; // Test name methods - cout << "Spacecraft Name Long: " << cam->spacecraftNameLong() << endl; - cout << "Spacecraft Name Short: " << cam->spacecraftNameShort() << endl; - cout << "Instrument Name Long: " << cam->instrumentNameLong() << endl; - cout << "Instrument Name Short: " << cam->instrumentNameShort() << endl << endl; + cout << "Spacecraft Name Long: " << cam->spacecraftNameLong().toStdString() << endl; + cout << "Spacecraft Name Short: " << cam->spacecraftNameShort().toStdString() << endl; + cout << "Instrument Name Long: " << cam->instrumentNameLong().toStdString() << endl; + cout << "Instrument Name Short: " << cam->instrumentNameShort().toStdString() << endl << endl; double uLLine = 194.0; double uRLine = 60.0; diff --git a/isis/src/newhorizons/objs/NewHorizonsLorriCamera/NewHorizonsLorriCamera.cpp b/isis/src/newhorizons/objs/NewHorizonsLorriCamera/NewHorizonsLorriCamera.cpp index e5ecc9e89a..a3d82e594f 100644 --- a/isis/src/newhorizons/objs/NewHorizonsLorriCamera/NewHorizonsLorriCamera.cpp +++ b/isis/src/newhorizons/objs/NewHorizonsLorriCamera/NewHorizonsLorriCamera.cpp @@ -49,18 +49,18 @@ namespace Isis { // temperature. The NAIF code, set in the ISIS labels, will be used to read a single focal // length from the SPICE kernels. Version 100 of the Lorri IK uses meters for focal length, // units, version 200 uses mm, and has a units keyword. - QString unitsKey = "INS" + toString(naifIkCode()) + "_FOCAL_LENGTH_UNITS"; + QString unitsKey = "INS" + QString::number(naifIkCode()) + "_FOCAL_LENGTH_UNITS"; QString focalLengthUnits = Spice::getString(unitsKey); if (focalLengthUnits != "mm") { - std::string msg = QObject::tr("SPICE keyword [%1] is expected to be mm. [%2] was found instead"). + QString msg = QObject::tr("SPICE keyword [%1] is expected to be mm. [%2] was found instead"). arg(unitsKey).arg(focalLengthUnits); - throw IException(IException::User, msg, _FILEINFO_); + throw IException(IException::User, msg.toStdString(), _FILEINFO_); } - SetFocalLength(Spice::getDouble("INS" + toString(naifIkCode()) + "_FOCAL_LENGTH")); + SetFocalLength(Spice::getDouble("INS" + QString::number(naifIkCode()) + "_FOCAL_LENGTH")); // For setting the pixel pitch, the Naif keyword PIXEL_SIZE is used instead of the ISIS // default of PIXEL_PITCH, so set the value directly. - QString pp = "INS" + toString(naifIkCode()) + "_PIXEL_SIZE"; + QString pp = "INS" + QString::number(naifIkCode()) + "_PIXEL_SIZE"; double pixelPitch = Spice::getDouble(pp); pixelPitch /= 1000.0; SetPixelPitch(pixelPitch); @@ -77,8 +77,8 @@ namespace Isis { // The boresight position recorded in the IK is zero-based and therefore needs to be adjusted // for ISIS - double boresightSample = Spice::getDouble("INS" + toString(naifIkCode()) + "_CCD_CENTER",0) + 1.0; - double boresightLine = Spice::getDouble("INS" + toString(naifIkCode()) + "_CCD_CENTER",1) + 1.0; + double boresightSample = Spice::getDouble("INS" + QString::number(naifIkCode()) + "_CCD_CENTER",0) + 1.0; + double boresightLine = Spice::getDouble("INS" + QString::number(naifIkCode()) + "_CCD_CENTER",1) + 1.0; focalMap->SetDetectorOrigin(boresightSample,boresightLine); // Setup distortion map. Start by reading the distortion coefficient from the instrument kernel. @@ -88,9 +88,9 @@ namespace Isis { // CameraDistortionMap *distortionMap = new CameraDistortionMap(this, -1); // distortionMap->SetDistortion(naifIkCode()); // Changed the SPICE keyword names to work with LORRI IK version 200 - QString e2("INS" + toString(naifIkCode()) + "_OOC_EM"); - QString e5("INS" + toString(naifIkCode()) + "_OOC_EM"); - QString e6("INS" + toString(naifIkCode()) + "_OOC_EM"); + QString e2("INS" + QString::number(naifIkCode()) + "_OOC_EM"); + QString e5("INS" + QString::number(naifIkCode()) + "_OOC_EM"); + QString e6("INS" + QString::number(naifIkCode()) + "_OOC_EM"); new NewHorizonsLorriDistortionMap(this, getDouble(e2, 0), getDouble(e5, 1), getDouble(e6, 2), -1); diff --git a/isis/src/newhorizons/objs/NewHorizonsLorriCamera/unitTest.cpp b/isis/src/newhorizons/objs/NewHorizonsLorriCamera/unitTest.cpp index e17dd3064f..7629623340 100644 --- a/isis/src/newhorizons/objs/NewHorizonsLorriCamera/unitTest.cpp +++ b/isis/src/newhorizons/objs/NewHorizonsLorriCamera/unitTest.cpp @@ -48,7 +48,7 @@ int main(void) { Cube c("$ISISTESTDATA/isis/src/newhorizons/unitTestData/lor_0034821014_0x630_sci_1_v2.cub", "r"); NewHorizonsLorriCamera *cam = (NewHorizonsLorriCamera *) CameraFactory::Create(c); - cout << "FileName: " << FileName(c.fileName()).name() << endl; + cout << "FileName: " << FileName(c.fileName().toStdString()).name() << endl; cout << "CK Frame: " << cam->instrumentRotation()->Frame() << endl << endl; cout.setf(std::ios::fixed); cout << setprecision(9); @@ -61,10 +61,10 @@ int main(void) { cout << "SPK Reference ID = " << cam->SpkReferenceId() << endl << endl; // Test name methods - cout << "Spacecraft Name Long: " << cam->spacecraftNameLong() << endl; - cout << "Spacecraft Name Short: " << cam->spacecraftNameShort() << endl; - cout << "Instrument Name Long: " << cam->instrumentNameLong() << endl; - cout << "Instrument Name Short: " << cam->instrumentNameShort() << endl << endl; + cout << "Spacecraft Name Long: " << cam->spacecraftNameLong().toStdString() << endl; + cout << "Spacecraft Name Short: " << cam->spacecraftNameShort().toStdString() << endl; + cout << "Instrument Name Long: " << cam->instrumentNameLong().toStdString() << endl; + cout << "Instrument Name Short: " << cam->instrumentNameShort().toStdString() << endl << endl; // Test Shutter Open/Close const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); diff --git a/isis/src/newhorizons/objs/NewHorizonsMvicFrameCamera/NewHorizonsMvicFrameCamera.cpp b/isis/src/newhorizons/objs/NewHorizonsMvicFrameCamera/NewHorizonsMvicFrameCamera.cpp index 4f2fb21749..7ffa996050 100644 --- a/isis/src/newhorizons/objs/NewHorizonsMvicFrameCamera/NewHorizonsMvicFrameCamera.cpp +++ b/isis/src/newhorizons/objs/NewHorizonsMvicFrameCamera/NewHorizonsMvicFrameCamera.cpp @@ -117,10 +117,10 @@ namespace Isis { void NewHorizonsMvicFrameCamera::SetBand(const int vband) { if(vband > (int) m_originalBand.size()) { - std::string msg = QObject::tr("Band number out of array bounds in NewHorizonsMvicFrameCamera::SetBand legal " + QString msg = QObject::tr("Band number out of array bounds in NewHorizonsMvicFrameCamera::SetBand legal " "bands are [1-%1], input was [%2]"). arg(m_originalBand.size()).arg(vband); - throw IException(IException::Programmer, msg, _FILEINFO_); + throw IException(IException::Programmer, msg.toStdString(), _FILEINFO_); } iTime time(m_utcTime[vband-1]); diff --git a/isis/src/newhorizons/objs/NewHorizonsMvicFrameCamera/unitTest.cpp b/isis/src/newhorizons/objs/NewHorizonsMvicFrameCamera/unitTest.cpp index 1043777bf0..4691ea1dd2 100644 --- a/isis/src/newhorizons/objs/NewHorizonsMvicFrameCamera/unitTest.cpp +++ b/isis/src/newhorizons/objs/NewHorizonsMvicFrameCamera/unitTest.cpp @@ -38,7 +38,7 @@ int main(void) { Cube c("$ISISTESTDATA/isis/src/newhorizons/unitTestData/mpf_0035126517_0x539_sci_1.cub", "r"); NewHorizonsMvicFrameCamera *cam = (NewHorizonsMvicFrameCamera *) CameraFactory::Create(c); - cout << "FileName: " << FileName(c.fileName()).name() << endl; + cout << "FileName: " << FileName(c.fileName().toStdString()).name() << endl; cout << "CK Frame: " << cam->instrumentRotation()->Frame() << endl << endl; cout.setf(std::ios::fixed); cout << setprecision(9); @@ -51,10 +51,10 @@ int main(void) { cout << "SPK Reference ID = " << cam->SpkReferenceId() << endl << endl; // Test name methods - cout << "Spacecraft Name Long: " << cam->spacecraftNameLong() << endl; - cout << "Spacecraft Name Short: " << cam->spacecraftNameShort() << endl; - cout << "Instrument Name Long: " << cam->instrumentNameLong() << endl; - cout << "Instrument Name Short: " << cam->instrumentNameShort() << endl << endl; + cout << "Spacecraft Name Long: " << cam->spacecraftNameLong().toStdString() << endl; + cout << "Spacecraft Name Short: " << cam->spacecraftNameShort().toStdString() << endl; + cout << "Instrument Name Long: " << cam->instrumentNameLong().toStdString() << endl; + cout << "Instrument Name Short: " << cam->instrumentNameShort().toStdString() << endl << endl; // Test Shutter Open/Close const PvlGroup &inst = c.label()->findGroup("Instrument", Pvl::Traverse); diff --git a/isis/src/newhorizons/objs/NewHorizonsMvicTdiCamera/NewHorizonsMvicTdiCamera.cpp b/isis/src/newhorizons/objs/NewHorizonsMvicTdiCamera/NewHorizonsMvicTdiCamera.cpp index 3e55c941c4..25f2aea299 100644 --- a/isis/src/newhorizons/objs/NewHorizonsMvicTdiCamera/NewHorizonsMvicTdiCamera.cpp +++ b/isis/src/newhorizons/objs/NewHorizonsMvicTdiCamera/NewHorizonsMvicTdiCamera.cpp @@ -78,8 +78,8 @@ namespace Isis { // read residual polynomial distortion coefs from the NAIF Kernels int code = naifIkCode(); - QString naifCOLKey = "INS" + toString(code) + "_RESIDUAL_COL_DIST_COEF"; - QString naifROWKey = "INS" + toString(code) + "_RESIDUAL_ROW_DIST_COEF"; + QString naifCOLKey = "INS" + QString::number(code) + "_RESIDUAL_COL_DIST_COEF"; + QString naifROWKey = "INS" + QString::number(code) + "_RESIDUAL_ROW_DIST_COEF"; for (int i=0; i < 6; i++) { residualColumnDistCoefs.push_back(getDouble(naifCOLKey,i)); diff --git a/isis/src/newhorizons/objs/NewHorizonsMvicTdiCamera/unitTest.cpp b/isis/src/newhorizons/objs/NewHorizonsMvicTdiCamera/unitTest.cpp index 01c4e99d08..3650ce48fc 100644 --- a/isis/src/newhorizons/objs/NewHorizonsMvicTdiCamera/unitTest.cpp +++ b/isis/src/newhorizons/objs/NewHorizonsMvicTdiCamera/unitTest.cpp @@ -48,7 +48,7 @@ int main(void) { Cube c("$ISISTESTDATA/isis/src/newhorizons/unitTestData/mc0_0034942918_0x536_sci_1.cub", "r"); NewHorizonsMvicTdiCamera *cam = (NewHorizonsMvicTdiCamera *) CameraFactory::Create(c); - cout << "FileName: " << FileName(c.fileName()).name() << endl; + cout << "FileName: " << FileName(c.fileName().toStdString()).name() << endl; cout << "CK Frame: " << cam->instrumentRotation()->Frame() << endl << endl; cout.setf(std::ios::fixed); cout << setprecision(9); @@ -61,10 +61,10 @@ int main(void) { cout << "SPK Reference ID = " << cam->SpkReferenceId() << endl << endl; // Test name methods - cout << "Spacecraft Name Long: " << cam->spacecraftNameLong() << endl; - cout << "Spacecraft Name Short: " << cam->spacecraftNameShort() << endl; - cout << "Instrument Name Long: " << cam->instrumentNameLong() << endl; - cout << "Instrument Name Short: " << cam->instrumentNameShort() << endl << endl; + cout << "Spacecraft Name Long: " << cam->spacecraftNameLong().toStdString() << endl; + cout << "Spacecraft Name Short: " << cam->spacecraftNameShort().toStdString() << endl; + cout << "Instrument Name Long: " << cam->instrumentNameLong().toStdString() << endl; + cout << "Instrument Name Short: " << cam->instrumentNameShort().toStdString() << endl << endl; // Test four pixels to make sure the conversions are right cout << "For upper left ..." << endl; diff --git a/isis/src/odyssey/apps/thm2isis/thm2isis.cpp b/isis/src/odyssey/apps/thm2isis/thm2isis.cpp index 6e9b0565a3..ad6189072f 100644 --- a/isis/src/odyssey/apps/thm2isis/thm2isis.cpp +++ b/isis/src/odyssey/apps/thm2isis/thm2isis.cpp @@ -29,7 +29,7 @@ namespace Isis { outputCubes.clear(); frameletLines = 192; - FileName in = ui.GetFileName("FROM"); + FileName in = ui.GetFileName("FROM").toStdString(); // Make sure it is a Themis EDR/RDR bool projected; @@ -40,7 +40,7 @@ namespace Isis { id = QString::fromStdString(lab["DATA_SET_ID"]); id = id.simplified().trimmed(); if(!id.startsWith("ODY-M-THM")) { - std::string msg = "Invalid DATA_SET_ID [" + id + "]"; + std::string msg = "Invalid DATA_SET_ID [" + id.toStdString() + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } } @@ -60,7 +60,7 @@ namespace Isis { // Ok looks good ... set it as the PDS file Pvl pdsLab; - p.SetPdsFile(in.expanded(), "", pdsLab); + p.SetPdsFile(QString::fromStdString(in.expanded()), "", pdsLab); OriginalLabel origLabels(pdsLab); @@ -68,7 +68,7 @@ namespace Isis { TranslateLabels(pdsLab, isis3Lab, p.Bands(), ui); // Set up the output cube - FileName outFile(ui.GetCubeName("TO")); + FileName outFile(ui.GetCubeName("TO").toStdString()); PvlGroup &inst = isis3Lab.findGroup("Instrument", Pvl::Traverse); CubeAttributeOutput outAttr = ui.GetOutputAttribute("to"); @@ -79,8 +79,8 @@ namespace Isis { even->setDimensions(p.Samples(), p.Lines(), p.Bands()); odd->setDimensions(p.Samples(), p.Lines(), p.Bands()); - QString evenFile = outFile.path() + "/" + outFile.baseName() + ".even.cub"; - QString oddFile = outFile.path() + "/" + outFile.baseName() + ".odd.cub"; + QString evenFile = QString::fromStdString(outFile.path() + "/" + outFile.baseName() + ".even.cub"); + QString oddFile = QString::fromStdString(outFile.path() + "/" + outFile.baseName() + ".odd.cub"); even->create(evenFile, outAttr); odd->create(oddFile, outAttr); @@ -94,7 +94,7 @@ namespace Isis { Cube *outCube = new Cube(); outCube->setDimensions(p.Samples(), p.Lines(), p.Bands()); - outCube->create(outFile.expanded(), outAttr); + outCube->create(QString::fromStdString(outFile.expanded()), outAttr); outputCubes.push_back(outCube); } diff --git a/isis/src/odyssey/apps/thmbasemap1/main.cpp b/isis/src/odyssey/apps/thmbasemap1/main.cpp index b3f1f772ad..1348209c1f 100644 --- a/isis/src/odyssey/apps/thmbasemap1/main.cpp +++ b/isis/src/odyssey/apps/thmbasemap1/main.cpp @@ -40,7 +40,7 @@ void IsisMain(){ } QString outFile; if (ui.WasEntered("FROMLIST")) { - cubes.read(ui.GetFileName("FROMLIST")); + cubes.read(ui.GetFileName("FROMLIST").toStdString()); } else { std::string msg = "Error: FROMLIST file must be specified"; @@ -68,7 +68,7 @@ void IsisMain(){ // LOG_STATS is true will create a flat file of statistics. ofstream logFileos; if (logCamStats) { - FileName logFile(logFileName); + FileName logFile(logFileName.toStdString()); if (logFile.fileExists()) { logFileos.open(logFileName.toLatin1().data(),ios::app); } @@ -88,7 +88,7 @@ void IsisMain(){ FileName hiIncList; ofstream hiIncListos; if (rmHiIncInput && reportHiInc) { - hiIncList = ui.GetFileName("HIGHINCLIST"); + hiIncList = ui.GetFileName("HIGHINCLIST").toStdString(); IString hiIncListStr = hiIncList.expanded(); if (hiIncList.fileExists()) { hiIncListos.open(hiIncListStr.c_str(),ios::app); @@ -103,7 +103,7 @@ void IsisMain(){ FileName noFileList; ofstream noFileListos; if (reportNoFile) { - noFileList = ui.GetFileName("NOFILELIST"); + noFileList = ui.GetFileName("NOFILELIST").toStdString(); IString noFileListStr = noFileList.expanded(); if (noFileList.fileExists()) { noFileListos.open(noFileListStr.c_str(),ios::app); @@ -118,7 +118,7 @@ void IsisMain(){ FileName nadirSpcList; ofstream nadirSpcListos; if (reportNadirSpc) { - nadirSpcList = ui.GetFileName("NADIRSPCLIST"); + nadirSpcList = ui.GetFileName("NADIRSPCLIST").toStdString(); IString nadirSpcListStr = nadirSpcList.expanded(); if (nadirSpcList.fileExists()) { nadirSpcListos.open(nadirSpcListStr.c_str(),ios::app); @@ -133,7 +133,7 @@ void IsisMain(){ FileName imageGapList; ofstream imageGapListos; if (reportImageGap) { - imageGapList = ui.GetFileName("IMAGEGAPLIST"); + imageGapList = ui.GetFileName("IMAGEGAPLIST").toStdString(); IString imageGapListStr = imageGapList.expanded(); if (imageGapList.fileExists()) { imageGapListos.open(imageGapListStr.c_str(),ios::app); @@ -152,7 +152,7 @@ void IsisMain(){ // Open the input file FileName infile = cubes[i]; - QString inFileStr = infile.expanded(); + QString inFileStr = QString::fromStdString(infile.expanded()); if (!infile.fileExists()) { if (reportNoFile) { @@ -211,13 +211,13 @@ void IsisMain(){ if (reportNoFile) { noFileListos << infile.baseName() << " not processed because is missing filter 12.57" << endl; } - std::string msg = "Filter 12.57 not found in input file [" + inFileStr + "]"; + std::string msg = "Filter 12.57 not found in input file [" + inFileStr.toStdString() + "]"; throw IException(IException::Unknown, msg, _FILEINFO_); } // Run thm2isis - QString output = (infile.baseName()) + ".cub"; - QString parameters = "FROM=" + cubes[i].toString() + " TO=" + output; + QString output = QString::fromStdString(infile.baseName()) + ".cub"; + QString parameters = "FROM=" + QString::fromStdString(cubes[i].toString()) + " TO=" + output; ProgramLauncher::RunIsisProgram("thm2isis", parameters); //Run spiceinit @@ -240,9 +240,9 @@ void IsisMain(){ // Create a temporary pvl and fill with camstats used to test incedence FileName tstat1; - QString tmpcamstats1 = infile.baseName() + "_tmpcamstats1"; + std::string tmpcamstats1 = infile.baseName() + "_tmpcamstats1"; tstat1 = FileName::createTempFile("$TEMPORARY/" + tmpcamstats1 + ".pvl"); - QString tempstat1 = tstat1.expanded(); + QString tempstat1 = QString::fromStdString(tstat1.expanded()); parameters = "FROM=" + input + " TO=" + tempstat1 + " linc = 100 sinc = 100"; ProgramLauncher::RunIsisProgram("camstats", parameters); @@ -252,7 +252,7 @@ void IsisMain(){ // if do not process night and incidence angle > 90, then exit if (!processNight && incAngle >= 90) { - remove (tstat1.expanded().toLatin1().data()); + remove (tstat1.expanded().c_str()); if (rmHiIncInput) { if (reportHiInc) { hiIncListos << infile.baseName() << endl; @@ -272,7 +272,7 @@ void IsisMain(){ // if process night and incidence angle < 90, then exit if (processNight && incAngle < 90) { - remove (tstat1.expanded().toLatin1().data()); + remove (tstat1.expanded().c_str()); if (rmHiIncInput) { if (reportHiInc) { hiIncListos << infile.baseName() << endl; @@ -294,15 +294,15 @@ void IsisMain(){ // Perform atmospheric correction using filter 10 or 14.88um wavelength. // Note we use wavelength 12.57um in geologic mosaics. if (band14_88 && incAngle < 90 && !ignoreAtmCorr) { - output = (infile.baseName()) + "_driftcorr.cub"; - parameters = "FROM=" + input + "+" + toString(procBand) + - " ATM=" + input + "+" + toString(atmosBand) + " TO=" + output; + output = (QString::fromStdString(infile.baseName()) + "_driftcorr.cub"); + parameters = "FROM=" + input + "+" + QString::number(procBand) + + " ATM=" + input + "+" + QString::number(atmosBand) + " TO=" + output; ProgramLauncher::RunIsisProgram("thmdriftcor", parameters); remove (input.toLatin1().data()); } else { - output = (infile.baseName()) + "_no_driftcorr.cub"; - parameters = "FROM=" + input + "+" + toString(procBand) + " TO=" + output; + output = QString::fromStdString(infile.baseName()) + "_no_driftcorr.cub"; + parameters = "FROM=" + input + "+" + QString::number(procBand) + " TO=" + output; ProgramLauncher::RunIsisProgram("stretch", parameters); remove (input.toLatin1().data()); } @@ -311,7 +311,7 @@ void IsisMain(){ // if night is true then skip cosi if (incAngle < 90) { input = output; - output = (infile.baseName()) + "_cosi.cub"; + output = QString::fromStdString(infile.baseName()) + "_cosi.cub"; parameters = "FROM=" + input + " TO=" + output; ProgramLauncher::RunIsisProgram("cosi", parameters); remove (input.toLatin1().data()); @@ -319,28 +319,28 @@ void IsisMain(){ // Run cubenorm input = output; - output = (infile.baseName()) + "cubenorm.cub"; + output = QString::fromStdString(infile.baseName()) + "cubenorm.cub"; parameters = "FROM=" + input + " TO=" + output; ProgramLauncher::RunIsisProgram("cubenorm", parameters); remove (input.toLatin1().data()); //Run lineeq input=output; - outFile = pathName + infile.baseName() + ".lev1.cub"; + outFile = pathName + QString::fromStdString(infile.baseName()) + ".lev1.cub"; parameters ="FROM=" + input + " TO=" + outFile; ProgramLauncher::RunIsisProgram("lineeq", parameters); remove (input.toLatin1().data()); - remove (tstat1.expanded().toLatin1().data()); + remove (tstat1.expanded().c_str()); //************************************ // Run findgaps // Create temporary pvl for gaps QString sgap = "no"; FileName tgaps; - QString tmpstats1 = infile.baseName() + "_tmpstats1"; + std::string tmpstats1 = infile.baseName() + "_tmpstats1"; tgaps = FileName::createTempFile("$TEMPORARY/" + tmpstats1 + ".pvl"); - QString tempgaps = tgaps.expanded(); + QString tempgaps = QString::fromStdString(tgaps.expanded()); //parameters = "FROM=" + IString(ui.GetFileName("TO")) + // " TO=" + tempgaps + " CORTOL=.3"; @@ -353,20 +353,20 @@ void IsisMain(){ QString totalpixels = QString::fromStdString(tg.findGroup("Results",Pvl::Traverse)["TotalPixels"]); QString validpixels = QString::fromStdString(tg.findGroup("Results",Pvl::Traverse)["ValidPixels"]); //if (tg.hasGroup("Gap")) { - if (IString(totalpixels).ToInteger() != IString(validpixels).ToInteger()) { + if (totalpixels.toInt() != validpixels.toInt()) { cout << tg << endl; sgap = "yes"; if (reportImageGap) { imageGapListos << infile.baseName() << endl; } } - remove (tgaps.expanded().toLatin1().data()); + remove (tgaps.expanded().c_str()); // Create temporary pvl and fill with camstats FileName tstat2; - QString tmpcamstats2 = infile.baseName() + "_tmpcamstats2"; + std::string tmpcamstats2 = infile.baseName() + "_tmpcamstats2"; tstat2 = FileName::createTempFile("$TEMPORARY/" + tmpcamstats2 + ".pvl"); - QString tempstat2 = tstat2.expanded(); + QString tempstat2 = QString::fromStdString(tstat2.expanded()); parameters = "FROM=" + outFile + " TO=" + tempstat2 + " linc = 100 sinc = 100"; @@ -378,10 +378,10 @@ void IsisMain(){ QString resavg = QString::fromStdString(p2.findGroup("Resolution",Pvl::Traverse)["ResolutionAverage"]); QString incmin = QString::fromStdString(p2.findGroup("IncidenceAngle",Pvl::Traverse)["IncidenceMinimum"]); QString incmax = QString::fromStdString(p2.findGroup("IncidenceAngle",Pvl::Traverse)["IncidenceMaximum"]); - remove (tstat2.expanded().toLatin1().data()); + remove (tstat2.expanded().c_str()); double summing = 1; - FileName tosum = FileName(outFile); + FileName tosum = FileName(outFile.toStdString()); Pvl sumlab(tosum.expanded()); PvlGroup InstGrp = sumlab.findGroup("Instrument",Pvl::Traverse); if (InstGrp.hasKeyword("SpatialSumming")) { @@ -391,15 +391,15 @@ void IsisMain(){ // do stuff to build the file that will go into the spreadsheet // Add statistics to flat file. if (logCamStats) { - logFileos << infile.baseName() << "," << duration << "," << summing << "," << - incavg << "," << resavg << "," << incmin << "," << incmax << "," << sgap << "," <group("Instrument")["InstrumentID"][0] != "THEMIS_VIS") { std::string msg = "This program is intended for use on THEMIS VIS images only"; - msg += " [" + ui.GetCubeName("INEVEN") + "] does not appear to be a "; + msg += " [" + ui.GetCubeName("INEVEN").toStdString() + "] does not appear to be a "; msg += "THEMIS VIS image."; throw IException(IException::User, msg, _FILEINFO_); } if (evenCube->group("Instrument")["Framelets"][0] != "Even") { - std::string msg = "The image [" + ui.GetCubeName("INEVEN") + "] does not appear " + std::string msg = "The image [" + ui.GetCubeName("INEVEN").toStdString() + "] does not appear " "to contain the EVEN framelets of a Themis VIS cube"; throw IException(IException::User, msg, _FILEINFO_); } @@ -115,12 +115,12 @@ void IsisMain() { try { if(oddCube->group("Instrument")["InstrumentID"][0] != "THEMIS_VIS") { std::string msg = "This program is intended for use on THEMIS VIS images only"; - msg += " [" + ui.GetCubeName("INODD") + "] does not appear to be a "; + msg += " [" + ui.GetCubeName("INODD").toStdString() + "] does not appear to be a "; msg += "THEMIS VIS image."; throw IException(IException::User, msg, _FILEINFO_); } if (oddCube->group("Instrument")["Framelets"][0] != "Odd") { - std::string msg = "The image [" + ui.GetCubeName("INODD") + "] does not appear " + std::string msg = "The image [" + ui.GetCubeName("INODD").toStdString() + "] does not appear " "to contain the ODD framelets of a Themis VIS cube"; throw IException(IException::User, msg, _FILEINFO_); } diff --git a/isis/src/odyssey/apps/thmproc/main.cpp b/isis/src/odyssey/apps/thmproc/main.cpp index d524778b87..dfcb477adc 100644 --- a/isis/src/odyssey/apps/thmproc/main.cpp +++ b/isis/src/odyssey/apps/thmproc/main.cpp @@ -23,7 +23,7 @@ void IsisMain() { } if(ui.WasEntered("PCK")) { - FileName pckPreference = ui.GetFileName("PCK"); + FileName pckPreference = ui.GetFileName("PCK").toStdString(); if(!pckPreference.fileExists()){ std::string msg = "Please provide a valid PCK preference file."; throw IException(IException::User, msg, _FILEINFO_); @@ -31,7 +31,7 @@ void IsisMain() { } if(ui.WasEntered("CK")) { - FileName ckPreference = ui.GetFileName("CK"); + FileName ckPreference = ui.GetFileName("CK").toStdString(); if(!ckPreference.fileExists()){ std::string msg = "Please provide a valid CK preference file."; throw IException(IException::User, msg, _FILEINFO_); @@ -39,21 +39,21 @@ void IsisMain() { } if(ui.WasEntered("SPK")) { - FileName spkPreference = ui.GetFileName("SPK"); + FileName spkPreference = ui.GetFileName("SPK").toStdString(); if(!spkPreference.fileExists()){ std::string msg = "Please provide a valid SPK preference file."; throw IException(IException::User, msg, _FILEINFO_); } } if(ui.WasEntered("MAP")) { - FileName mapPreference = ui.GetFileName("MAP"); + FileName mapPreference = ui.GetFileName("MAP").toStdString(); if(!mapPreference.fileExists()){ std::string msg = "Please provide a valid MAP preference file."; throw IException(IException::User, msg, _FILEINFO_); } } if(ui.WasEntered("MODEL")) { - FileName modelPreference = ui.GetCubeName("MODEL"); + FileName modelPreference = ui.GetCubeName("MODEL").toStdString(); if(!modelPreference.fileExists()){ std::string msg = "Please provide a valid MODEL preference file."; throw IException(IException::User, msg, _FILEINFO_); diff --git a/isis/src/odyssey/apps/thmvisflat/main.cpp b/isis/src/odyssey/apps/thmvisflat/main.cpp index e2455a3226..cf04871030 100644 --- a/isis/src/odyssey/apps/thmvisflat/main.cpp +++ b/isis/src/odyssey/apps/thmvisflat/main.cpp @@ -27,10 +27,10 @@ void IsisMain() { icube.setVirtualBands(inAtt.bands()); } - icube.open(FileName(ui.GetCubeName("FROM")).expanded()); + icube.open(QString::fromStdString(FileName(ui.GetCubeName("FROM").toStdString()).expanded())); // Make sure it is a Themis EDR/RDR - FileName inFileName = ui.GetCubeName("FROM"); + FileName inFileName = ui.GetCubeName("FROM").toStdString(); try { if(icube.group("Instrument")["InstrumentID"][0] != "THEMIS_VIS") { std::string msg = "This program is intended for use on THEMIS VIS images only. ["; @@ -50,11 +50,11 @@ void IsisMain() { for(int filt = 0; filt < 5; filt++) { QString filePattern = "$odyssey/calibration/flat_filter_"; - filePattern += toString(filt + 1) + "_summing_"; - filePattern += toString(summing) + "_v????.cub"; - FileName flatFile = FileName(filePattern).highestVersion(); + filePattern += QString::number(filt + 1) + "_summing_"; + filePattern += QString::number(summing) + "_v????.cub"; + FileName flatFile = FileName(filePattern.toStdString()).highestVersion(); Cube *fcube = new Cube(); - fcube->open(flatFile.expanded()); + fcube->open(QString::fromStdString(flatFile.expanded())); flatcubes.push_back(fcube); LineManager *fcubeMgr = new LineManager(*fcube); @@ -71,7 +71,7 @@ void IsisMain() { ocube.setLabelsAttached(outAtt.labelAttachment() == AttachedLabel); ocube.setPixelType(outAtt.pixelType()); - ocube.create(FileName(ui.GetCubeName("TO")).expanded()); + ocube.create(QString::fromStdString(FileName(ui.GetCubeName("TO").toStdString()).expanded())); LineManager icubeMgr(icube); vector filter; @@ -136,7 +136,7 @@ void IsisMain() { for(int o = 0; o < icube.label()->objects(); o++) { if(icube.label()->object(o).isNamed("Table")) { - Blob t(QString::fromStdString(icube.label()->object(o)["Name"]), + Blob t(icube.label()->object(o)["Name"], icube.label()->object(o).name()); icube.read(t); ocube.write(t); diff --git a/isis/src/odyssey/apps/thmvistrim/main.cpp b/isis/src/odyssey/apps/thmvistrim/main.cpp index 29aa1c4ba4..5188e7db5e 100644 --- a/isis/src/odyssey/apps/thmvistrim/main.cpp +++ b/isis/src/odyssey/apps/thmvistrim/main.cpp @@ -37,7 +37,7 @@ void IsisMain() { // Make sure it is a Themis EDR/RDR try { if(icube->group("Instrument")["InstrumentID"][0] != "THEMIS_VIS") { - FileName inFileName = ui.GetCubeName("FROM"); + FileName inFileName = ui.GetCubeName("FROM").toStdString(); std::string msg = "This program is intended for use on THEMIS VIS images only. ["; msg += inFileName.expanded() + "] does not appear to be a THEMIS VIS image."; throw IException(IException::User, msg, _FILEINFO_); diff --git a/isis/src/odyssey/objs/ThemisIrCamera/unitTest.cpp b/isis/src/odyssey/objs/ThemisIrCamera/unitTest.cpp index e9a0abf4ed..9b976d0831 100644 --- a/isis/src/odyssey/objs/ThemisIrCamera/unitTest.cpp +++ b/isis/src/odyssey/objs/ThemisIrCamera/unitTest.cpp @@ -38,7 +38,7 @@ int main(void) { Cube c("$ISISTESTDATA/isis/src/odyssey/unitTestData/I00831002RDR.cub", "r"); Camera *cam = CameraFactory::Create(c); - cout << "FileName: " << FileName(c.fileName()).name() << endl; + cout << "FileName: " << FileName(c.fileName().toStdString()).name() << endl; cout << "CK Frame: " << cam->instrumentRotation()->Frame() << endl << endl; cout.setf(std::ios::fixed); cout << setprecision(9); @@ -88,10 +88,10 @@ int main(void) { // Test name methods cout << endl << endl << "Testing name methods ..." << endl; - cout << "Spacecraft Name Long: " << cam->spacecraftNameLong() << endl; - cout << "Spacecraft Name Short: " << cam->spacecraftNameShort() << endl; - cout << "Instrument Name Long: " << cam->instrumentNameLong() << endl; - cout << "Instrument Name Short: " << cam->instrumentNameShort() << endl << endl; + cout << "Spacecraft Name Long: " << cam->spacecraftNameLong().toStdString() << endl; + cout << "Spacecraft Name Short: " << cam->spacecraftNameShort().toStdString() << endl; + cout << "Instrument Name Long: " << cam->instrumentNameLong().toStdString() << endl; + cout << "Instrument Name Short: " << cam->instrumentNameShort().toStdString() << endl << endl; } catch(IException &e) { e.print(); diff --git a/isis/src/odyssey/objs/ThemisVisCamera/ThemisVisCamera.cpp b/isis/src/odyssey/objs/ThemisVisCamera/ThemisVisCamera.cpp index a3eb706971..aec5f0e31f 100644 --- a/isis/src/odyssey/objs/ThemisVisCamera/ThemisVisCamera.cpp +++ b/isis/src/odyssey/objs/ThemisVisCamera/ThemisVisCamera.cpp @@ -55,9 +55,9 @@ namespace Isis { // make sure it is a themis vis image if(inst["InstrumentId"][0] != "THEMIS_VIS") { - std::string msg = "Unable to create Themis VIS camera model from an image with InstrumentId [" + QString msg = "Unable to create Themis VIS camera model from an image with InstrumentId [" + QString::fromStdString(inst["InstrumentId"][0]) + "]."; - throw IException(IException::User, msg, _FILEINFO_); + throw IException(IException::User, msg.toStdString(), _FILEINFO_); } // Get necessary variables diff --git a/isis/src/odyssey/objs/ThemisVisCamera/unitTest.cpp b/isis/src/odyssey/objs/ThemisVisCamera/unitTest.cpp index 81f98b3c7a..079a584ae6 100644 --- a/isis/src/odyssey/objs/ThemisVisCamera/unitTest.cpp +++ b/isis/src/odyssey/objs/ThemisVisCamera/unitTest.cpp @@ -47,7 +47,7 @@ int main(void) { Cube evenCube("$ISISTESTDATA/isis/src/odyssey/unitTestData/V14093008RDR.even.cub", "r"); // Cube evenCube("./V14093008RDR.even.cub", "r"); Camera *evenCam = CameraFactory::Create(evenCube); - qDebug() << "FileName: " << FileName(evenCube.fileName()).name(); + qDebug() << "FileName: " << QString::fromStdString(FileName(evenCube.fileName().toStdString()).name()); qDebug() << "CK Frame: " << evenCam->instrumentRotation()->Frame(); qDebug() << ""; @@ -106,7 +106,7 @@ int main(void) { qDebug() << ""; Cube oddCube("$ISISTESTDATA/isis/src/odyssey/unitTestData/V14093008RDR.odd.cub", "r"); Camera *oddCam = CameraFactory::Create(oddCube); - qDebug()<< "FileName: " << FileName(oddCube.fileName()).name(); + qDebug()<< "FileName: " << QString::fromStdString(FileName(oddCube.fileName().toStdString()).name()); qDebug()<< "CK Frame: " << oddCam->instrumentRotation()->Frame(); qDebug() << ""; diff --git a/isis/src/osirisrex/apps/ocams2isis/main.cpp b/isis/src/osirisrex/apps/ocams2isis/main.cpp index f92c8dbe62..69ebea22ea 100644 --- a/isis/src/osirisrex/apps/ocams2isis/main.cpp +++ b/isis/src/osirisrex/apps/ocams2isis/main.cpp @@ -36,14 +36,14 @@ void IsisMain() { ProcessImportFits importFits; - importFits.setFitsFile(FileName(ui.GetFileName("FROM"))); + importFits.setFitsFile(FileName(ui.GetFileName("FROM").toStdString())); importFits.setProcessFileStructure(0); Cube *output = importFits.SetOutputCube("TO"); // Get the directory where the OSIRIS-REx translation tables are. - QString transDir = "$ISISROOT/appdata/translations/"; + std::string transDir = "$ISISROOT/appdata/translations/"; // Temp storage of translated labels Pvl outLabel; @@ -54,20 +54,20 @@ void IsisMain() { // Create an Instrument group FileName insTransFile(transDir + "OsirisRexOcamsInstrument_fit.trn"); - PvlToPvlTranslationManager insXlater(fitsLabel, insTransFile.expanded()); + PvlToPvlTranslationManager insXlater(fitsLabel, QString::fromStdString(insTransFile.expanded())); insXlater.Auto(outLabel); output->putGroup(outLabel.findGroup("Instrument", Pvl::Traverse)); // Create a Band Bin group FileName bandTransFile(transDir + "OsirisRexOcamsBandBin_fit.trn"); - PvlToPvlTranslationManager bandBinXlater(fitsLabel, bandTransFile.expanded()); + PvlToPvlTranslationManager bandBinXlater(fitsLabel, QString::fromStdString(bandTransFile.expanded())); bandBinXlater.Auto(outLabel); output->putGroup(outLabel.findGroup("BandBin", Pvl::Traverse)); // Create a Kernels group FileName kernelsTransFile(transDir + "OsirisRexOcamsKernels_fit.trn"); - PvlToPvlTranslationManager kernelsXlater(fitsLabel, kernelsTransFile.expanded()); + PvlToPvlTranslationManager kernelsXlater(fitsLabel, QString::fromStdString(kernelsTransFile.expanded())); kernelsXlater.Auto(outLabel); output->putGroup(outLabel.findGroup("Kernels", Pvl::Traverse)); diff --git a/isis/src/osirisrex/apps/tagcams2isis/tagcams2isis.cpp b/isis/src/osirisrex/apps/tagcams2isis/tagcams2isis.cpp index 8d5719d31f..3e41944635 100644 --- a/isis/src/osirisrex/apps/tagcams2isis/tagcams2isis.cpp +++ b/isis/src/osirisrex/apps/tagcams2isis/tagcams2isis.cpp @@ -37,7 +37,7 @@ namespace Isis { */ void tagcams2isis(UserInterface &ui) { - FileName fitsFileName(ui.GetFileName("FROM")); + FileName fitsFileName(ui.GetFileName("FROM").toStdString()); return tagcams2isis(fitsFileName, ui); } @@ -71,8 +71,8 @@ namespace Isis { instId = QString::fromStdString((flabel.findKeyword("INSTRUME", Pvl::Traverse))).simplified(); } catch (IException &ie) { - std::string msg = QObject::tr("Unable to retrieve expected TAGCAMS keywords." - "The file provided in FROM is likely not a TAGCAMS image."); + std::string msg = "Unable to retrieve expected TAGCAMS keywords." + "The file provided in FROM is likely not a TAGCAMS image."; throw IException(ie, IException::User, msg, _FILEINFO_); } @@ -105,7 +105,7 @@ namespace Isis { // Compute the boundary pixels if present and requested. if ( removeCal && hasDark ) { QString bitpix = QString::fromStdString(flabel.findKeyword("BITPIX", Pvl::Traverse)); - int bytesPerPix = abs(toInt(bitpix)) / 8; + int bytesPerPix = abs(bitpix.toInt()) / 8; importFits.SetDataHeaderBytes(bytesPerPix * ((54 * rawSamples) / pixScale)); importFits.SetDataPrefixBytes(bytesPerPix * (144 / pixScale)); importFits.SetDataSuffixBytes(bytesPerPix * (16 / pixScale)); @@ -129,7 +129,7 @@ namespace Isis { } // Get the directory where the OSIRIS-REx translation tables are. - QString transDir = "$ISISROOT/appdata/translations/"; + std::string transDir = "$ISISROOT/appdata/translations/"; // Temp storage of translated labels Pvl outLabel; @@ -140,19 +140,19 @@ namespace Isis { // Create an Instrument group FileName insTransFile(transDir + "OsirisRexTagcamsInstrument_fit.trn"); - PvlToPvlTranslationManager insXlater(fitsLabel, insTransFile.expanded()); + PvlToPvlTranslationManager insXlater(fitsLabel, QString::fromStdString(insTransFile.expanded())); insXlater.Auto(outLabel); PvlGroup &instGrp(outLabel.findGroup("Instrument", Pvl::Traverse)); // Create an Archive group FileName archTransFile(transDir + "OsirisRexTagcamsArchive_fit.trn"); - PvlToPvlTranslationManager archXlater(fitsLabel, archTransFile.expanded()); + PvlToPvlTranslationManager archXlater(fitsLabel, QString::fromStdString(archTransFile.expanded())); archXlater.Auto(outLabel); PvlGroup &archiveGrp(outLabel.findGroup("Archive", Pvl::Traverse)); // Add product id which is just the filename base - FileName from(ui.GetFileName("FROM")); - QString prodid = from.baseName(); + FileName from(ui.GetFileName("FROM").toStdString()); + QString prodid = QString::fromStdString(from.baseName()); archiveGrp.addKeyword(PvlKeyword("SourceProductId", prodid.toStdString()), archiveGrp.begin()); // Create YearDoy keyword in Archive group @@ -186,13 +186,13 @@ namespace Isis { // Create a Band Bin group FileName bandTransFile(transDir + "OsirisRexTagcamsBandBin_fit.trn"); - PvlToPvlTranslationManager bandBinXlater(fitsLabel, bandTransFile.expanded()); + PvlToPvlTranslationManager bandBinXlater(fitsLabel, QString::fromStdString(bandTransFile.expanded())); bandBinXlater.Auto(outLabel); output->putGroup(outLabel.findGroup("BandBin", Pvl::Traverse)); // Create a Kernels group FileName kernelsTransFile(transDir + "OsirisRexTagcamsKernels_fit.trn"); - PvlToPvlTranslationManager kernelsXlater(fitsLabel, kernelsTransFile.expanded()); + PvlToPvlTranslationManager kernelsXlater(fitsLabel, QString::fromStdString(kernelsTransFile.expanded())); kernelsXlater.Auto(outLabel); output->putGroup(outLabel.findGroup("Kernels", Pvl::Traverse)); diff --git a/isis/src/osirisrex/objs/OsirisRexOcamsCamera/OsirisRexDistortionMap.cpp b/isis/src/osirisrex/objs/OsirisRexOcamsCamera/OsirisRexDistortionMap.cpp index 8a5ec8e9c8..f080dd7cd4 100644 --- a/isis/src/osirisrex/objs/OsirisRexOcamsCamera/OsirisRexDistortionMap.cpp +++ b/isis/src/osirisrex/objs/OsirisRexOcamsCamera/OsirisRexDistortionMap.cpp @@ -73,10 +73,10 @@ namespace Isis { QString odkkey; if (filter.toUpper().compare("UNKNOWN") == 0) { - odkkey = "INS" + toString(naifIkCode) + "_OD_K"; + odkkey = "INS" + QString::number(naifIkCode) + "_OD_K"; } else { - odkkey = "INS" + toString(naifIkCode) + "_OD_K_" + filter.trimmed().toUpper(); + odkkey = "INS" + QString::number(naifIkCode) + "_OD_K_" + filter.trimmed().toUpper(); } try { @@ -95,10 +95,10 @@ namespace Isis { // Load center-of-distortion coordinates, including filter if we have it QString odcenterkey; if (filter.toUpper().compare("UNKNOWN") == 0) { - odcenterkey = "INS" + toString(naifIkCode) + "_OD_CENTER"; + odcenterkey = "INS" + QString::number(naifIkCode) + "_OD_CENTER"; } else { - odcenterkey = "INS" + toString(naifIkCode) + "_OD_CENTER_" + filter.trimmed().toUpper(); + odcenterkey = "INS" + QString::number(naifIkCode) + "_OD_CENTER_" + filter.trimmed().toUpper(); } m_distortionOriginSample = p_camera->Spice::getDouble(odcenterkey, 0); m_distortionOriginLine = p_camera->Spice::getDouble(odcenterkey, 1); diff --git a/isis/src/osirisrex/objs/OsirisRexOcamsCamera/OsirisRexOcamsCamera.cpp b/isis/src/osirisrex/objs/OsirisRexOcamsCamera/OsirisRexOcamsCamera.cpp index 80101ac962..27ca045d0b 100644 --- a/isis/src/osirisrex/objs/OsirisRexOcamsCamera/OsirisRexOcamsCamera.cpp +++ b/isis/src/osirisrex/objs/OsirisRexOcamsCamera/OsirisRexOcamsCamera.cpp @@ -63,7 +63,7 @@ namespace Isis { Pvl &lab = *cube.label(); PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse); - QString ikCode = toString(frameCode); + QString ikCode = QString::number(frameCode); if (inst.hasKeyword("PolyCamFocusPositionNaifId") && frameCode == -64360) { if (QString::compare("NONE", QString::fromStdString(inst["PolyCamFocusPositionNaifId"]), Qt::CaseInsensitive) != 0) { diff --git a/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexOcamsDistortionMap.cpp b/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexOcamsDistortionMap.cpp index b0679dcaae..c5f2b7bfc0 100644 --- a/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexOcamsDistortionMap.cpp +++ b/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexOcamsDistortionMap.cpp @@ -87,7 +87,7 @@ namespace Isis { QString odkkey; - odkkey = "INS" + toString(naifIkCode) + "_OD_K"; + odkkey = "INS" + QString::number(naifIkCode) + "_OD_K"; try { for (int i = 0; i < 5; ++i) { p_odk.push_back(p_camera->Spice::getDouble(odkkey, i)); @@ -98,15 +98,15 @@ namespace Isis { // Load center-of-distortion coordinates, including filter if we have it QString odcenterkey; - odcenterkey = "INS" + toString(naifIkCode) + "_OD_CENTER"; + odcenterkey = "INS" + QString::number(naifIkCode) + "_OD_CENTER"; m_distortionOriginSample = p_camera->Spice::getDouble(odcenterkey, 0); m_distortionOriginLine = p_camera->Spice::getDouble(odcenterkey, 1); - QString tolKey = "INS" + toString(naifIkCode) + "_TOLERANCE"; + QString tolKey = "INS" + QString::number(naifIkCode) + "_TOLERANCE"; p_tolerance = p_camera->getDouble(tolKey, 0); - QString dbKey = "INS" + toString(naifIkCode) + "_DEBUG_MODEL"; - p_debug = toBool(p_camera->getString(dbKey, 0)); + QString dbKey = "INS" + QString::number(naifIkCode) + "_DEBUG_MODEL"; + p_debug = toBool(p_camera->getString(dbKey, 0).toStdString()); } diff --git a/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexTagcamsCamera.cpp b/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexTagcamsCamera.cpp index 9a58a86cdf..a23f834a0e 100644 --- a/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexTagcamsCamera.cpp +++ b/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexTagcamsCamera.cpp @@ -64,7 +64,7 @@ namespace Isis { Pvl &lab = *cube.label(); PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse); - QString ikCode = toString(frameCode); + QString ikCode = QString::number(frameCode); // Kernel values are in meters so convert to millimeters QString focalLength = "INS" + ikCode + "_FOCAL_LENGTH"; diff --git a/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexTagcamsDistortionMap.cpp b/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexTagcamsDistortionMap.cpp index fe6cb21885..fe122b6b98 100644 --- a/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexTagcamsDistortionMap.cpp +++ b/isis/src/osirisrex/objs/OsirisRexTagcamsCamera/OsirisRexTagcamsDistortionMap.cpp @@ -51,7 +51,7 @@ namespace Isis { : CameraDistortionMap(parent, zdir) { // Define kernel keywords to fetch - QString ikCode = toString(naifIkCode); + QString ikCode = QString::number(naifIkCode); QString odkKey = "INS" + ikCode + "_OPENCV_OD_K"; QString ppKey = "INS" + ikCode + "_OPENCV_OD_P"; QString flKey = "INS" + ikCode + "_OPENCV_OD_F"; @@ -77,7 +77,7 @@ namespace Isis { p_camTemp = 0.0; // Default is no camera head temperature adjustment p_tolerance = parent->getDouble(tolKey, 0); - p_debug = toBool(parent->getString(dbKey, 0)); + p_debug = toBool(parent->getString(dbKey, 0).toStdString()); // Set up our own focal plane map from the camera model. NOTE!!! // The CameraFocalPlaneMap must be set in the Camera object diff --git a/isis/src/rolo/apps/rolo2isis/main.cpp b/isis/src/rolo/apps/rolo2isis/main.cpp index 9a0357445e..580e76be84 100644 --- a/isis/src/rolo/apps/rolo2isis/main.cpp +++ b/isis/src/rolo/apps/rolo2isis/main.cpp @@ -26,7 +26,7 @@ void IsisMain() { Cube *ocube = p.SetOutputCube("TO"); p.StartProcess(); - QString transDir = "$ISISROOT/appdata/translations/"; + std::string transDir = "$ISISROOT/appdata/translations/"; Pvl inputLabel(labelFile.toStdString()); Pvl outputLabel; @@ -34,21 +34,21 @@ void IsisMain() { // translate Mapping group FileName transFile = transDir + "RoloMapping.trn"; - translator = new PvlToPvlTranslationManager(inputLabel, transFile.expanded()); + translator = new PvlToPvlTranslationManager(inputLabel, QString::fromStdString(transFile.expanded())); translator->Auto(outputLabel); delete translator; translator = NULL; // translate Instrument group transFile = transDir + "RoloInstrument.trn"; - translator = new PvlToPvlTranslationManager(inputLabel, transFile.expanded()); + translator = new PvlToPvlTranslationManager(inputLabel, QString::fromStdString(transFile.expanded())); translator->Auto(outputLabel); delete translator; translator = NULL; // translate BandBin group transFile = transDir + "RoloBandBin.trn"; - translator = new PvlToPvlTranslationManager(inputLabel, transFile.expanded()); + translator = new PvlToPvlTranslationManager(inputLabel, QString::fromStdString(transFile.expanded())); translator->Auto(outputLabel); outputLabel.findGroup("BandBin").findKeyword("OriginalBand").setUnits( translator->Translate("BandBinUnit").toStdString()); @@ -63,7 +63,7 @@ void IsisMain() { // translate Archive group transFile = transDir + "RoloArchive.trn"; - translator = new PvlToPvlTranslationManager(inputLabel, transFile.expanded()); + translator = new PvlToPvlTranslationManager(inputLabel, QString::fromStdString(transFile.expanded())); translator->Auto(outputLabel); delete translator; translator = NULL; diff --git a/isis/src/rosetta/apps/rososiris2isis/main.cpp b/isis/src/rosetta/apps/rososiris2isis/main.cpp index 0ef845f833..ac83161121 100644 --- a/isis/src/rosetta/apps/rososiris2isis/main.cpp +++ b/isis/src/rosetta/apps/rososiris2isis/main.cpp @@ -32,7 +32,7 @@ void IsisMain() { Pvl pdsLabel; UserInterface &ui = Application::GetUserInterface(); - FileName inFile = ui.GetFileName("FROM"); + FileName inFile = ui.GetFileName("FROM").toStdString(); QString instId; QString missionId; @@ -57,12 +57,12 @@ void IsisMain() { throw IException(IException::Io, msg, _FILEINFO_); } - p.SetPdsFile(inFile.expanded(), "", pdsLabel); + p.SetPdsFile(QString::fromStdString(inFile.expanded()), "", pdsLabel); p.SetOrganization(Isis::ProcessImport::BSQ); - QString tmpName = "$TEMPORARY/" + inFile.baseName() + ".tmp.cub"; - FileName tmpFile(tmpName); + QString tmpName = QString::fromStdString("$TEMPORARY/" + inFile.baseName() + ".tmp.cub"); + FileName tmpFile(tmpName.toStdString()); CubeAttributeOutput outatt = CubeAttributeOutput("+Real"); - p.SetOutputCube(tmpFile.expanded(), outatt); + p.SetOutputCube(QString::fromStdString(tmpFile.expanded()), outatt); p.SaveFileHeader(); Pvl labelPvl(inFile.expanded()); @@ -72,28 +72,28 @@ void IsisMain() { ProcessBySample p2; CubeAttributeInput inatt; - p2.SetInputCube(tmpFile.expanded(), inatt); + p2.SetInputCube(QString::fromStdString(tmpFile.expanded()), inatt); Cube *outcube = p2.SetOutputCube("TO"); // Get the directory where the OSIRIS translation tables are. - QString transDir = "$ISISROOT/appdata/translations/"; + std::string transDir = "$ISISROOT/appdata/translations/"; // Create a PVL to store the translated labels in Pvl outLabel; // Translate the Archive group FileName transFile(transDir + "RosettaOsirisArchive.trn"); - PvlToPvlTranslationManager archiveXlater(labelPvl, transFile.expanded()); + PvlToPvlTranslationManager archiveXlater(labelPvl, QString::fromStdString(transFile.expanded())); archiveXlater.Auto(outLabel); // Translate the BandBin group transFile = transDir + "RosettaOsirisBandBin.trn"; - PvlToPvlTranslationManager bandBinXlater(labelPvl, transFile.expanded()); + PvlToPvlTranslationManager bandBinXlater(labelPvl, QString::fromStdString(transFile.expanded())); bandBinXlater.Auto(outLabel); // Translate the Instrument group transFile = transDir + "RosettaOsirisInstrument.trn"; - PvlToPvlTranslationManager instrumentXlater(labelPvl, transFile.expanded()); + PvlToPvlTranslationManager instrumentXlater(labelPvl, QString::fromStdString(transFile.expanded())); instrumentXlater.Auto(outLabel); // Write the BandBin, Archive, and Instrument groups @@ -121,18 +121,18 @@ void IsisMain() { try { transFile = transDir + "RosettaOsirisFilters.trn"; PvlTranslationTable filterTable(transFile.expanded()); - filterCenters[i] = toDouble(filterTable.Translate("FilterCenter_" + instId, - filterNames[i])); - filterWidths[i] = toDouble(filterTable.Translate("FilterWidth_" + instId, - filterNames[i])); + filterCenters[i] = filterTable.Translate("FilterCenter_" + instId, + filterNames[i]).toDouble(); + filterWidths[i] = filterTable.Translate("FilterWidth_" + instId, + filterNames[i]).toDouble(); } catch (IException &e) { std::string msg = "Input file [" + inFile.expanded() + "] appears invalid. " + "FilterName [" - + filterNames[i] + + filterNames[i].toStdString() + "] for instrument [" - + instId + + instId.toStdString() + "] not found in [" + transFile.expanded() + "]."; throw IException(e, IException::Io, msg, _FILEINFO_); @@ -164,7 +164,7 @@ void IsisMain() { p2.StartProcess(flipbyline); p2.EndProcess(); - QString tmp(tmpFile.expanded()); + QString tmp(QString::fromStdString(tmpFile.expanded())); QFile::remove(tmp); } diff --git a/isis/src/rosetta/apps/rosvirtis2isis/main.cpp b/isis/src/rosetta/apps/rosvirtis2isis/main.cpp index 706bf5d1c9..8a8dca7fba 100644 --- a/isis/src/rosetta/apps/rosvirtis2isis/main.cpp +++ b/isis/src/rosetta/apps/rosvirtis2isis/main.cpp @@ -45,7 +45,7 @@ void IsisMain () ProcessImportPds p; UserInterface &ui = Application::GetUserInterface(); - FileName inFile = ui.GetFileName("FROM"); + FileName inFile = ui.GetFileName("FROM").toStdString(); Pvl pdsLabel; try { @@ -53,7 +53,7 @@ void IsisMain () } catch (IException &e) { // Try to fix the PVL before reading it in - QByteArray pvlData = pvlFix(inFile.expanded()); + QByteArray pvlData = pvlFix(QString::fromStdString(inFile.expanded())); QTextStream pvlTextStream(&pvlData); istringstream pvlStream(pvlTextStream.readAll().toStdString()); @@ -67,7 +67,7 @@ void IsisMain () } } - p.SetPdsFile(pdsLabel, inFile.expanded()); + p.SetPdsFile(pdsLabel, QString::fromStdString(inFile.expanded())); p.SetOrganization(Isis::ProcessImport::BIP); // Processing level 2 = uncalibrated @@ -125,7 +125,7 @@ void IsisMain () p.StartProcess(); // Get the directory where the Rosetta translation tables are. - QString transDir = "$ISISROOT/appdata/translations/"; + std::string transDir = "$ISISROOT/appdata/translations/"; if (procLevel == 2) { @@ -133,11 +133,11 @@ void IsisMain () QList hk; FileName hkTranslationFile = transDir + "RosettaVirtisMHousekeeping.def"; - QFile hkFile(hkTranslationFile.toString()); + QFile hkFile(QString::fromStdString(hkTranslationFile.toString())); if(!hkFile.open(QIODevice::ReadOnly)) { std::string msg = "Unable to open Virtis Housekeeping information file [" + - hkFile.fileName() + "]"; + hkFile.fileName().toStdString() + "]"; throw IException(IException::Io,msg, _FILEINFO_); } @@ -390,12 +390,12 @@ void IsisMain () // Translate the Archive group FileName transFile = transDir + "RosettaVirtisArchive.trn"; - PvlToPvlTranslationManager archiveXlater (pdsLabel, transFile.expanded()); + PvlToPvlTranslationManager archiveXlater (pdsLabel, QString::fromStdString(transFile.expanded())); archiveXlater.Auto(outLabel); // Translate the Instrument group transFile = transDir + "RosettaVirtisInstruments.trn"; - PvlToPvlTranslationManager instrumentXlater (pdsLabel, transFile.expanded()); + PvlToPvlTranslationManager instrumentXlater (pdsLabel, QString::fromStdString(transFile.expanded())); instrumentXlater.Auto(outLabel); if (procLevel == 3) { @@ -405,14 +405,14 @@ void IsisMain () // Pass the Start/Stop SCET values to naif to get the utc time. QString sclk = "$ISISDATA/rosetta/kernels/sclk/ROS_??????_STEP.TSC"; QString lsk = "$ISISDATA/base/kernels/lsk/naif????.tls"; - FileName sclkName(sclk); - FileName lskName(lsk); + FileName sclkName(sclk.toStdString()); + FileName lskName(lsk.toStdString()); sclkName = sclkName.highestVersion(); lskName = lskName.highestVersion(); - furnsh_c(lskName.expanded().toLatin1().data()); - furnsh_c(sclkName.expanded().toLatin1().data()); + furnsh_c(lskName.expanded().c_str()); + furnsh_c(sclkName.expanded().c_str()); SpiceDouble etStart; SpiceDouble etEnd; diff --git a/isis/src/rosetta/objs/RosettaOsirisCamera/RosettaOsirisCamera.cpp b/isis/src/rosetta/objs/RosettaOsirisCamera/RosettaOsirisCamera.cpp index d4b7e52575..5f1f16ae14 100644 --- a/isis/src/rosetta/objs/RosettaOsirisCamera/RosettaOsirisCamera.cpp +++ b/isis/src/rosetta/objs/RosettaOsirisCamera/RosettaOsirisCamera.cpp @@ -53,7 +53,7 @@ namespace Isis { // The Osiris focal length is fixed and is designed not to change throught the operational // temperature. For OSIRIS, the focal length is in mm, so we shouldn't need the unit conversion - QString ikCode = toString(naifIkCode()); + QString ikCode = QString::number(naifIkCode()); QString fl = "INS" + ikCode + "_FOCAL_LENGTH"; double focalLength = Spice::getDouble(fl); diff --git a/isis/src/rosetta/objs/RosettaOsirisCamera/unitTest.cpp b/isis/src/rosetta/objs/RosettaOsirisCamera/unitTest.cpp index 964c211226..87bbf9e5ea 100644 --- a/isis/src/rosetta/objs/RosettaOsirisCamera/unitTest.cpp +++ b/isis/src/rosetta/objs/RosettaOsirisCamera/unitTest.cpp @@ -33,7 +33,7 @@ int main(void) { cout << "Unit Test for RosettaOsirisCameraDistortionMap..." << endl; try { - Cube c(testNACFile, "r"); + Cube c(testNACFile.toStdString(), "r"); Camera *cam = c.camera(); RosettaOsirisCameraDistortionMap *testMap = new RosettaOsirisCameraDistortionMap(cam); cout << "Create default distortion map" << endl; @@ -156,9 +156,9 @@ int main(void) { double knownLat = 66.7031631205829569; double knownLon = 95.7688045622462880; - Cube c(testNACFile, "r"); + Cube c(testNACFile.toStdString(), "r"); RosettaOsirisCamera *cam = (RosettaOsirisCamera *) CameraFactory::Create(c); - cout << "FileName: " << FileName(c.fileName()).name() << endl; + cout << "FileName: " << FileName(c.fileName().toStdString()).name() << endl; cout << "CK Frame: " << cam->instrumentRotation()->Frame() << endl << endl; cout.setf(std::ios::fixed); cout << setprecision(9); @@ -171,10 +171,10 @@ int main(void) { cout << "SPK Reference ID = " << cam->SpkReferenceId() << endl << endl; // Test name methods - cout << "Spacecraft Name Long: " << cam->spacecraftNameLong() << endl; - cout << "Spacecraft Name Short: " << cam->spacecraftNameShort() << endl; - cout << "Instrument Name Long: " << cam->instrumentNameLong() << endl; - cout << "Instrument Name Short: " << cam->instrumentNameShort() << endl << endl; + cout << "Spacecraft Name Long: " << cam->spacecraftNameLong().toStdString() << endl; + cout << "Spacecraft Name Short: " << cam->spacecraftNameShort().toStdString() << endl; + cout << "Instrument Name Long: " << cam->instrumentNameLong().toStdString() << endl; + cout << "Instrument Name Short: " << cam->instrumentNameShort().toStdString() << endl << endl; // Test four pixels to make sure the conversions are right @@ -217,7 +217,7 @@ int main(void) { cout << endl << "Test WAC with subwindowing..." << endl << endl; - Cube wacCube(testWACFile, "r"); + Cube wacCube(testWACFile.toStdString(), "r"); RosettaOsirisCamera *wideAngleCam = (RosettaOsirisCamera *) CameraFactory::Create(wacCube); cout << "For upper left corner of asteroid ..." << endl; diff --git a/isis/src/rosetta/objs/RosettaVirtisCamera/RosettaVirtisCamera.cpp b/isis/src/rosetta/objs/RosettaVirtisCamera/RosettaVirtisCamera.cpp index 61605b16f6..f8c50c2520 100644 --- a/isis/src/rosetta/objs/RosettaVirtisCamera/RosettaVirtisCamera.cpp +++ b/isis/src/rosetta/objs/RosettaVirtisCamera/RosettaVirtisCamera.cpp @@ -58,7 +58,7 @@ namespace Isis { QString instrumentId = QString::fromStdString(inst["InstrumentId"]); if ( "virtis" != instrumentId.toLower()) { std::string mess = "This data is apparently not from the VIRTIS instrument but " - + instrumentId; + + instrumentId.toStdString(); throw IException(IException::User, mess, _FILEINFO_); } @@ -124,10 +124,10 @@ namespace Isis { // Setup focal plane map new CameraFocalPlaneMap(this, naifIkCode()); // Retrieve boresight location from instrument kernel (IK) (addendum?) - QString ikernKey = "INS" + toString(naifIkCode()) + "_BORESIGHT_SAMPLE"; + QString ikernKey = "INS" + QString::number(naifIkCode()) + "_BORESIGHT_SAMPLE"; double sampleBoreSight = getDouble(ikernKey); - ikernKey = "INS" + toString(naifIkCode()) + "_BORESIGHT_LINE"; + ikernKey = "INS" + QString::number(naifIkCode()) + "_BORESIGHT_LINE"; double lineBoreSight = getDouble(ikernKey); FocalPlaneMap()->SetDetectorOrigin(sampleBoreSight, lineBoreSight); @@ -301,7 +301,7 @@ namespace Isis { void RosettaVirtisCamera::readSCET(const QString &filename) { // Open the ISIS table object std::vector cacheTime; - Table hktable("VIRTISHouseKeeping", filename); + Table hktable("VIRTISHouseKeeping", filename.toStdString()); m_lineRates.clear(); int lineno(1); double lineEndTime = 0; @@ -356,7 +356,7 @@ namespace Isis { void RosettaVirtisCamera::readHouseKeeping(const QString &filename, double lineRate) { // Open the ISIS table object - Table hktable("VIRTISHouseKeeping", filename); + Table hktable("VIRTISHouseKeeping", filename.toStdString()); m_lineRates.clear(); int lineno(1); @@ -377,7 +377,7 @@ namespace Isis { ScanMirrorInfo smInfo; double lineMidTime; // scs2e_c(naifSpkCode(), scet.c_str(), &lineMidTime); - lineMidTime = getClockTime(toString(scet), naifSpkCode()).Et(); + lineMidTime = getClockTime(QString::number(scet), naifSpkCode()).Et(); bool isDark = (shutterMode == 1); // Add fit data for all open angles @@ -601,8 +601,8 @@ namespace Isis { } catch (IException &ie2) { ostringstream mess; - mess << "Could not get state rotation for Frame1 (" << frame1 - << ") to Frame2 (" << frame2 << ") at time " << etTime; + mess << "Could not get state rotation for Frame1 (" << frame1.toStdString() + << ") to Frame2 (" << frame2.toStdString() << ") at time " << etTime; throw IException(ie2, IException::User, mess.str(), _FILEINFO_); } } diff --git a/isis/src/rosetta/objs/RosettaVirtisCamera/unitTest.cpp b/isis/src/rosetta/objs/RosettaVirtisCamera/unitTest.cpp index 8bca23dfc3..060385d124 100644 --- a/isis/src/rosetta/objs/RosettaVirtisCamera/unitTest.cpp +++ b/isis/src/rosetta/objs/RosettaVirtisCamera/unitTest.cpp @@ -68,7 +68,7 @@ int main(void) { } int TestCamera(Camera *cam, Cube c, double lines, double knownLat, double knownLon) { - cout << "FileName: " << FileName(c.fileName()).name() << endl; + cout << "FileName: " << FileName(c.fileName().toStdString()).name() << endl; cout << "CK Frame: " << cam->instrumentRotation()->Frame() << endl << endl; cout.setf(std::ios::fixed); cout << setprecision(9); @@ -81,10 +81,10 @@ int TestCamera(Camera *cam, Cube c, double lines, double knownLat, double knownL cout << "SPK Reference ID = " << cam->SpkReferenceId() << endl << endl; // Test name methods - cout << "Spacecraft Name Long: " << cam->spacecraftNameLong() << endl; - cout << "Spacecraft Name Short: " << cam->spacecraftNameShort() << endl; - cout << "Instrument Name Long: " << cam->instrumentNameLong() << endl; - cout << "Instrument Name Short: " << cam->instrumentNameShort() << endl << endl; + cout << "Spacecraft Name Long: " << cam->spacecraftNameLong().toStdString() << endl; + cout << "Spacecraft Name Short: " << cam->spacecraftNameShort().toStdString() << endl; + cout << "Instrument Name Long: " << cam->instrumentNameLong().toStdString() << endl; + cout << "Instrument Name Short: " << cam->instrumentNameShort().toStdString() << endl << endl; // Test Shutter Open/Close std::pair< double, double > imgTimes = cam->StartEndEphemerisTimes(); diff --git a/isis/src/socet/apps/socetlinescankeywords/socetlinescankeywords.cpp b/isis/src/socet/apps/socetlinescankeywords/socetlinescankeywords.cpp index 1bb59f9ee3..f611bb671d 100644 --- a/isis/src/socet/apps/socetlinescankeywords/socetlinescankeywords.cpp +++ b/isis/src/socet/apps/socetlinescankeywords/socetlinescankeywords.cpp @@ -869,7 +869,7 @@ void socetlinescankeywords(Cube *input, UserInterface &ui) { // // system call to ISIS function tabledump to dump LineScanTimes // char syscmd[1056]; // sprintf(syscmd, "tabledump from=%s to=%s name=LineScanTimes", -// cubefname.expanded().toLatin1().data(), tablefname.expanded().toAscii().data()); +// cubefname.expanded().c_str(), tablefname.expanded().toAscii().data()); // // int n = system(syscmd); // if (n != 0) @@ -879,7 +879,7 @@ void socetlinescankeywords(Cube *input, UserInterface &ui) { // // HrscCamera::ReadLineRates(IString filename) is private // // // open tabledump.txt for reading -// ifstream fpIn(tablefname.expanded().toLatin1().data(), ifstream::in); +// ifstream fpIn(tablefname.expanded().c_str(), ifstream::in); // if (!fpIn) // return -1; // diff --git a/isis/src/tgo/apps/tgocassis2isis/tgocassis2isis.cpp b/isis/src/tgo/apps/tgocassis2isis/tgocassis2isis.cpp index d8d282ad84..58fbb73552 100644 --- a/isis/src/tgo/apps/tgocassis2isis/tgocassis2isis.cpp +++ b/isis/src/tgo/apps/tgocassis2isis/tgocassis2isis.cpp @@ -35,14 +35,14 @@ namespace Isis { static QString convertUniqueIdToObservationId(Pvl &outputLabel); void tgocassis2isis(UserInterface &ui) { - FileName xmlFileName = ui.GetFileName("FROM"); + FileName xmlFileName = ui.GetFileName("FROM").toStdString(); if (!xmlFileName.removeExtension().addExtension("dat").fileExists() && !xmlFileName.removeExtension().addExtension("img").fileExists()) { std::string msg = "Cannot find image file for [" + xmlFileName.name() + "]. Confirm that the " ".dat or .img file for this XML exists and is located in the same directory."; throw IException(IException::User, msg, _FILEINFO_); } - if(xmlFileName.name().contains("cas_raw_sc")){ + if(QString::fromStdString(xmlFileName.name()).contains("cas_raw_sc")){ std::string msg = "tgocassis2isis is unable to process cas_raw_sc data. Please use cas_cal_sc data instead."; throw IException(IException::User, msg, _FILEINFO_); } @@ -52,10 +52,10 @@ namespace Isis { translateCoreInfo(xmlFileName, importer); if(xmlFileName.removeExtension().addExtension("dat").fileExists()){ - importer.SetInputFile(xmlFileName.removeExtension().addExtension("dat").expanded()); + importer.SetInputFile(QString::fromStdString(xmlFileName.removeExtension().addExtension("dat").expanded())); } else if (xmlFileName.removeExtension().addExtension("img").fileExists()) { - importer.SetInputFile(xmlFileName.removeExtension().addExtension("img").expanded()); + importer.SetInputFile(QString::fromStdString(xmlFileName.removeExtension().addExtension("img").expanded())); } else { std::string msg = "Cannot find image file for [" + xmlFileName.name() + "]. Confirm that the " @@ -67,7 +67,7 @@ namespace Isis { Cube *outputCube = importer.SetOutputCube(ui.GetCubeName("TO"), att); QString transRawFile = "TgoCassisInstrument.trn"; - QFile xmlFile(xmlFileName.expanded()); + QFile xmlFile(QString::fromStdString(xmlFileName.expanded())); QDomDocument xmlDoc; xmlDoc.setContent(&xmlFile, true); // If any instances of "Optical_Filter" or "Mission_Area" exist, use PSA .trn file @@ -111,7 +111,7 @@ namespace Isis { convertUniqueIdToObservationId(*outputLabel); } - FileName outputCubeFileName(ui.GetCubeName("TO")); + FileName outputCubeFileName(ui.GetCubeName("TO").toStdString()); OriginalXmlLabel xmlLabel; xmlLabel.readFromXmlFile(xmlFileName); @@ -151,14 +151,14 @@ namespace Isis { // Get the translation manager ready FileName transFile; try { - transFile = FileName(missionDir + "TgoCassis.trn"); - XmlToPvlTranslationManager labelXlater(inputLabel, transFile.expanded()); + transFile = FileName(missionDir.toStdString() + "TgoCassis.trn"); + XmlToPvlTranslationManager labelXlater(inputLabel, QString::fromStdString(transFile.expanded())); translateCoreInfo(labelXlater, importer); } catch (IException &e) { // if exported, use this! - transFile = FileName(missionDir + "TgoCassisRdr.trn"); - XmlToPvlTranslationManager labelXlater(inputLabel, transFile.expanded()); + transFile = FileName(missionDir.toStdString() + "TgoCassisRdr.trn"); + XmlToPvlTranslationManager labelXlater(inputLabel, QString::fromStdString(transFile.expanded())); translateCoreInfo(labelXlater, importer); } } @@ -180,25 +180,25 @@ namespace Isis { // Set up the ProcessImport QString str; str = labelXlater.Translate("CoreSamples"); - int ns = toInt(str); + int ns = str.toInt(); str = labelXlater.Translate("CoreLines"); - int nl = toInt(str); + int nl = str.toInt(); str = labelXlater.Translate("CoreBands"); - int nb = toInt(str); + int nb = str.toInt(); importer.SetDimensions(ns, nl, nb); str = labelXlater.Translate("CoreType"); importer.SetPixelType(PixelTypeEnumeration(str)); str = labelXlater.Translate("CoreByteOrder"); - importer.SetByteOrder(ByteOrderEnumeration(str)); + importer.SetByteOrder(ByteOrderEnumeration(str.toStdString())); importer.SetFileHeaderBytes(0); str = labelXlater.Translate("CoreBase"); - importer.SetBase(toDouble(str)); + importer.SetBase(str.toDouble()); str = labelXlater.Translate("CoreMultiplier"); - importer.SetMultiplier(toDouble(str)); + importer.SetMultiplier(str.toDouble()); } @@ -214,18 +214,18 @@ namespace Isis { try { QString missionDir = "$ISISROOT/appdata/translations/"; QDomDocument xmlDoc; - QFile xmlFile(xmlFileName.expanded()); + QFile xmlFile(QString::fromStdString(xmlFileName.expanded())); xmlDoc.setContent(&xmlFile, true); // If any instances of "Observing_System_Component" exist, use PSA .trn file FileName mapTransFile; if (xmlDoc.elementsByTagName("cart:a_axis_radius").size()){ - mapTransFile = FileName(missionDir + "TgoCassisMapping_PSA.trn"); + mapTransFile = FileName(missionDir.toStdString() + "TgoCassisMapping_PSA.trn"); } else { - mapTransFile = FileName(missionDir + "TgoCassisMapping.trn"); + mapTransFile = FileName(missionDir.toStdString() + "TgoCassisMapping.trn"); } // Get the translation manager ready for translating the mapping label - XmlToPvlTranslationManager labelXMappinglater(xmlFileName, mapTransFile.expanded()); + XmlToPvlTranslationManager labelXMappinglater(xmlFileName, QString::fromStdString(mapTransFile.expanded())); // Pvl output label Pvl *outputLabel = outputCube->label(); @@ -252,7 +252,7 @@ namespace Isis { bool translateMosaicLabel(FileName xmlFileName, Cube *outputCube) { QDomDocument xmlDoc; - QFile xmlFile(xmlFileName.expanded()); + QFile xmlFile(QString::fromStdString(xmlFileName.expanded())); if ( !xmlFile.open(QIODevice::ReadOnly) ) { std::string msg = "Could not open label file [" + xmlFileName.expanded() + "]."; @@ -265,7 +265,7 @@ namespace Isis { xmlFile.close(); std::string msg = "XML read/parse error in file [" + xmlFileName.expanded() + "] at line [" + toString(errline) + "], column [" + toString(errcol) - + "], message: " + errmsg; + + "], message: " + errmsg.toStdString(); throw IException(IException::Unknown, msg, _FILEINFO_); } @@ -282,16 +282,16 @@ namespace Isis { if (logicalIdStringList.contains("data_mosaic")) { try { QString missionDir = "$ISISROOT/appdata/translations"; - FileName bandBinTransFile(missionDir + "/translations/TgoCassisMosaicBandBin.trn"); + FileName bandBinTransFile(missionDir.toStdString() + "/translations/TgoCassisMosaicBandBin.trn"); // Get the translation manager ready for translating the band bin label - XmlToPvlTranslationManager labelXBandBinlater(xmlFileName, bandBinTransFile.expanded()); + XmlToPvlTranslationManager labelXBandBinlater(xmlFileName, QString::fromStdString(bandBinTransFile.expanded())); // Pvl output label Pvl *outputLabel = outputCube->label(); labelXBandBinlater.Auto(*(outputLabel)); - FileName mosaicTransFile(missionDir + "/translations/TgoCassisMosaic.trn"); + FileName mosaicTransFile(missionDir.toStdString() + "/translations/TgoCassisMosaic.trn"); // Get the translation manager ready for translating the mosaic label - XmlToPvlTranslationManager labelXMosaiclater(xmlFileName, mosaicTransFile.expanded()); + XmlToPvlTranslationManager labelXMosaiclater(xmlFileName, QString::fromStdString(mosaicTransFile.expanded())); labelXMosaiclater.Auto(*(outputLabel)); return true; } @@ -328,10 +328,10 @@ namespace Isis { void translateLabels(FileName &inputLabel, Cube *outputCube, QString instTransFile) { // Get the directory where the Tgo translation tables are QString missionDir = "$ISISROOT/appdata/translations/"; - FileName transFile(missionDir + instTransFile); + FileName transFile(missionDir.toStdString() + instTransFile.toStdString()); // Get the translation manager ready for translating the instrument label - XmlToPvlTranslationManager labelXlater(inputLabel, transFile.expanded()); + XmlToPvlTranslationManager labelXlater(inputLabel, QString::fromStdString(transFile.expanded())); // Pvl output label Pvl *outputLabel = outputCube->label(); @@ -345,8 +345,8 @@ namespace Isis { inst.findKeyword("ExposureDuration").setUnits("seconds"); } // Translate BandBin group - FileName bandBinTransFile(missionDir + "TgoCassisBandBin.trn"); - XmlToPvlTranslationManager bandBinXlater(inputLabel, bandBinTransFile.expanded()); + FileName bandBinTransFile(missionDir.toStdString() + "TgoCassisBandBin.trn"); + XmlToPvlTranslationManager bandBinXlater(inputLabel, QString::fromStdString(bandBinTransFile.expanded())); // Pvl output label outputLabel = outputCube->label(); @@ -357,11 +357,11 @@ namespace Isis { bandBin.findKeyword("Width").setUnits("nm"); // Create the Archive Group - FileName archiveTransFile(missionDir + "TgoCassisArchive.trn"); - XmlToPvlTranslationManager archiveXlater(inputLabel, archiveTransFile.expanded()); + FileName archiveTransFile(missionDir.toStdString() + "TgoCassisArchive.trn"); + XmlToPvlTranslationManager archiveXlater(inputLabel, QString::fromStdString(archiveTransFile.expanded())); - FileName subTransFile(missionDir + "TgoCassisSubWindow.trn"); - XmlToPvlTranslationManager subXlater(inputLabel, subTransFile.expanded()); + FileName subTransFile(missionDir.toStdString() + "TgoCassisSubWindow.trn"); + XmlToPvlTranslationManager subXlater(inputLabel, QString::fromStdString(subTransFile.expanded())); // Pvl output label outputLabel = outputCube->label(); @@ -460,7 +460,7 @@ namespace Isis { } else { std::string msg = "Unrecognized filter name [" - + filter + + filter.toStdString() + "]."; throw IException(IException::User, msg, _FILEINFO_); @@ -470,9 +470,9 @@ namespace Isis { } else { std::string msg = "Unrecognized Spacecraft name [" - + spcName + + spcName.toStdString() + "] and instrument ID [" - + instId + + instId.toStdString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -481,7 +481,7 @@ namespace Isis { // Add an alpha cube group based on the subwindowing if (archive.hasKeyword("Window_Count")) { int windowNumber = (int)archive["Window_Count"] + 1; - QString windowString = "Window_" + toString(windowNumber); + QString windowString = "Window_" + QString::number(windowNumber); int frameletStartSample = (int) archive[windowString.toStdString() + "_Start_Sample"] + 1; int frameletEndSample = (int) archive[windowString.toStdString() + "_End_Sample"] + 1; int frameletStartLine = (int) archive[windowString.toStdString() + "_Start_Line"] + 1; @@ -521,7 +521,7 @@ namespace Isis { operationPeriod /= qPow(2,28); FileName transFile("$ISISROOT/appdata/translations/TgoCassisOperationPeriod.trn"); PvlTranslationTable transTable(transFile); - observationId = transTable.Translate("OperationPeriod", toString(operationPeriod)); + observationId = transTable.Translate("OperationPeriod", QString::number(operationPeriod)); BigInt orbitNumber = (uniqueIdDecimalValue & 268433408); orbitNumber /= qPow(2,11); observationId += "_"; @@ -539,7 +539,7 @@ namespace Isis { int imageType = (uniqueIdDecimalValue & 3); observationId += "_"; - observationId += toString(imageType); + observationId += QString::number(imageType); archiveGroup += PvlKeyword("ObservationId", observationId.toStdString()); diff --git a/isis/src/tgo/apps/tgocassismos/tgocassismos.cpp b/isis/src/tgo/apps/tgocassismos/tgocassismos.cpp index 04712670e8..2adfe3336d 100644 --- a/isis/src/tgo/apps/tgocassismos/tgocassismos.cpp +++ b/isis/src/tgo/apps/tgocassismos/tgocassismos.cpp @@ -34,12 +34,12 @@ namespace Isis { void tgocassismos(UserInterface &ui) { // Get the list of cubes to mosaic - FileList fromList(ui.GetFileName("FROMLIST")); + FileList fromList(ui.GetFileName("FROMLIST").toStdString()); vector cubeList; try { if (fromList.size() < 1) { - std::string msg = "the list file [" + ui.GetFileName("FROMLIST") + + std::string msg = "the list file [" + ui.GetFileName("FROMLIST").toStdString() + "does not contain any data"; throw IException(IException::User, msg, _FILEINFO_); } @@ -49,7 +49,7 @@ namespace Isis { for (int i = 0; i < fromList.size(); i++) { Cube *cube = new Cube(); cubeList.push_back(cube); - cube->open(fromList[i].toString()); + cube->open(QString::fromStdString(fromList[i].toString())); } @@ -272,7 +272,7 @@ namespace Isis { cubeList[i]->close(); delete cubeList[i]; } - std::string msg = "The mosaic [" + ui.GetCubeName("TO") + "] was NOT created"; + std::string msg = "The mosaic [" + ui.GetCubeName("TO").toStdString() + "] was NOT created"; throw IException(IException::User, msg, _FILEINFO_); } } // end of isis main diff --git a/isis/src/tgo/apps/tgocassisrdrgen/tgocassisrdrgen.cpp b/isis/src/tgo/apps/tgocassisrdrgen/tgocassisrdrgen.cpp index ecb98a3ca9..c009b19510 100644 --- a/isis/src/tgo/apps/tgocassisrdrgen/tgocassisrdrgen.cpp +++ b/isis/src/tgo/apps/tgocassisrdrgen/tgocassisrdrgen.cpp @@ -31,8 +31,8 @@ namespace Isis { Cube icube; // Check if input file is indeed, a cube - if (FileName(ui.GetCubeName("FROM")).expanded().right(3) != "cub") { - std::string msg = "Input file [" + ui.GetCubeName("FROM") + + if (QString::fromStdString(FileName(ui.GetCubeName("FROM").toStdString()).expanded()).right(3) != "cub") { + std::string msg = "Input file [" + ui.GetCubeName("FROM").toStdString() + "] does not appear to be a cube"; throw IException(IException::User, msg, _FILEINFO_); } @@ -68,7 +68,7 @@ namespace Isis { // Check if the cube is able to be translated into a CaSSIS xml file // This could very well be unnecessary if (!targetGroup.findKeyword("InstrumentId").isEquivalent("CaSSIS")) { - std::string msg = "Input file [" + ui.GetCubeName("FROM") + + std::string msg = "Input file [" + ui.GetCubeName("FROM").toStdString() + "] does not appear to be a CaSSIS RDR product. The image" + "instrument is not the CaSSIS instrument"; throw IException(IException::User, msg, _FILEINFO_); diff --git a/isis/src/tgo/apps/tgocassisstitch/tgocassisstitch.cpp b/isis/src/tgo/apps/tgocassisstitch/tgocassisstitch.cpp index b5f62e940c..2bec9628a8 100644 --- a/isis/src/tgo/apps/tgocassisstitch/tgocassisstitch.cpp +++ b/isis/src/tgo/apps/tgocassisstitch/tgocassisstitch.cpp @@ -56,7 +56,7 @@ namespace Isis { try { // Open up the list of framelet files - FileName frameletListFile = ui.GetFileName("FROMLIST"); + FileName frameletListFile = ui.GetFileName("FROMLIST").toStdString(); // Sort the framelets into frames based on start time frameMap = sortFramelets(frameletListFile); @@ -67,14 +67,14 @@ namespace Isis { } // read the optional cubename - FileName frameletCubeFlag(ui.GetCubeName("CUBENAME")); - QString frameletCubeName = frameletCubeFlag.expanded(); + FileName frameletCubeFlag(ui.GetCubeName("CUBENAME").toStdString()); + QString frameletCubeName = QString::fromStdString(frameletCubeFlag.expanded()); // Stitch together the individual frames - FileName outputPrefix(ui.GetCubeName("OUTPUTPREFIX")); - FileName outputSuffix(ui.GetCubeName("OUTPUTSUFFIX")); - QString outputPrefBaseName = outputPrefix.expanded(); - QString outputSuffBaseName = outputSuffix.expanded(); + FileName outputPrefix(ui.GetCubeName("OUTPUTPREFIX").toStdString()); + FileName outputSuffix(ui.GetCubeName("OUTPUTSUFFIX").toStdString()); + QString outputPrefBaseName = QString::fromStdString(outputPrefix.expanded()); + QString outputSuffBaseName = QString::fromStdString(outputSuffix.expanded()); QStringList frameKeys = frameMap.uniqueKeys(); Progress stitchProgress; stitchProgress.SetText("Stitching Frames"); @@ -86,20 +86,20 @@ namespace Isis { QString frameIdentifier = frameKey.split("/").last(); FileName frameFileName; if (frameletCubeName != "") { - frameFileName = FileName(outputPrefBaseName + "-" + - frameletCubeName + - outputSuffBaseName + ".cub"); + frameFileName = FileName(outputPrefBaseName.toStdString() + "-" + + frameletCubeName.toStdString() + + outputSuffBaseName.toStdString() + ".cub"); } else { - frameFileName = FileName(outputPrefBaseName + "-" + - frameIdentifier + - outputSuffBaseName + ".cub"); + frameFileName = FileName(outputPrefBaseName.toStdString() + "-" + + frameIdentifier.toStdString() + + outputSuffBaseName.toStdString() + ".cub"); } stitchFrame( frameMap.values(frameKey), frameFileName ); stitchProgress.CheckStatus(); } catch (IException &e) { std::string msg = "Failed stitch frame for observation [" - + frameKey + "]."; + + frameKey.toStdString() + "]."; throw IException(e, IException::Unknown, msg, _FILEINFO_); } } @@ -121,11 +121,11 @@ namespace Isis { QMap sortFramelets(FileName frameletListFile) { QMultiMap frameMap; - ObservationNumberList frameletList(frameletListFile.expanded(), false); + ObservationNumberList frameletList(QString::fromStdString(frameletListFile.expanded()), false); for (int i = 0; i < frameletList.size(); i++) { frameMap.insert( frameletList.observationNumber(i), - frameletList.fileName(i) ); + frameletList.fileName(i).toStdString() ); } return std::move(frameMap); @@ -152,7 +152,7 @@ namespace Isis { frameCube.setPixelType( firstFrameletCube.pixelType() ); frameCube.setByteOrder( firstFrameletCube.byteOrder() ); frameCube.setBaseMultiplier( firstFrameletCube.base(), firstFrameletCube.multiplier() ); - frameCube.create( frameFileName.expanded() ); + frameCube.create( QString::fromStdString(frameFileName.expanded()) ); // Setup the label for the new cube PvlGroup kernGroup = firstFrameletCube.group("Kernels"); @@ -181,7 +181,7 @@ namespace Isis { Pvl &frameCubeLabel = *frameCube.label(); for(int i = 0; i < firstFrameletLabel.objects(); i++) { if(firstFrameletLabel.object(i).isNamed("Table")) { - Isis::Blob table(QString::fromStdString(firstFrameletLabel.object(i)["Name"]), firstFrameletLabel.object(i).name()); + Isis::Blob table(firstFrameletLabel.object(i)["Name"], firstFrameletLabel.object(i).name()); firstFrameletCube.read(table); frameCube.write(table); } @@ -199,12 +199,12 @@ namespace Isis { ProcessByLine frameletProcess; frameletProcess.Progress()->DisableAutomaticDisplay(); CubeAttributeInput inputAtts(frameletFile); - Cube *frameletCube = frameletProcess.SetInputCube(frameletFile.expanded(), inputAtts); + Cube *frameletCube = frameletProcess.SetInputCube(QString::fromStdString(frameletFile.expanded()), inputAtts); // Check for summing in the framelet cube // Eventually summing can be handled, but right now we don't know enough, so error PvlGroup frameletInst = frameletCube->group("Instrument"); if ((int)frameletInst["SummingMode"] != 0) { - std::string msg = "Summing mode [" + QString::fromStdString(frameletInst["SummingMode"]) + std::string msg = "Summing mode [" + (std::string)frameletInst["SummingMode"] + "] for framelet [" + frameletFile.expanded() + "] is not supported."; throw IException(IException::User, msg, _FILEINFO_); @@ -236,7 +236,7 @@ namespace Isis { Pvl &frameletLabel = *frameletCube->label(); for(int i = 0; i < frameletLabel.objects(); i++) { if( frameletLabel.object(i).isNamed("History") ) { - Blob historyBlob(QString::fromStdString(frameletLabel.object(i)["Name"]), "History" ); + Blob historyBlob(frameletLabel.object(i)["Name"], "History" ); frameletCube->read(historyBlob); frameCube.write(historyBlob); } diff --git a/isis/src/tgo/apps/tgocassisunstitch/tgocassisunstitch.cpp b/isis/src/tgo/apps/tgocassisunstitch/tgocassisunstitch.cpp index 4e0cc42127..a9f11a7970 100644 --- a/isis/src/tgo/apps/tgocassisunstitch/tgocassisunstitch.cpp +++ b/isis/src/tgo/apps/tgocassisunstitch/tgocassisunstitch.cpp @@ -68,7 +68,7 @@ namespace Isis { // Load in the fullframe cube QString from = ui.GetAsString("FROM"); - CubeAttributeInput inAtt(from); + CubeAttributeInput inAtt(from.toStdString()); cube = new Cube(); cube->setVirtualBands(inAtt.bands()); from = ui.GetCubeName("FROM"); @@ -103,7 +103,7 @@ namespace Isis { QList inputBlobs; for(int i = 0; i < inputLabel->objects(); i++) { if(inputLabel->object(i).isNamed("Table")) { - Blob table(QString::fromStdString(inputLabel->object(i)["Name"]), inputLabel->object(i).name()); + Blob table(inputLabel->object(i)["Name"], inputLabel->object(i).name()); cube->read(table); inputBlobs.append(table); } @@ -117,19 +117,19 @@ namespace Isis { // Determine sizes of framelets in input fullframe images // Allocate this number of total cubes of the correct size - FileName outputFileName(ui.GetCubeName("OUTPUTPREFIX")); + FileName outputFileName(ui.GetCubeName("OUTPUTPREFIX").toStdString()); // Sometimes there will be '.'s in an OUTPUT prefix that could // be confused with a file extension - QString outputBaseName = outputFileName.expanded(); + QString outputBaseName = QString::fromStdString(outputFileName.expanded()); if (outputFileName.extension() == "cub") { - outputBaseName = outputFileName.removeExtension().expanded(); + outputBaseName = QString::fromStdString(outputFileName.removeExtension().expanded()); } // Create and output a list of QFile allCubesListFile(outputBaseName + ".lis"); if (!allCubesListFile.open(QFile::WriteOnly | QFile::Text)) { - std::string msg = "Unable to write file [" + allCubesListFile.fileName() + "]"; + std::string msg = "Unable to write file [" + allCubesListFile.fileName().toStdString() + "]"; throw IException(IException::User, msg, _FILEINFO_); } @@ -144,12 +144,12 @@ namespace Isis { Cube *frameletCube = new Cube(); frameletCube->setDimensions(g_frameletInfoList[i].m_samples, g_frameletInfoList[i].m_lines, 1); - FileName frameletCubeFileName(outputBaseName - + "_" + g_frameletInfoList[i].m_filterName + FileName frameletCubeFileName(outputBaseName.toStdString() + + "_" + g_frameletInfoList[i].m_filterName.toStdString() + ".cub"); - frameletCube->create(frameletCubeFileName.expanded()); + frameletCube->create(QString::fromStdString(frameletCubeFileName.expanded())); g_outputCubes.append(frameletCube); - allCubesListWriter << frameletCubeFileName.baseName() << ".cub\n"; + allCubesListWriter << QString::fromStdString(frameletCubeFileName.baseName()) << ".cub\n"; } // Unstitch diff --git a/isis/src/tgo/objs/TgoCassisCamera/TgoCassisCamera.cpp b/isis/src/tgo/objs/TgoCassisCamera/TgoCassisCamera.cpp index 3fb1ec464c..76c65262eb 100644 --- a/isis/src/tgo/objs/TgoCassisCamera/TgoCassisCamera.cpp +++ b/isis/src/tgo/objs/TgoCassisCamera/TgoCassisCamera.cpp @@ -46,7 +46,7 @@ namespace Isis { // CaSSIS codes int cassisCode = naifIkCode(); - QString cassis = toString(cassisCode); + QString cassis = QString::number(cassisCode); // Get all the necessary stuff from the labels Pvl &lab = *cube.label(); diff --git a/isis/src/tgo/objs/TgoCassisCamera/TgoCassisDistortionMap.cpp b/isis/src/tgo/objs/TgoCassisCamera/TgoCassisDistortionMap.cpp index d2f133d1c7..a958486a31 100644 --- a/isis/src/tgo/objs/TgoCassisCamera/TgoCassisDistortionMap.cpp +++ b/isis/src/tgo/objs/TgoCassisCamera/TgoCassisDistortionMap.cpp @@ -30,7 +30,7 @@ namespace Isis { int naifIkCode) : CameraDistortionMap(parent) { - QString od = "INS" + toString(naifIkCode) + "_OD_"; + QString od = "INS" + QString::number(naifIkCode) + "_OD_"; for(int i = 0; i < 6; i++) { m_A1_corr.push_back(p_camera->getDouble(od + "A1_CORR", i)); @@ -40,9 +40,9 @@ namespace Isis { m_A2_dist.push_back(p_camera->getDouble(od + "A2_DIST", i)); m_A3_dist.push_back(p_camera->getDouble(od + "A3_DIST", i)); } - m_pixelPitch = p_camera->getDouble("INS" + toString(naifIkCode) + "_PIXEL_PITCH"); - m_width = p_camera->getDouble("INS" + toString(naifIkCode) + "_FILTER_SAMPLES"); - m_height = p_camera->getDouble("INS" + toString(naifIkCode) + "_FILTER_LINES"); + m_pixelPitch = p_camera->getDouble("INS" + QString::number(naifIkCode) + "_PIXEL_PITCH"); + m_width = p_camera->getDouble("INS" + QString::number(naifIkCode) + "_FILTER_SAMPLES"); + m_height = p_camera->getDouble("INS" + QString::number(naifIkCode) + "_FILTER_LINES"); } diff --git a/isis/src/tgo/objs/TgoCassisCamera/unitTest.cpp b/isis/src/tgo/objs/TgoCassisCamera/unitTest.cpp index 4dd956e9a2..c5e3d76d40 100644 --- a/isis/src/tgo/objs/TgoCassisCamera/unitTest.cpp +++ b/isis/src/tgo/objs/TgoCassisCamera/unitTest.cpp @@ -46,7 +46,7 @@ int main(void) { Cube c("$ISISTESTDATA/isis/src/tgo/unitTestData/CAS-MCO-2016-11-22T16.38.39.354-NIR-02036-00.cub", "r"); TgoCassisCamera *cam = (TgoCassisCamera *) CameraFactory::Create(c); - qDebug() << "FileName: " << FileName(c.fileName()).name(); + qDebug() << "FileName: " << QString::fromStdString(FileName(c.fileName().toStdString()).name()); qDebug() << "Instrument Rotation Frame: " << cam->instrumentRotation()->Frame(); qDebug() << ""; diff --git a/isis/src/viking/apps/vik2isis/main.cpp b/isis/src/viking/apps/vik2isis/main.cpp index 28e82740c3..f365524ae9 100644 --- a/isis/src/viking/apps/vik2isis/main.cpp +++ b/isis/src/viking/apps/vik2isis/main.cpp @@ -28,9 +28,9 @@ void IsisMain() { // We should be processing a PDS file ProcessImportPds p; UserInterface &ui = Application::GetUserInterface(); - FileName in = ui.GetFileName("FROM"); + FileName in = ui.GetFileName("FROM").toStdString(); - QString tempName = "$TEMPORARY/" + in.baseName() + ".img"; + std::string tempName = "$TEMPORARY/" + in.baseName() + ".img"; FileName temp(tempName); bool tempFile = false; @@ -48,8 +48,8 @@ void IsisMain() { } catch(IException &e) { tempFile = true; - QString command = "$ISISROOT/bin/vdcomp " + in.expanded() + " " + - temp.expanded() + " > /dev/null 2>&1"; + QString command = QString::fromStdString("$ISISROOT/bin/vdcomp " + in.expanded() + " " + + temp.expanded() + " > /dev/null 2>&1"); int returnValue = system(command.toLatin1().data()) >> 8; if(returnValue) { std::string msg = "Error running vdcomp"; @@ -92,7 +92,7 @@ void IsisMain() { // Convert the pds file to a cube Pvl pdsLabel; try { - p.SetPdsFile(in.expanded(), "", pdsLabel); + p.SetPdsFile(QString::fromStdString(in.expanded()), "", pdsLabel); } catch(IException &e) { std::string msg = "Input file [" + in.expanded() + @@ -105,7 +105,7 @@ void IsisMain() { TranslateVikingLabels(pdsLabel, ocube); p.EndProcess(); - if(tempFile) remove(temp.expanded().toLatin1().data()); + if(tempFile) remove(temp.expanded().c_str()); return; } diff --git a/isis/src/viking/apps/vikcal/CalParameters.cpp b/isis/src/viking/apps/vikcal/CalParameters.cpp index 900d710f1d..b8b0e1bb27 100644 --- a/isis/src/viking/apps/vikcal/CalParameters.cpp +++ b/isis/src/viking/apps/vikcal/CalParameters.cpp @@ -42,7 +42,7 @@ namespace Isis { QString mission = spacecraft.split("_").first(); spacecraft = spacecraft.split("_").last(); if(mission != "VIKING") { - std::string msg = "Invalid Keyword [SpacecraftName]. " + spacecraft + + std::string msg = "Invalid Keyword [SpacecraftName]. " + spacecraft.toStdString() + "must start with 'VIKING'"; throw IException(IException::User, msg, _FILEINFO_); } @@ -50,7 +50,7 @@ namespace Isis { if((QChar)spacecraft[spacecraft.size() - 1] == '1') spn = 1; if((QChar)spacecraft[spacecraft.size() - 1] == '2') spn = 2; if(spn == 0) { - std::string msg = "Invalid Keyword [SpacecraftName]. " + spacecraft + + std::string msg = "Invalid Keyword [SpacecraftName]. " + spacecraft.toStdString() + "must terminate with '1' or '2'"; throw IException(IException::User, msg, _FILEINFO_); } @@ -73,7 +73,7 @@ namespace Isis { else cam = 6; } else { - std::string msg = "Invalid Keyword [InstrumentID]. " + instId; + std::string msg = "Invalid Keyword [InstrumentID]. " + instId.toStdString(); msg += "must terminate with an 'A' or 'B'"; throw IException(IException::User, msg, _FILEINFO_); } @@ -99,7 +99,7 @@ namespace Isis { vikoffSetup(mission, spn, target, cam, clock, (int)cs3); } catch(IException &e) { - std::string msg = "Input file [" + fname + "] does not appear to be a viking image"; + std::string msg = "Input file [" + fname.toStdString() + "] does not appear to be a viking image"; throw IException(IException::User, msg, _FILEINFO_); } } @@ -127,7 +127,7 @@ namespace Isis { vector line; // Read in vikcal.sav calibration file - TextFile cal("$viking" + toString(spn) + "/calibration/vikcal.sav", + TextFile cal("$viking" + QString::number(spn) + "/calibration/vikcal.sav", "input", line, 0, true); // Search for a line in the vikcal.sav file that matches our data from the @@ -139,25 +139,25 @@ namespace Isis { if(tokens.count() < 15) continue; if(tokens[0] != mission) continue; - if(toInt(tokens[1]) != spn) continue; - if(toInt(tokens[2]) != cam) continue; + if(tokens[1].toInt() != spn) continue; + if(tokens[2].toInt() != cam) continue; if(tokens[3] != wav) continue; - if(toInt(tokens[4]) != cs1) continue; - if(toInt(tokens[5]) != cs2) continue; - if(toInt(tokens[6]) != cs3) continue; - if(toInt(tokens[7]) != cs4) continue; + if(tokens[4].toInt() != cs1) continue; + if(tokens[5].toInt() != cs2) continue; + if(tokens[6].toInt() != cs3) continue; + if(tokens[7].toInt() != cs4) continue; // The line is a match for our data, so set all the // Calibration variables to their correct values - p_w0 = toDouble(tokens[8]); - p_dist = toDouble(tokens[9]); - p_gain = toDouble(tokens[10]); - p_offset = toDouble(tokens[11]); - p_exp = toDouble(tokens[12]); - p_gainFile = "$viking" + toString(spn) + "/calibration/" + tokens[13] + p_w0 = tokens[8].toDouble(); + p_dist = tokens[9].toDouble(); + p_gain = tokens[10].toDouble(); + p_offset = tokens[11].toDouble(); + p_exp = tokens[12].toDouble(); + p_gainFile = "$viking" + QString::number(spn) + "/calibration/" + tokens[13] + ".cub"; - p_offsetFile = "$viking" + toString(spn) + "/calibration/" + + p_offsetFile = "$viking" + QString::number(spn) + "/calibration/" + tokens[14] + ".cub"; return; } @@ -208,7 +208,7 @@ namespace Isis { int cam, QString wav, int cs1, int cs2, int cs3, int cs4) { vector line; - TextFile lin("$viking" + toString(spn) + "/calibration/viklin.sav", + TextFile lin("$viking" + QString::number(spn) + "/calibration/viklin.sav", "input", line, 0, true); for(int i = 0; i < (int)line.size(); i++) { @@ -218,17 +218,17 @@ namespace Isis { if(tokens.count() < 10) continue; if(tokens[0] != mission) continue; - if(toInt(tokens[1]) != spn) continue; - if(toInt(tokens[2]) != cam) continue; + if(tokens[1].toInt() != spn) continue; + if(tokens[2].toInt() != cam) continue; if(tokens[3] != wav) continue; - if(toInt(tokens[4]) != cs1) continue; - if(toInt(tokens[5]) != cs2) continue; - if(toInt(tokens[6]) != cs3) continue; + if(tokens[4].toInt() != cs1) continue; + if(tokens[5].toInt() != cs2) continue; + if(tokens[6].toInt() != cs3) continue; // Set all Linearity variables to the correct values - p_b = toDouble(tokens[7]); - p_k = toDouble(tokens[8]); - p_normpow = toDouble(tokens[9]); + p_b = tokens[7].toDouble(); + p_k = tokens[8].toDouble(); + p_normpow = tokens[9].toDouble(); return; } std::string msg = "Could not find match in [viklin.sav] calibration file"; @@ -255,8 +255,8 @@ namespace Isis { // Get the correct offset file - depends on which camera the input image is // from - QString fname = "$viking" + toString(spn) + "/calibration/vikoffcam" + - toString(cam) + ".sav"; + QString fname = "$viking" + QString::number(spn) + "/calibration/vikoffcam" + + QString::number(cam) + ".sav"; TextFile off(fname, "input", line, 0, true); vector pp[5], off3; double pp1_off[5], pp2_off[5], pp_off[5]; @@ -275,42 +275,42 @@ namespace Isis { if(tokens[0] == "VIKING") { if (tokens.count() < 12) continue; - if(toInt(tokens[1]) == spn) { } - if(toInt(tokens[2]) == cam) { } - pp[0].push_back(toDouble(tokens[3])); - pp[0].push_back(toDouble(tokens[4])); - pp[1].push_back(toDouble(tokens[5])); - pp[1].push_back(toDouble(tokens[6])); - pp[2].push_back(toDouble(tokens[7])); - pp[2].push_back(toDouble(tokens[8])); - pp[3].push_back(toDouble(tokens[9])); - pp[3].push_back(toDouble(tokens[10])); - pp[4].push_back(toDouble(tokens[11])); - pp[4].push_back(toDouble(tokens[12])); + if(tokens[1].toInt() == spn) { } + if(tokens[2].toInt() == cam) { } + pp[0].push_back(tokens[3].toDouble()); + pp[0].push_back(tokens[4].toDouble()); + pp[1].push_back(tokens[5].toDouble()); + pp[1].push_back(tokens[6].toDouble()); + pp[2].push_back(tokens[7].toDouble()); + pp[2].push_back(tokens[8].toDouble()); + pp[3].push_back(tokens[9].toDouble()); + pp[3].push_back(tokens[10].toDouble()); + pp[4].push_back(tokens[11].toDouble()); + pp[4].push_back(tokens[12].toDouble()); continue; } - if(toDouble(tokens[0]) < clock) { + if(tokens[0].toDouble() < clock) { if (tokens.count() < 7) continue; - frm1 = toDouble(tokens[0]); - off3.push_back(toDouble(tokens[1])); - pp1_off[2] = toDouble(tokens[2]); - pp1_off[0] = pp1_off[2] + toDouble(tokens[3]); - pp1_off[1] = pp1_off[2] + toDouble(tokens[4]); - pp1_off[3] = pp1_off[2] + toDouble(tokens[5]); - pp1_off[4] = pp1_off[2] + toDouble(tokens[6]); + frm1 = tokens[0].toDouble(); + off3.push_back(tokens[1].toDouble()); + pp1_off[2] = tokens[2].toDouble(); + pp1_off[0] = pp1_off[2] + tokens[3].toDouble(); + pp1_off[1] = pp1_off[2] + tokens[4].toDouble(); + pp1_off[3] = pp1_off[2] + tokens[5].toDouble(); + pp1_off[4] = pp1_off[2] + tokens[6].toDouble(); continue; } else { if (tokens.count() < 7) continue; - frm2 = toDouble(tokens[0]); - off3.push_back(toDouble(tokens[1])); - pp2_off[2] = toDouble(tokens[2]); - pp2_off[0] = pp2_off[2] + toDouble(tokens[3]); - pp2_off[1] = pp2_off[2] + toDouble(tokens[4]); - pp2_off[3] = pp2_off[2] + toDouble(tokens[5]); - pp2_off[4] = pp2_off[2] + toDouble(tokens[6]); + frm2 = tokens[0].toDouble(); + off3.push_back(tokens[1].toDouble()); + pp2_off[2] = tokens[2].toDouble(); + pp2_off[0] = pp2_off[2] + tokens[3].toDouble(); + pp2_off[1] = pp2_off[2] + tokens[4].toDouble(); + pp2_off[3] = pp2_off[2] + tokens[5].toDouble(); + pp2_off[4] = pp2_off[2] + tokens[6].toDouble(); } if(frm1 == -1.0 || frm2 == -1.0) { std::string msg = "Could not find match in [vikoff.sav] calibration file"; @@ -388,8 +388,8 @@ namespace Isis { SpiceDouble lt, et; FileName fname1 = (FileName)"$base/kernels/lsk/naif0007.tls"; FileName fname2 = (FileName)"$base/kernels/spk/de405.bsp"; - QString tempfname1 = fname1.expanded(); - QString tempfname2 = fname2.expanded(); + QString tempfname1 = QString::fromStdString(fname1.expanded()); + QString tempfname2 = QString::fromStdString(fname2.expanded()); furnsh_c(tempfname1.toLatin1().data()); furnsh_c(tempfname2.toLatin1().data()); utc2et_c(t.toLatin1().data(), &et); diff --git a/isis/src/viking/apps/vikcal/main.cpp b/isis/src/viking/apps/vikcal/main.cpp index 40199026b2..3a0642a441 100644 --- a/isis/src/viking/apps/vikcal/main.cpp +++ b/isis/src/viking/apps/vikcal/main.cpp @@ -46,15 +46,15 @@ void IsisMain() { // If the file has already been calibrated, throw an error if(icube.hasGroup("Radiometry")) { - std::string msg = "The Viking image [" + icube.fileName() + "] has already " + std::string msg = "The Viking image [" + icube.fileName().toStdString() + "] has already " "been radiometrically calibrated"; throw IException(IException::User, msg, _FILEINFO_); } CubeAttributeInput dcf; CubeAttributeInput fff; - const QString gainFile = (QString)FileName(calParam->GainFile()).expanded(); - const QString offsetFile = (QString)FileName(calParam->OffsetFile()).expanded(); + const QString gainFile = QString::fromStdString(FileName(calParam->GainFile().toStdString()).expanded()); + const QString offsetFile = QString::fromStdString(FileName(calParam->OffsetFile().toStdString()).expanded()); // Setup the input cubes p.SetInputCube("FROM"); diff --git a/isis/src/viking/apps/vikcal/vikcal.cpp b/isis/src/viking/apps/vikcal/vikcal.cpp index 1305461f72..3715a370c3 100644 --- a/isis/src/viking/apps/vikcal/vikcal.cpp +++ b/isis/src/viking/apps/vikcal/vikcal.cpp @@ -28,7 +28,7 @@ namespace Isis { const QString in = ui.GetCubeName("FROM"); // Open the input cube - Cube icube(in, "r"); + Cube icube(in.toStdString(), "r"); vikcal(&icube, ui); } @@ -52,15 +52,15 @@ namespace Isis { // If the file has already been calibrated, throw an error if(icube->hasGroup("Radiometry")) { - std::string msg = "The Viking image [" + icube->fileName() + "] has already " + std::string msg = "The Viking image [" + icube->fileName().toStdString() + "] has already " "been radiometrically calibrated"; throw IException(IException::User, msg, _FILEINFO_); } CubeAttributeInput dcf; CubeAttributeInput fff; - const QString gainFile = (QString)FileName(calParam->GainFile()).expanded(); - const QString offsetFile = (QString)FileName(calParam->OffsetFile()).expanded(); + const QString gainFile = QString::fromStdString(FileName(calParam->GainFile().toStdString()).expanded()); + const QString offsetFile = QString::fromStdString(FileName(calParam->OffsetFile().toStdString()).expanded()); // Setup the input cubes p.SetInputCube(icube); diff --git a/isis/src/viking/apps/viknobutter/main.cpp b/isis/src/viking/apps/viknobutter/main.cpp index 3f72d17db4..52814b4a21 100644 --- a/isis/src/viking/apps/viknobutter/main.cpp +++ b/isis/src/viking/apps/viknobutter/main.cpp @@ -30,14 +30,14 @@ void IsisMain() { if(scn == "VIKING_ORBITER_1") spn = 1; else if(scn == "VIKING_ORBITER_2") spn = 2; else { - std::string msg = "Invalid spacecraftname [" + scn + "]"; + std::string msg = "Invalid spacecraftname [" + scn.toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } // determine if # of cols is even or odd bool even = true; PvlGroup &arch = p.findGroup("Archive", Pvl::Traverse); QString id = QString::fromStdString(arch["ProductId"]); - int num = toInt(id.mid(5, 1)); + int num = (id.mid(5, 1).toInt()); if(num == 1 || num == 3 || num == 5 || num == 7 || num == 9) even = false; // Run a standard deviation filter on the cube @@ -67,8 +67,8 @@ void IsisMain() { pipeline.Application("mask").SetInputParameter("FROM", false); pipeline.Application("mask").SetOutputParameter("TO", "step3"); - QString maskParameter = "$ISISDATA/viking" + toString(spn) + - "/calibration/vik" + toString(spn); + QString maskParameter = "$ISISDATA/viking" + QString::number(spn) + + "/calibration/vik" + QString::number(spn); if(even) { maskParameter += "evenMask.cub"; } diff --git a/isis/src/viking/objs/VikingCamera/VikingCamera.cpp b/isis/src/viking/objs/VikingCamera/VikingCamera.cpp index a1bf6b2c53..988b0f56fa 100644 --- a/isis/src/viking/objs/VikingCamera/VikingCamera.cpp +++ b/isis/src/viking/objs/VikingCamera/VikingCamera.cpp @@ -85,7 +85,7 @@ namespace Isis { } else { std::string msg = "File does not appear to be a Viking image. InstrumentId [" - + instId + "] is invalid Viking value."; + + instId.toStdString() + "] is invalid Viking value."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -117,13 +117,13 @@ namespace Isis { } else { std::string msg = "File does not appear to be a Viking image. InstrumentId [" - + instId + "] is invalid Viking value."; + + instId.toStdString() + "] is invalid Viking value."; throw IException(IException::User, msg, _FILEINFO_); } } else { std::string msg = "File does not appear to be a Viking image. SpacecraftName [" - + spacecraft + "] is invalid Viking value."; + + spacecraft.toStdString() + "] is invalid Viking value."; throw IException(IException::User, msg, _FILEINFO_); } @@ -175,8 +175,8 @@ namespace Isis { focalMap->SetDetectorOrigin(602.0, 528.0); // Setup distortion map - QString fname = FileName("$viking" + toString(spn) + "/reseaus/vik" + cam - + "MasterReseaus.pvl").expanded(); + QString fname = QString::fromStdString(FileName("$viking" + toString(spn) + "/reseaus/vik" + cam.toStdString() + + "MasterReseaus.pvl").expanded()); new ReseauDistortionMap(this, lab, fname); // Setup the ground and sky map diff --git a/isis/src/viking/objs/VikingCamera/unitTest.cpp b/isis/src/viking/objs/VikingCamera/unitTest.cpp index 5d2cdc2bb3..f8ce69b1e4 100644 --- a/isis/src/viking/objs/VikingCamera/unitTest.cpp +++ b/isis/src/viking/objs/VikingCamera/unitTest.cpp @@ -47,9 +47,9 @@ int main(void) { files.append("$ISISTESTDATA/isis/src/viking/unitTestData/f348b26.cub"); // Viking2 VISB for (int i = 0; i < files.size(); i++) { - Cube c(files[i], "r"); + Cube c(files[i].toStdString(), "r"); VikingCamera *cam = (VikingCamera *) CameraFactory::Create(c); - cout << "FileName: " << FileName(c.fileName()).name() << endl; + cout << "FileName: " << FileName(c.fileName().toStdString()).name() << endl; cout << "CK Frame: " << cam->instrumentRotation()->Frame() << endl << endl; cout.setf(std::ios::fixed); cout << setprecision(9); @@ -118,12 +118,12 @@ int main(void) { files.append("$ISISTESTDATA/isis/src/viking/unitTestData/f387a06.cropped.cub"); // Viking1 VISB files.append("$ISISTESTDATA/isis/src/viking/unitTestData/f004b33.cropped.cub"); // Viking2 VISA for (int i = 0; i < files.size(); i++) { - Cube c(files[i], "r"); + Cube c(files[i].toStdString(), "r"); VikingCamera *cam = (VikingCamera *) CameraFactory::Create(c); - cout << "Spacecraft Name Long: " << cam->spacecraftNameLong() << endl; - cout << "Spacecraft Name Short: " << cam->spacecraftNameShort() << endl; - cout << "Instrument Name Long: " << cam->instrumentNameLong() << endl; - cout << "Instrument Name Short: " << cam->instrumentNameShort() << endl << endl; + cout << "Spacecraft Name Long: " << cam->spacecraftNameLong().toStdString() << endl; + cout << "Spacecraft Name Short: " << cam->spacecraftNameShort().toStdString() << endl; + cout << "Instrument Name Long: " << cam->instrumentNameLong().toStdString() << endl; + cout << "Instrument Name Short: " << cam->instrumentNameShort().toStdString() << endl << endl; } // Test exception: camera is not a supported Kaguya camera diff --git a/isis/src/voyager/apps/voy2isis/main.cpp b/isis/src/voyager/apps/voy2isis/main.cpp index 549cfceeda..d05c02637f 100644 --- a/isis/src/voyager/apps/voy2isis/main.cpp +++ b/isis/src/voyager/apps/voy2isis/main.cpp @@ -48,18 +48,18 @@ void IsisMain() { // We should be processing a PDS file ProcessImportPds p; UserInterface &ui = Application::GetUserInterface(); - FileName in = ui.GetFileName("FROM"); + FileName in = ui.GetFileName("FROM").toStdString(); - QString tempName = "$TEMPORARY/" + in.baseName() + ".img"; - FileName temp(tempName); + QString tempName = "$TEMPORARY/" + QString::fromStdString(in.baseName()) + ".img"; + FileName temp(tempName.toStdString()); bool tempFile = false; // input files are compressed, use vdcomp to decompress - QString ext = in.extension().toUpper(); + QString ext = QString::fromStdString(in.extension()).toUpper(); if (ext == "IMQ") { try { - QString command = "$ISISROOT/bin/vdcomp " + in.expanded() + " " + temp.expanded(); + QString command = QString::fromStdString("$ISISROOT/bin/vdcomp " + in.expanded() + " " + temp.expanded()); // don't pretend vdcomp is a standard Isis program, just run it ProgramLauncher::RunSystemCommand(command); in = temp.expanded(); @@ -79,7 +79,7 @@ void IsisMain() { // Preparse the IMG to fix messed up labels History *hist = new History(); - QByteArray pdsData = fixLabels(in.expanded(), hist); + QByteArray pdsData = fixLabels(QString::fromStdString(in.expanded()), hist); QTextStream pdsTextStream(&pdsData); istringstream pdsStream(pdsTextStream.readAll().toStdString()); @@ -99,7 +99,7 @@ void IsisMain() { } try { - p.SetPdsFile(*pdsLabel, in.expanded()); + p.SetPdsFile(*pdsLabel, QString::fromStdString(in.expanded())); } catch (IException &e) { std::string msg = "Unable to set PDS file. Decompressed input file [" @@ -121,7 +121,7 @@ void IsisMain() { p.EndProcess(); delete pdsLabel; - if (tempFile) QFile::remove(temp.expanded()); + if (tempFile) QFile::remove(QString::fromStdString(temp.expanded())); } /** @@ -137,7 +137,7 @@ void ConvertComments(FileName file) { unsigned int lineStartPos = 0; fstream stream; - QString filename = file.expanded(); + QString filename = QString::fromStdString(file.expanded()); stream.open(filename.toLatin1().data(), fstream::in | fstream::out | fstream::binary); lineStartPos = stream.tellg(); @@ -174,11 +174,11 @@ void TranslateVoyagerLabels(Pvl &inputLab, Cube *ocube) { Pvl inputLabel(inputLab); // Get the directory where the Voyager translation tables are - QString missionDir = "$ISISROOT/appdata"; + std::string missionDir = "$ISISROOT/appdata"; FileName transFile(missionDir + "/translations/voyager.trn"); // Get the translation manager ready - PvlToPvlTranslationManager labelXlater(inputLabel, transFile.expanded()); + PvlToPvlTranslationManager labelXlater(inputLabel, QString::fromStdString(transFile.expanded())); // Pvl output label Pvl *outputLabel = ocube->label(); @@ -207,12 +207,12 @@ void TranslateVoyagerLabels(Pvl &inputLab, Cube *ocube) { // Translate the band bin group information if(QString::fromStdString(inst["InstrumentId"]) == "WIDE_ANGLE_CAMERA") { FileName bandBinTransFile(missionDir + "/translations/voyager_wa_bandbin.trn"); - PvlToPvlTranslationManager labelXlater(inputLabel, bandBinTransFile.expanded()); + PvlToPvlTranslationManager labelXlater(inputLabel, QString::fromStdString(bandBinTransFile.expanded())); labelXlater.Auto(*(outputLabel)); } else { FileName bandBinTransFile(missionDir + "/translations/voyager_na_bandbin.trn"); - PvlToPvlTranslationManager labelXlater(inputLabel, bandBinTransFile.expanded()); + PvlToPvlTranslationManager labelXlater(inputLabel, QString::fromStdString(bandBinTransFile.expanded())); labelXlater.Auto(*(outputLabel)); } @@ -243,7 +243,7 @@ void TranslateVoyagerLabels(Pvl &inputLab, Cube *ocube) { instId = "isswa"; } else { - std::string msg = "Instrument ID [" + instId + "] does not match Narrow or " + + std::string msg = "Instrument ID [" + instId.toStdString() + "] does not match Narrow or " + "Wide angle camera. The cube was created, but the labels were not translated. " "To create a cube with translated labels, re-run this application with " "INSTRUMENT set to NAC or WAC."; @@ -263,7 +263,7 @@ void TranslateVoyagerLabels(Pvl &inputLab, Cube *ocube) { instId = "isswa"; } else { - std::string msg = "Instrument ID [" + instId + "] does not match Narrow or " + + std::string msg = "Instrument ID [" + instId.toStdString() + "] does not match Narrow or " + "Wide angle camera. The cube was created, but the labels were not translated. " "To create a cube with translated labels, re-run this application with " "INSTRUMENT set to NAC or WAC."; @@ -271,7 +271,7 @@ void TranslateVoyagerLabels(Pvl &inputLab, Cube *ocube) { } } else { - std::string msg = "Spacecraft name [" + QString::fromStdString(inst.findKeyword("SpacecraftName")) + + std::string msg = "Spacecraft name [" + (std::string)inst.findKeyword("SpacecraftName") + "] does not match Voyager1 or Voyager2 spacecraft"; throw IException(IException::User, msg, _FILEINFO_); } @@ -304,8 +304,8 @@ void TranslateVoyagerLabels(Pvl &inputLab, Cube *ocube) { inst["ShutterModeId"][0] == "BOTSIM") && inst["InstrumentId"][0] == "WIDE_ANGLE_CAMERA") { QString scanId = QString::fromStdString(inst["ScanModeId"][0]); - int scanNum = toInt(scanId.mid(0, 1)); - int imgNum = toInt(imgNumber); + int scanNum = scanId.mid(0, 1).toInt(); + int imgNum = imgNumber.toInt(); // We'll use this later, however, we do not write it to the labels. // if we didn't get in here, we'll be using the original image number, @@ -359,9 +359,9 @@ void TranslateVoyagerLabels(Pvl &inputLab, Cube *ocube) { //* 3 *// // Leapsecond kernel QString lsk = "$base/kernels/lsk/naif????.tls"; - FileName lskName(lsk); + FileName lskName(lsk.toStdString()); lskName = lskName.highestVersion(); - furnsh_c(lskName.expanded().toLatin1().data()); + furnsh_c(lskName.expanded().c_str()); // Spacecraft clock kernel QString sclk = "$ISISDATA/voyager"; @@ -369,9 +369,9 @@ void TranslateVoyagerLabels(Pvl &inputLab, Cube *ocube) { sclk.append("/kernels/sclk/vg"); sclk.append(spacecraftNumber); sclk.append("?????.tsc"); - FileName sclkName(sclk); + FileName sclkName(sclk.toStdString()); sclkName = sclkName.highestVersion(); - furnsh_c(sclkName.expanded().toLatin1().data()); + furnsh_c(sclkName.expanded().c_str()); // The purpose of the next two steps, getting the spacecraft clock count, // are simply to get the partition, the very first number 1/... @@ -382,7 +382,7 @@ void TranslateVoyagerLabels(Pvl &inputLab, Cube *ocube) { // sce2s_c requires the spacecraft number, not the instrument number as // we've found elsewhere, either -31 or -32 in this case. int spacecraftClockNumber = -30; - spacecraftClockNumber -= toInt(spacecraftNumber); + spacecraftClockNumber -= spacecraftNumber.toInt(); sce2s_c(spacecraftClockNumber, approxEphemeris, 80, approxSpacecraftClock); /* diff --git a/isis/src/voyager/apps/voycal/main.cpp b/isis/src/voyager/apps/voycal/main.cpp index a43048c7dd..ecfed1ad10 100644 --- a/isis/src/voyager/apps/voycal/main.cpp +++ b/isis/src/voyager/apps/voycal/main.cpp @@ -66,7 +66,7 @@ void IsisMain() { // Check for projection if (incube->isProjected()) { - std::string msg = "The cube [" + ui.GetCubeName("FROM") + "] has a projection" + + std::string msg = "The cube [" + ui.GetCubeName("FROM").toStdString() + "] has a projection" + " and cannot be radiometrically calibrated"; throw IException(IException::User, msg, _FILEINFO_); } @@ -79,7 +79,7 @@ void IsisMain() { // Verify not radiometrically corrected if (isiscube.hasGroup("Radiometry")) { - std::string msg = "Cube [" + ui.GetCubeName("FROM") + "] has already been" + + std::string msg = "Cube [" + ui.GetCubeName("FROM").toStdString() + "] has already been" + " radiometrically corrected"; throw IException(IException::User,msg,_FILEINFO_); } @@ -87,14 +87,14 @@ void IsisMain() { // Verify Voyager spacecraft and get number, 1 or 2 QString scNumber = QString::fromStdString(instrument["SpacecraftName"][0]); if (scNumber != "VOYAGER_1" && scNumber != "VOYAGER_2") { - std::string msg = "The cube [" + ui.GetCubeName("FROM") + "] does not appear" + + std::string msg = "The cube [" + ui.GetCubeName("FROM").toStdString() + "] does not appear" + " to be a Voyager image"; throw IException(IException::User, msg, _FILEINFO_); } scNumber = scNumber[8]; // Open calibration file to find constants and files - Pvl calibra(FileName("$voyager" + scNumber + + Pvl calibra(FileName("$voyager" + scNumber.toStdString() + "/calibration/voycal.pvl").expanded()); PvlObject calib; QList hierarchy; @@ -124,11 +124,11 @@ void IsisMain() { // Get appropriate calibration files CubeAttributeInput in1; - p.SetInputCube(FileName("$voyager" + scNumber + "/calibration/" + - QString::fromStdString(calib["OffsetCorrectionFile"])).expanded(), in1); + p.SetInputCube(QString::fromStdString(FileName("$voyager" + scNumber.toStdString() + "/calibration/" + + (std::string)calib["OffsetCorrectionFile"]).expanded()), in1); CubeAttributeInput in2; - p.SetInputCube(FileName("$voyager" + scNumber + "/calibration/" + - QString::fromStdString(calib["GainCorrectionFile"])).expanded(), in2); + p.SetInputCube(QString::fromStdString(FileName("$voyager" + scNumber.toStdString() + "/calibration/" + + (std::string)calib["GainCorrectionFile"]).expanded()), in2); // Constants from voycal.pvl for correction omegaNaught = calib["OmegaNaught"]; @@ -140,7 +140,7 @@ void IsisMain() { // If we are doing a linear correction as well, go here linear = ui.GetBoolean("LINEAR"); if (linear) { - Pvl linearity(FileName("$voyager" + scNumber + + Pvl linearity(FileName("$voyager" + scNumber.toStdString() + "/calibration/voylin.pvl").expanded()); PvlObject lin; @@ -344,7 +344,7 @@ void checkCoefficients(PvlObject &coefficients, QStringList keyNames) { if (!missingCoeffs.isEmpty()) { throw IException( IException::Programmer, - "Coefficients [" + missingCoeffs.join(", ") + "] were not found in the " + "Coefficients [" + missingCoeffs.join(", ").toStdString() + "] were not found in the " "calibration PVL for the input data. Consider adding a default.", _FILEINFO_); } diff --git a/isis/src/voyager/apps/voyramp/main.cpp b/isis/src/voyager/apps/voyramp/main.cpp index 5c8b6970a5..42cb9561ff 100644 --- a/isis/src/voyager/apps/voyramp/main.cpp +++ b/isis/src/voyager/apps/voyramp/main.cpp @@ -72,14 +72,14 @@ void IsisMain() { // Verify Voyager1 spacecraft if (inst["SpacecraftName"][0] != "VOYAGER_1") { - std::string msg = "The cube [" + ui.GetCubeName("FROM") + "] does not appear" + + std::string msg = "The cube [" + ui.GetCubeName("FROM").toStdString() + "] does not appear" + " to be a Voyager1 image"; throw IException(IException::User, msg, _FILEINFO_); } // Verify has been radiometrically calibrated if (!isiscube.hasGroup("Radiometry")) { - std::string msg = "The cube [" + ui.GetCubeName("FROM") + "] has not been" + + std::string msg = "The cube [" + ui.GetCubeName("FROM").toStdString() + "] has not been" + "radiometrically corrected, run voycal first"; } @@ -92,9 +92,9 @@ void IsisMain() { // From Isis2, the time range is day 64, hours 1-16, inclusive. if (time < min || time >= max) { - std::string message = "The cube [" + ui.GetCubeName("FROM") + "] has image" + - " time [" + time.UTC() + "] outside of allowable" + - "range [" + min.UTC() + "] to [" + max.UTC() + "]"; + std::string message = "The cube [" + ui.GetCubeName("FROM").toStdString() + "] has image" + + " time [" + time.UTC().toStdString() + "] outside of allowable" + + "range [" + min.UTC().toStdString() + "] to [" + max.UTC().toStdString() + "]"; throw IException(IException::User, message, _FILEINFO_); } diff --git a/isis/src/voyager/objs/VoyagerCamera/VoyagerCamera.cpp b/isis/src/voyager/objs/VoyagerCamera/VoyagerCamera.cpp index 09df254cac..5d15613a25 100644 --- a/isis/src/voyager/objs/VoyagerCamera/VoyagerCamera.cpp +++ b/isis/src/voyager/objs/VoyagerCamera/VoyagerCamera.cpp @@ -85,7 +85,7 @@ namespace Isis { } else { std::string msg = "File does not appear to be a Voyager image. InstrumentId [" - + instId + "] is invalid Voyager value."; + + instId.toStdString() + "] is invalid Voyager value."; throw IException(IException::User, msg, _FILEINFO_); } } @@ -109,13 +109,13 @@ namespace Isis { } else { std::string msg = "File does not appear to be a Voyager image. InstrumentId [" - + instId + "] is invalid Voyager value."; + + instId.toStdString() + "] is invalid Voyager value."; throw IException(IException::User, msg, _FILEINFO_); } } else { std::string msg = "File does not appear to be a Voyager image. SpacecraftName [" - + spacecraft + "] is invalid Voyager value."; + + spacecraft.toStdString() + "] is invalid Voyager value."; throw IException(IException::User, msg, _FILEINFO_); } @@ -127,9 +127,9 @@ namespace Isis { // Master reseau location file reseauFileName = "$voyager" + reseauFileName + "MasterReseaus.pvl"; - FileName masterReseaus(reseauFileName); + FileName masterReseaus(reseauFileName.toStdString()); try { - new ReseauDistortionMap(this, lab, masterReseaus.expanded()); + new ReseauDistortionMap(this, lab, QString::fromStdString(masterReseaus.expanded())); } catch (IException &e) { e.print(); } diff --git a/isis/src/voyager/objs/VoyagerCamera/unitTest.cpp b/isis/src/voyager/objs/VoyagerCamera/unitTest.cpp index 05b41600c1..8a0d93c2fa 100644 --- a/isis/src/voyager/objs/VoyagerCamera/unitTest.cpp +++ b/isis/src/voyager/objs/VoyagerCamera/unitTest.cpp @@ -45,7 +45,7 @@ int main(void) { Cube c("$ISISTESTDATA/isis/src/voyager/unitTestData/c1639118.imq.cub", "r"); VoyagerCamera *cam = (VoyagerCamera *) CameraFactory::Create(c); - cout << "FileName: " << FileName(c.fileName()).name() << endl; + cout << "FileName: " << FileName(c.fileName().toStdString()).name() << endl; cout << "CK Frame: " << cam->instrumentRotation()->Frame() << endl << endl; cout.setf(std::ios::fixed); cout << setprecision(9); @@ -114,12 +114,12 @@ int main(void) { files.append("$ISISTESTDATA/isis/src/voyager/unitTestData/c4397840.cropped.cub"); // Voyager2 WAC for (int i = 0; i < files.size(); i++) { - Cube cu(files[i], "r"); + Cube cu(files[i].toStdString(), "r"); VoyagerCamera *vCam = (VoyagerCamera *) CameraFactory::Create(cu); - cout << "Spacecraft Name Long: " << vCam->spacecraftNameLong() << endl; - cout << "Spacecraft Name Short: " << vCam->spacecraftNameShort() << endl; - cout << "Instrument Name Long: " << vCam->instrumentNameLong() << endl; - cout << "Instrument Name Short: " << vCam->instrumentNameShort() << endl << endl; + cout << "Spacecraft Name Long: " << vCam->spacecraftNameLong().toStdString() << endl; + cout << "Spacecraft Name Short: " << vCam->spacecraftNameShort().toStdString() << endl; + cout << "Instrument Name Long: " << vCam->instrumentNameLong().toStdString() << endl; + cout << "Instrument Name Short: " << vCam->instrumentNameShort().toStdString() << endl << endl; } // Test exception: camera is not a supported Kaguya camera diff --git a/isis/tests/AffineTests.cpp b/isis/tests/AffineTests.cpp index 0467376d23..46b7ed6188 100644 --- a/isis/tests/AffineTests.cpp +++ b/isis/tests/AffineTests.cpp @@ -28,7 +28,7 @@ TEST(Affine, MatrixConstructor) { TEST(Affine, IncorrectDimensions) { - std::string message = "Affine matrices must be 3x3"; + QString message = "Affine matrices must be 3x3"; try { Isis::Affine::AMatrix matrix(2, 2, 0.0); matrix[0][0] = 1.0; @@ -45,7 +45,7 @@ TEST(Affine, IncorrectDimensions) { TEST(Affine, NotInvertible) { - std::string message = "Affine transform not invertible"; + QString message = "Affine transform not invertible"; try { Isis::Affine::AMatrix matrix(3, 3, 1.0); Isis::Affine affine(matrix); diff --git a/isis/tests/AngleTest.cpp b/isis/tests/AngleTest.cpp index a559ceeb3f..f323f3330a 100644 --- a/isis/tests/AngleTest.cpp +++ b/isis/tests/AngleTest.cpp @@ -144,8 +144,9 @@ TEST(AngleExceptions, LessThanNullAngle){ } } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().contains("Cannot compare a invalid angles with the < operator")) - << e.toString().toStdString(); + + EXPECT_TRUE(e.toString().find("Cannot compare a invalid angles with the < operator") != std::string::npos) + << e.toString(); } catch(...) { FAIL() << "Expected IException"; @@ -161,8 +162,8 @@ TEST(AngleExceptions, NullAngleLessThan){ } } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().contains("Cannot compare a invalid angles with the < operator")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Cannot compare a invalid angles with the < operator") != std::string::npos) + << e.toString(); } catch(...) { FAIL() << "Expected IException"; @@ -178,8 +179,8 @@ TEST(AngleExceptions, NullAngleLessThanOrEqual){ } } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().contains("Cannot compare a invalid angles with the < operator")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Cannot compare a invalid angles with the < operator") != std::string::npos) + << e.toString(); } catch(...) { FAIL() << "Expected IException"; @@ -196,8 +197,8 @@ TEST(AngleExceptions, GreaterThanNullAngle){ } } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().contains("Cannot compare a invalid angles with the > operator")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Cannot compare a invalid angles with the > operator") != std::string::npos) + << e.toString(); } catch(...) { FAIL() << "Expected IException"; @@ -214,8 +215,8 @@ TEST(AngleExceptions, GreaterThanOrEqualToNullAngle){ } } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().contains("Cannot compare a invalid angles with the > operator")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Cannot compare a invalid angles with the > operator") != std::string::npos) + << e.toString(); } catch(...) { FAIL() << "Expected IException"; @@ -269,9 +270,9 @@ TEST(AngleExceptions, InvalidInput){ FAIL() << "Expected an error"; } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().contains( - "[100] is not a vaid input to Angle. It needs to be of the form: \"dd mm ss.ss\"")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find( + "[100] is not a vaid input to Angle. It needs to be of the form: \"dd mm ss.ss\"") != std::string::npos) + << e.toString(); } catch(...) { FAIL() << "Expected IException."; @@ -287,9 +288,9 @@ TEST(AngleExceptions, InvalidInput2){ FAIL() << "Expected an error"; } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().contains( - "[70 11] is not a vaid input to Angle. It needs to be of the form: \"dd mm ss.ss\"")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find( + "[70 11] is not a vaid input to Angle. It needs to be of the form: \"dd mm ss.ss\"") != std::string::npos) + << e.toString(); } catch(...) { FAIL() << "Expected IException."; @@ -305,9 +306,9 @@ TEST(AngleExceptions, InvalidInput3){ FAIL() << "Expected an error"; } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().contains( - "[this 79 should 00 fail 0.111] is not a vaid input to Angle. It needs to be of the form: \"dd mm ss.ss\"")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find( + "[this 79 should 00 fail 0.111] is not a vaid input to Angle. It needs to be of the form: \"dd mm ss.ss\"") != std::string::npos) + << e.toString(); } catch(...) { FAIL() << "Expected IException."; diff --git a/isis/tests/Area3DTests.cpp b/isis/tests/Area3DTests.cpp index b368a19bed..4dea04527e 100644 --- a/isis/tests/Area3DTests.cpp +++ b/isis/tests/Area3DTests.cpp @@ -218,7 +218,7 @@ TEST(Area3D, Operators) { } TEST(Area3D, InvertedXError) { - std::string message = "Cannot have a 3D area with inverted X"; + QString message = "Cannot have a 3D area with inverted X"; Isis::Displacement d1(-1, Isis::Displacement::Meters); Isis::Displacement d2(1, Isis::Displacement::Meters); try { @@ -234,7 +234,7 @@ TEST(Area3D, InvertedXError) { } TEST(Area3D, InvertedYError) { - std::string message = "Cannot have a 3D area with inverted Y"; + QString message = "Cannot have a 3D area with inverted Y"; Isis::Displacement d1(-1, Isis::Displacement::Meters); Isis::Displacement d2(1, Isis::Displacement::Meters); try { @@ -250,7 +250,7 @@ TEST(Area3D, InvertedYError) { } TEST(Area3D, InvertedZError) { - std::string message = "Cannot have a 3D area with inverted Z"; + QString message = "Cannot have a 3D area with inverted Z"; Isis::Displacement d1(-1, Isis::Displacement::Meters); Isis::Displacement d2(1, Isis::Displacement::Meters); try { diff --git a/isis/tests/AutoseedTests.cpp b/isis/tests/AutoseedTests.cpp index db37a27af3..3c59f8d536 100644 --- a/isis/tests/AutoseedTests.cpp +++ b/isis/tests/AutoseedTests.cpp @@ -32,7 +32,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/autoseed.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/autoseed.xml").expanded()); TEST_F(ThreeImageNetwork, FunctionalTestAutoseedDefault) { Pvl *log = NULL; @@ -56,7 +56,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestAutoseedDefault) { QVector autoseedArgs = {"fromlist="+cubeListFile, "onet="+outnet, "deffile="+defFile, - "overlaplist="+threeImageOverlapFile->original(), + "overlaplist="+QString::fromStdString(threeImageOverlapFile->original()), "networkid=1", "pointid=??", "description=autoseed test network"}; @@ -88,12 +88,12 @@ TEST_F(ThreeImageNetwork, FunctionalTestAutoseedCnetInput) { autoseedDef.write(defFile.toStdString()); cubeList->removeLast(); - cubeList->write(cubeListFile); + cubeList->write(cubeListFile.toStdString()); QVector autoseedArgs = {"fromlist="+cubeListFile, "onet="+outnet1, "deffile="+defFile, - "overlaplist="+twoImageOverlapFile->original(), + "overlaplist="+QString::fromStdString(twoImageOverlapFile->original()), "networkid=1", "pointid=??", "description=autoseed test network"}; @@ -103,13 +103,13 @@ TEST_F(ThreeImageNetwork, FunctionalTestAutoseedCnetInput) { ControlNet onet(outnet1); ASSERT_EQ(onet.GetNumPoints(), 18); - cubeList->append(cube3->fileName()); - cubeList->write(cubeListFile); + cubeList->append(cube3->fileName().toStdString()); + cubeList->write(cubeListFile.toStdString()); SerialNumberList serialNumList(cubeListFile); autoseedArgs.removeAt(0); autoseedArgs.replace(1, "onet="+outnet2); - autoseedArgs.replace(3, "overlaplist="+threeImageOverlapFile->original()); + autoseedArgs.replace(3, "overlaplist="+QString::fromStdString(threeImageOverlapFile->original())); autoseedUi = UserInterface(APP_XML, autoseedArgs); autoseed(autoseedUi, serialNumList, &onet, log); onet = ControlNet(outnet2); @@ -124,7 +124,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestAutoseedDeffiles) { QVector autoseedArgs = {"fromlist="+cubeListFile, "onet="+outnet, "deffile="+defFile, - "overlaplist="+threeImageOverlapFile->original(), + "overlaplist="+QString::fromStdString(threeImageOverlapFile->original()), "networkid=1", "pointid=???", "description=autoseed test network"}; diff --git a/isis/tests/BasisFunctionTests.cpp b/isis/tests/BasisFunctionTests.cpp index a15ceee40f..72c852e5f1 100644 --- a/isis/tests/BasisFunctionTests.cpp +++ b/isis/tests/BasisFunctionTests.cpp @@ -56,8 +56,8 @@ TEST(BasisFunction, InequalCoefficientAmount) } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Unable to set coefficients vector")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Unable to set coefficients vector") != std::string::npos) + << e.toString(); } catch(...) { @@ -87,8 +87,8 @@ TEST(BasisFunction, InequalVariableAmount) } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Unable to evaluate function")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Unable to evaluate function") != std::string::npos) + << e.toString(); } catch(...) { @@ -115,8 +115,8 @@ TEST(BasisFunction, ExtraCoefficients) } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Unable to evaluate function")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Unable to evaluate function") != std::string::npos) + << e.toString(); } catch(...) { diff --git a/isis/tests/BundleObservationSolveSettingsTests.cpp b/isis/tests/BundleObservationSolveSettingsTests.cpp index 602c010b30..24bce0467b 100644 --- a/isis/tests/BundleObservationSolveSettingsTests.cpp +++ b/isis/tests/BundleObservationSolveSettingsTests.cpp @@ -375,22 +375,22 @@ TEST(BundleObservationSolveSettings, SaveSettings){ EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointingOptionsAtts.namedItem("numberCoefSolved").nodeValue(), - toString(boss.numberCameraAngleCoefficientsSolved())); + QString::number(boss.numberCameraAngleCoefficientsSolved())); EXPECT_PRED_FORMAT2(AssertQStringsEqual, - pointingOptionsAtts.namedItem("degree").nodeValue(), toString(boss.ckDegree())); + pointingOptionsAtts.namedItem("degree").nodeValue(), QString::number(boss.ckDegree())); EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointingOptionsAtts.namedItem("solveDegree").nodeValue(), - toString(boss.ckSolveDegree())); + QString::number(boss.ckSolveDegree())); EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointingOptionsAtts.namedItem("solveTwist").nodeValue(), - toString(boss.solveTwist())); + QString::number(boss.solveTwist())); EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointingOptionsAtts.namedItem("solveOverExisting").nodeValue(), - toString(boss.solvePolyOverPointing())); + QString::number(boss.solvePolyOverPointing())); EXPECT_PRED_FORMAT2(AssertQStringsEqual, pointingOptionsAtts.namedItem("interpolationType").nodeValue(), "3"); @@ -415,23 +415,23 @@ TEST(BundleObservationSolveSettings, SaveSettings){ EXPECT_PRED_FORMAT2(AssertQStringsEqual, positionOptionsAtts.namedItem("numberCoefSolved").nodeValue(), - toString(boss.numberCameraPositionCoefficientsSolved())); + QString::number(boss.numberCameraPositionCoefficientsSolved())); EXPECT_PRED_FORMAT2(AssertQStringsEqual, positionOptionsAtts.namedItem("degree").nodeValue(), - toString(boss.spkDegree())); + QString::number(boss.spkDegree())); EXPECT_PRED_FORMAT2(AssertQStringsEqual, positionOptionsAtts.namedItem("degree").nodeValue(), - toString(boss.spkDegree())); + QString::number(boss.spkDegree())); EXPECT_PRED_FORMAT2(AssertQStringsEqual, positionOptionsAtts.namedItem("solveDegree").nodeValue(), - toString(boss.spkSolveDegree())); + QString::number(boss.spkSolveDegree())); EXPECT_PRED_FORMAT2(AssertQStringsEqual, positionOptionsAtts.namedItem("solveOverHermiteSpline").nodeValue(), - toString(boss.solvePositionOverHermite())); + QString::number(boss.solvePositionOverHermite())); EXPECT_PRED_FORMAT2(AssertQStringsEqual, positionOptionsAtts.namedItem("interpolationType").nodeValue(), "3"); @@ -529,7 +529,7 @@ INSTANTIATE_TEST_SUITE_P(BundleObservationSolveSettings, PositionSolveOptionStri QString("AllPolynomialCoefficients")))); TEST(BundleObservationSolveSettings, GroupConstructorBadOverhermite) { - std::string message = "The OVERHERMITE parameter must be set to TRUE or FALSE; YES or NO"; + QString message = "The OVERHERMITE parameter must be set to TRUE or FALSE; YES or NO"; PvlGroup settingsGroup("VO1/VISA"); PvlKeyword camsolve("CamSolve"); @@ -555,7 +555,7 @@ TEST(BundleObservationSolveSettings, GroupConstructorBadOverhermite) { } TEST(BundleObservationSolveSettings, GroupConstructorBadTwist) { - std::string message = "The TWIST parameter must be set to TRUE or FALSE; YES or NO"; + QString message = "The TWIST parameter must be set to TRUE or FALSE; YES or NO"; PvlGroup settingsGroup("VO1/VISA"); PvlKeyword camsolve("CamSolve"); @@ -581,7 +581,7 @@ TEST(BundleObservationSolveSettings, GroupConstructorBadTwist) { } TEST(BundleObservationSolveSettings, GroupConstructorBadOverExisting) { - std::string message = "The OVEREXISTING parameter must be set to TRUE or FALSE; YES or NO"; + QString message = "The OVEREXISTING parameter must be set to TRUE or FALSE; YES or NO"; PvlGroup settingsGroup("VO1/VISA"); PvlKeyword camsolve("CamSolve"); @@ -608,7 +608,7 @@ TEST(BundleObservationSolveSettings, GroupConstructorBadOverExisting) { TEST(BundleObservationSolveSettings, PositionStringToOptionBadValue) { - std::string message = "Unknown bundle instrument position solve option foo."; + QString message = "Unknown bundle instrument position solve option foo."; try { BundleObservationSolveSettings::stringToInstrumentPositionSolveOption( @@ -625,7 +625,7 @@ TEST(BundleObservationSolveSettings, PositionStringToOptionBadValue) TEST(BundleObservationSolveSettings, PointingStringToOptionBadValue) { - std::string message = "Unknown bundle instrument pointing solve option foo."; + QString message = "Unknown bundle instrument pointing solve option foo."; try { BundleObservationSolveSettings::stringToInstrumentPointingSolveOption( diff --git a/isis/tests/BundleResultsTests.cpp b/isis/tests/BundleResultsTests.cpp index 52d5304cf6..d4227df564 100644 --- a/isis/tests/BundleResultsTests.cpp +++ b/isis/tests/BundleResultsTests.cpp @@ -48,11 +48,11 @@ namespace Isis { */ BundleResultsXmlHandlerTester(QXmlStreamReader *reader, FileName xmlFile) : BundleResults() { - m_file.setFileName(xmlFile.expanded()); + m_file.setFileName(QString::fromStdString(xmlFile.expanded())); if (!m_file.open(QFile::ReadOnly) ) { throw IException(IException::Io, - QString("Unable to open xml file, [%1], with read access").arg(xmlFile.expanded()), + "Unable to open xml file, ["+xmlFile.expanded()+"], with read access", _FILEINFO_); } @@ -550,7 +550,7 @@ TEST(BundleResults, Sigma0Computation) { } catch (IException &e) { EXPECT_THAT( - e.toString().toStdString(), + e.toString(), ::testing::HasSubstr("Computed degrees of freedom [")); } catch (...) { @@ -576,7 +576,7 @@ TEST(BundleResults, NoOutputNet) { } catch (IException &e) { EXPECT_THAT( - e.toString().toStdString(), + e.toString(), ::testing::HasSubstr("Output Control Network has not been set.")); } catch (...) { @@ -599,12 +599,12 @@ TEST_F(BundleResultsPopulated, Serialization) { QFile xml(saveFile); if(!xml.open(QFile::ReadOnly | QFile::Text)){ throw IException(IException::Unknown, - QString("Failed to parse xml file, [%1]").arg(xml.fileName()), + "Failed to parse xml file, ["+xml.fileName().toStdString()+"]", _FILEINFO_); } QXmlStreamReader reader(&xml); - BundleResultsXmlHandlerTester newResults(&reader, saveFile); + BundleResultsXmlHandlerTester newResults(&reader, saveFile.toStdString()); EXPECT_EQ(newResults.numberFixedPoints(), results.numberFixedPoints()); EXPECT_EQ(newResults.numberHeldImages(), results.numberHeldImages()); diff --git a/isis/tests/BundleSettingsTests.cpp b/isis/tests/BundleSettingsTests.cpp index 81ea31b275..b8cc648ae5 100644 --- a/isis/tests/BundleSettingsTests.cpp +++ b/isis/tests/BundleSettingsTests.cpp @@ -262,7 +262,7 @@ TEST_P(BoolTest, saveValidateNetwork) { QDomElement validateNetwork = globalSettings.firstChildElement("validateNetwork"); ASSERT_FALSE(validateNetwork.isNull()); EXPECT_EQ("validateNetwork", validateNetwork.tagName()); - EXPECT_EQ(toString(testSettings.validateNetwork()), validateNetwork.text()); + EXPECT_EQ(QString::number(testSettings.validateNetwork()), validateNetwork.text()); } TEST_P(BoolTest, outlierRejection) { @@ -285,12 +285,12 @@ TEST_P(BoolTest, saveOutlierRejection) { ASSERT_FALSE(outlierRejectionOptions.isNull()); QDomNamedNodeMap outlierRejectionOptionsAtts = outlierRejectionOptions.attributes(); EXPECT_EQ( - toString(testSettings.outlierRejection()), + QString::number(testSettings.outlierRejection()), outlierRejectionOptionsAtts.namedItem("rejection").nodeValue() ); EXPECT_EQ( (testSettings.outlierRejection() ? - toString(testSettings.outlierRejectionMultiplier()) : "N/A"), + QString::number(testSettings.outlierRejectionMultiplier()) : "N/A"), outlierRejectionOptionsAtts.namedItem("multiplier").nodeValue() ); } @@ -341,23 +341,23 @@ TEST_P(BoolTest, saveSolveOptions) { ASSERT_FALSE(solveOptions.isNull()); QDomNamedNodeMap solveOptionAtts = solveOptions.attributes(); EXPECT_EQ( - toString(testSettings.solveObservationMode()), + QString::number(testSettings.solveObservationMode()), solveOptionAtts.namedItem("solveObservationMode").nodeValue() ); EXPECT_EQ( - toString(testSettings.solveRadius()), + QString::number(testSettings.solveRadius()), solveOptionAtts.namedItem("solveRadius").nodeValue() ); EXPECT_EQ( - toString(testSettings.updateCubeLabel()), + QString::number(testSettings.updateCubeLabel()), solveOptionAtts.namedItem("updateCubeLabel").nodeValue() ); EXPECT_EQ( - toString(testSettings.errorPropagation()), + QString::number(testSettings.errorPropagation()), solveOptionAtts.namedItem("errorPropagation").nodeValue() ); EXPECT_EQ( - toString(testSettings.createInverseMatrix()), + QString::number(testSettings.createInverseMatrix()), solveOptionAtts.namedItem("createInverseMatrix").nodeValue() ); } @@ -402,11 +402,11 @@ TEST_P(BoolTest, saveCoordinateTypes) { ASSERT_FALSE(solveOptions.isNull()); QDomNamedNodeMap solveOptionAtts = solveOptions.attributes(); EXPECT_EQ( - toString(testSettings.controlPointCoordTypeReports()), + QString::number(testSettings.controlPointCoordTypeReports()), solveOptionAtts.namedItem("controlPointCoordTypeReports").nodeValue() ); EXPECT_EQ( - toString(testSettings.controlPointCoordTypeBundle()), + QString::number(testSettings.controlPointCoordTypeBundle()), solveOptionAtts.namedItem("controlPointCoordTypeBundle").nodeValue() ); } @@ -496,15 +496,15 @@ TEST(BundleSettings, saveGlobalSigmas) { ASSERT_FALSE(aprioriSigmas.isNull()); QDomNamedNodeMap aprioriSigmasAtts = aprioriSigmas.attributes(); EXPECT_EQ( - toString(testSettings.globalPointCoord1AprioriSigma()), + QString::number(testSettings.globalPointCoord1AprioriSigma()), aprioriSigmasAtts.namedItem("pointCoord1").nodeValue() ); EXPECT_EQ( - toString(testSettings.globalPointCoord2AprioriSigma()), + QString::number(testSettings.globalPointCoord2AprioriSigma()), aprioriSigmasAtts.namedItem("pointCoord2").nodeValue() ); EXPECT_EQ( - toString(testSettings.globalPointCoord3AprioriSigma()), + QString::number(testSettings.globalPointCoord3AprioriSigma()), aprioriSigmasAtts.namedItem("pointCoord3").nodeValue() ); } @@ -622,11 +622,11 @@ TEST_P(ConvergenceCriteriaTest, saveConvergenceCriteria) { convergenceCriteriaOptionsAtts.namedItem("convergenceCriteria").nodeValue() ); EXPECT_EQ( - toString(testSettings.convergenceCriteriaThreshold()), + QString::number(testSettings.convergenceCriteriaThreshold()), convergenceCriteriaOptionsAtts.namedItem("threshold").nodeValue() ); EXPECT_EQ( - toString(testSettings.convergenceCriteriaMaximumIterations()), + QString::number(testSettings.convergenceCriteriaMaximumIterations()), convergenceCriteriaOptionsAtts.namedItem("maximumIterations").nodeValue() ); } @@ -677,7 +677,7 @@ TEST(BundleSettings, maximumLikelihoodWelsch) { } catch (IException &e) { EXPECT_THAT( - e.toString().toStdString(), + e.toString(), ::testing::HasSubstr("the first model must be of type HUBER or HUBER_MODIFIED") ); } @@ -700,7 +700,7 @@ TEST(BundleSettings, maximumLikelihoodChen) { } catch (IException &e) { EXPECT_THAT( - e.toString().toStdString(), + e.toString(), ::testing::HasSubstr("the first model must be of type HUBER or HUBER_MODIFIED") ); } @@ -781,7 +781,7 @@ TEST(BundleSettings, saveMaximumLikelyhoodModels) { modelAtts.namedItem("type").nodeValue() ); EXPECT_EQ( - toString(functions[modelIndex].second), + QString::number(functions[modelIndex].second), modelAtts.namedItem("quantile").nodeValue() ); } diff --git a/isis/tests/BundleSolutionInfoTests.cpp b/isis/tests/BundleSolutionInfoTests.cpp index 62f2437522..9bff1c0f8b 100644 --- a/isis/tests/BundleSolutionInfoTests.cpp +++ b/isis/tests/BundleSolutionInfoTests.cpp @@ -39,12 +39,12 @@ namespace Isis { class BundleSolutionInfoXmlHandlerTester : public BundleSolutionInfo { public: BundleSolutionInfoXmlHandlerTester(QXmlStreamReader *reader, FileName xmlFile) : BundleSolutionInfo() { - QString xmlPath(xmlFile.expanded()); + QString xmlPath(QString::fromStdString(xmlFile.expanded())); QFile file(xmlPath); if (!file.open(QFile::ReadOnly) ) { throw IException(IException::Io, - QString("Unable to open xml file, [%1], with read access").arg(xmlFile.expanded()), + "Unable to open xml file, ["+xmlFile.expanded()+"], with read access", _FILEINFO_); } if (reader->readNextStartElement()) { @@ -68,7 +68,7 @@ TEST_F(ThreeImageNetwork, BundleSolutionInfoConstructors) { BundleResults results; results.setNumberObservations(1000); QList imageList; - BundleSolutionInfo solution(settings, networkFile, results, imageList); + BundleSolutionInfo solution(settings, networkFile.toStdString(), results, imageList); EXPECT_TRUE(solution.adjustedImages().empty()); EXPECT_EQ(solution.bundleResults().numberObservations(), results.numberObservations()); @@ -82,7 +82,7 @@ TEST_F(ThreeImageNetwork, BundleSolutionInfoSerialization) { BundleSettingsQsp settings(new BundleSettings()); BundleResults results; QList imageList; - BundleSolutionInfo solution(settings, networkFile, results, imageList); + BundleSolutionInfo solution(settings, networkFile.toStdString(), results, imageList); QString saveFile = tempDir.path() + "/BundleSolutionInfoTestData.xml"; QFile qXmlFile(saveFile); @@ -97,12 +97,12 @@ TEST_F(ThreeImageNetwork, BundleSolutionInfoSerialization) { QFile xml(saveFile); if(!xml.open(QFile::ReadOnly | QFile::Text)){ throw IException(IException::Unknown, - QString("Failed to parse xml file, [%1]").arg(xml.fileName()), + "Failed to parse xml file, ["+xml.fileName().toStdString()+"]", _FILEINFO_); } QXmlStreamReader reader(&xml); - BundleSolutionInfoXmlHandlerTester newSolution(&reader, saveFile); + BundleSolutionInfoXmlHandlerTester newSolution(&reader, saveFile.toStdString()); EXPECT_EQ(solution.adjustedImages().size(), newSolution.adjustedImages().size()); EXPECT_EQ(solution.bundleResults().numberObservations(), newSolution.bundleResults().numberObservations()); @@ -116,7 +116,7 @@ TEST_F(ThreeImageNetwork, BundleSolutionInfoMutators) { BundleSettingsQsp settings(new BundleSettings()); BundleResults results; QList imageList; - BundleSolutionInfo solution(settings, networkFile, results, imageList); + BundleSolutionInfo solution(settings, networkFile.toStdString(), results, imageList); solution.addAdjustedImages(NULL); @@ -262,7 +262,7 @@ TEST_F(ThreeImageNetwork, BundleSolutionInfoOutputFiles) { results.setOutputControlNet(ControlNetQsp(new ControlNet(outNet))); results.setObservations(observationVector); - BundleSolutionInfo solution(settings, networkFile, results, imageList); + BundleSolutionInfo solution(settings, networkFile.toStdString(), results, imageList); solution.outputText(); solution.outputImagesCSV(); diff --git a/isis/tests/CSMCameraTests.cpp b/isis/tests/CSMCameraTests.cpp index f5134d4ae9..5ccb0a2392 100644 --- a/isis/tests/CSMCameraTests.cpp +++ b/isis/tests/CSMCameraTests.cpp @@ -392,8 +392,8 @@ TEST_F(CSMCameraFixture, getParameterIndicesListError) { } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Failed to find indices for the following parameters [" - "Parameter 4,Parameter 0].")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Failed to find indices for the following parameters [" + "Parameter 4,Parameter 0].") != std::string::npos) << e.toString(); } catch(...) { @@ -483,8 +483,8 @@ TEST_F(CSMCameraFixture, SetTime) { } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Setting the image time is not supported " - "for CSM camera models")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Setting the image time is not supported " + "for CSM camera models") != std::string::npos) << e.toString(); } catch(...) { @@ -504,8 +504,8 @@ TEST_F(CSMCameraFixture, SubSolarPoint) { } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Sub solar point is not supported " - "for CSM camera models")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Sub solar point is not supported " + "for CSM camera models") != std::string::npos) << e.toString(); } catch(...) { @@ -524,8 +524,8 @@ TEST_F(CSMCameraFixture, PixelIfovOffsets) { } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Pixel Field of View is not supported " - "for CSM camera models")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Pixel Field of View is not supported " + "for CSM camera models") != std::string::npos) << e.toString(); } catch(...) { @@ -545,8 +545,8 @@ TEST_F(CSMCameraFixture, SunPosition) { } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Sun position is not supported " - "for CSM camera models")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Sun position is not supported " + "for CSM camera models") != std::string::npos) << e.toString(); } catch(...) { @@ -560,8 +560,8 @@ TEST_F(CSMCameraFixture, SunPosition) { } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Sun position is not supported " - "for CSM camera models")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Sun position is not supported " + "for CSM camera models") != std::string::npos) << e.toString(); } catch(...) { @@ -580,8 +580,8 @@ TEST_F(CSMCameraFixture, InstrumentPosition) { } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Instrument position is not supported " - "for CSM camera models")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Instrument position is not supported " + "for CSM camera models") != std::string::npos) << e.toString(); } catch(...) { @@ -597,8 +597,8 @@ TEST_F(CSMCameraFixture, BodyRotation) { } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Body orientation is not supported " - "for CSM camera models")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Body orientation is not supported " + "for CSM camera models") != std::string::npos) << e.toString(); } catch(...) { @@ -615,8 +615,8 @@ TEST_F(CSMCameraFixture, InstrumentRotation) { } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Instrument orientation is not supported " - "for CSM camera models")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Instrument orientation is not supported " + "for CSM camera models") != std::string::npos) << e.toString(); } catch(...) { @@ -633,8 +633,8 @@ TEST_F(CSMCameraFixture, SolarLongitude) { } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Solar longitude is not supported " - "for CSM camera models")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Solar longitude is not supported " + "for CSM camera models") != std::string::npos) << e.toString(); } catch(...) { @@ -651,8 +651,8 @@ TEST_F(CSMCameraFixture, SolarDistance) { } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Solar distance is not supported " - "for CSM camera models")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Solar distance is not supported " + "for CSM camera models") != std::string::npos) << e.toString(); } catch(...) { diff --git a/isis/tests/Cam2mapTests.cpp b/isis/tests/Cam2mapTests.cpp index 04174dba17..b5b94e8371 100644 --- a/isis/tests/Cam2mapTests.cpp +++ b/isis/tests/Cam2mapTests.cpp @@ -20,7 +20,7 @@ using namespace Isis; using ::testing::Return; using ::testing::AtLeast; -static QString APP_XML = FileName("$ISISROOT/bin/xml/cam2map.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/cam2map.xml").expanded()); TEST_F(DefaultCube, FunctionalTestCam2mapDefault) { std::istringstream labelStrm(R"( @@ -56,7 +56,7 @@ TEST_F(DefaultCube, FunctionalTestCam2mapDefault) { Pvl log; cam2map(testCube, userMap, userGrp, ui, &log); - Cube ocube(tempDir.path()+"/level2.cub"); + Cube ocube(tempDir.path().toStdString()+ "/level2.cub"); PvlGroup cubeMapGroup = ocube.label()->findGroup("Mapping", Pvl::Traverse); @@ -156,7 +156,7 @@ TEST_F(DefaultCube, FunctionalTestCam2mapUserLatlon) { Pvl log; cam2map(testCube, userMap, userGrp, ui, &log); - Cube ocube(tempDir.path()+"/level2.cub"); + Cube ocube(tempDir.path().toStdString()+ "/level2.cub"); ASSERT_EQ(userGrp.findKeyword("PixelResolution")[0], "100000.0"); ASSERT_EQ(userGrp.findKeyword("Scale")[0], "0.59274697523306"); @@ -204,7 +204,7 @@ TEST_F(LineScannerCube, FunctionalTestCam2mapMapLatlon) { Pvl log; cam2map(testCube, userMap, userGrp, ui, &log); - Cube ocube(tempDir.path()+"/level2.cub"); + Cube ocube(tempDir.path().toStdString()+ "/level2.cub"); ASSERT_EQ(userGrp.findKeyword("PixelResolution")[0], "9.0084341025159"); ASSERT_EQ(userGrp.findKeyword("Scale")[0], "6579.9113196323"); @@ -320,11 +320,11 @@ TEST_F(DefaultCube, FunctionalTestCam2mapFramerMock) { Pvl log; MockProcessRubberSheet rs; - FileName fn(tempDir.path() + "/level2.cub"); + FileName fn(tempDir.path().toStdString() + "/level2.cub"); CubeAttributeOutput outputAttr(fn); Cube outputCube; outputCube.setDimensions(1, 1, 1); - outputCube.create(fn.expanded(), outputAttr); + outputCube.create(QString::fromStdString(fn.expanded()), outputAttr); outputCube.reopen("rw"); EXPECT_CALL(rs, SetInputCube(testCube, 0)).Times(AtLeast(1)); @@ -368,11 +368,11 @@ TEST_F(LineScannerCube, FunctionalTestCam2mapLineScanMock){ Pvl log; MockProcessRubberSheet rs; - FileName fn(tempDir.path() + "/level2.cub"); + FileName fn(tempDir.path().toStdString() + "/level2.cub"); CubeAttributeOutput outputAttr(fn); Cube outputCube; outputCube.setDimensions(1, 1, 1); - outputCube.create(fn.expanded(), outputAttr); + outputCube.create(QString::fromStdString(fn.expanded()), outputAttr); outputCube.reopen("rw"); EXPECT_CALL(rs, SetInputCube(testCube, 0)).Times(AtLeast(1)); @@ -419,11 +419,11 @@ TEST_F(DefaultCube, FunctionalTestCam2mapForwardMock) { Pvl log; MockProcessRubberSheet rs; - FileName fn(tempDir.path() + "/level2.cub"); + FileName fn(tempDir.path().toStdString() + "/level2.cub"); CubeAttributeOutput outputAttr(fn); Cube outputCube; outputCube.setDimensions(1, 1, 1); - outputCube.create(fn.expanded(), outputAttr); + outputCube.create(QString::fromStdString(fn.expanded()), outputAttr); outputCube.reopen("rw"); EXPECT_CALL(rs, SetInputCube(testCube, 0)).Times(AtLeast(1)); @@ -470,11 +470,11 @@ TEST_F(DefaultCube, FunctionalTestCam2mapReverseMock) { Pvl log; MockProcessRubberSheet rs; - FileName fn(tempDir.path() + "/level2.cub"); + FileName fn(tempDir.path().toStdString() + "/level2.cub"); CubeAttributeOutput outputAttr(fn); Cube outputCube; outputCube.setDimensions(1, 1, 1); - outputCube.create(fn.expanded(), outputAttr); + outputCube.create(QString::fromStdString(fn.expanded()), outputAttr); outputCube.reopen("rw"); EXPECT_CALL(rs, SetInputCube(testCube, 0)).Times(AtLeast(1)); diff --git a/isis/tests/CameraFixtures.cpp b/isis/tests/CameraFixtures.cpp index 34aac0417d..107c26802a 100644 --- a/isis/tests/CameraFixtures.cpp +++ b/isis/tests/CameraFixtures.cpp @@ -117,7 +117,7 @@ namespace Isis { demLabel.findObject("IsisCube").findObject("Core").findGroup("Pixels")["Type"] = "Real"; demCube = new Cube(); - demCube->fromLabel(tempDir.path() + "/demCube.cub", demLabel, "rw"); + demCube->fromLabel(tempDir.path().toStdString() + "/demCube.cub", demLabel, "rw"); TableField minRadius("MinimumRadius", TableField::Double); TableField maxRadius("MaximumRadius", TableField::Double); @@ -185,7 +185,7 @@ namespace Isis { projCubeLabel >> projLabel; testCube = new Cube(); - testCube->fromIsd(tempDir.path() + "/default.cub", label, isd, "rw"); + testCube->fromIsd(tempDir.path().toStdString() + "/default.cub", label, isd, "rw"); LineManager line(*testCube); int pixelValue = 1; @@ -198,7 +198,7 @@ namespace Isis { } projTestCube = new Cube(); - projTestCube->fromIsd(tempDir.path() + "/default.level2.cub", projLabel, isd, "rw"); + projTestCube->fromIsd(tempDir.path().toStdString() + "/default.level2.cub", projLabel, isd, "rw"); line = LineManager(*projTestCube); pixelValue = 1; @@ -225,7 +225,7 @@ namespace Isis { delete testCube; testCube = new Cube(); - testCube->fromIsd(tempDir.path() + "/default.cub", label, isd, "rw"); + testCube->fromIsd(tempDir.path().toStdString() + "/default.cub", label, isd, "rw"); LineManager line(*testCube); int pixelValue = 1; @@ -251,7 +251,7 @@ namespace Isis { delete projTestCube; projTestCube = new Cube(); - projTestCube->fromIsd(tempDir.path() + "/default.level2.cub", projLabel, isd, "rw"); + projTestCube->fromIsd(tempDir.path().toStdString() + "/default.level2.cub", projLabel, isd, "rw"); line = LineManager(*projTestCube); pixelValue = 1; @@ -294,7 +294,7 @@ namespace Isis { projCubeLabel >> projLabel; testCube = new Cube(); - testCube->fromIsd(tempDir.path() + "/default.cub", label, isd, "rw"); + testCube->fromIsd(tempDir.path().toStdString() + "/default.cub", label, isd, "rw"); LineManager line(*testCube); int pixelValue = 1; for(line.begin(); !line.end(); line++) { @@ -306,7 +306,7 @@ namespace Isis { } projTestCube = new Cube(); - projTestCube->fromIsd(tempDir.path() + "/default.level2.cub", projLabel, isd, "rw"); + projTestCube->fromIsd(tempDir.path().toStdString() + "/default.level2.cub", projLabel, isd, "rw"); line = LineManager(*projTestCube); pixelValue = 1; for(line.begin(); !line.end(); line++) { @@ -368,7 +368,7 @@ namespace Isis { QString testPath = tempDir.path() + "/B10_test.cub"; QFile::copy("data/mroCtxImage/ctxTestImage.cub", testPath); - testCube.reset(new Cube(testPath)); + testCube.reset(new Cube(testPath.toStdString())); } @@ -389,7 +389,7 @@ namespace Isis { delete testCube; testCube = new Cube(); - FileName newCube(tempDir.path() + "/testing.cub"); + FileName newCube(tempDir.path().toStdString() + "/testing.cub"); testCube->fromIsd(newCube, label, isd, "rw"); PvlGroup &kernels = testCube->label()->findObject("IsisCube").findGroup("Kernels"); @@ -508,7 +508,7 @@ namespace Isis { delete testCube; testCube = new Cube(); - FileName newCube(tempDir.path() + "/testing.cub"); + FileName newCube(tempDir.path().toStdString() + "/testing.cub"); testCube->fromIsd(newCube, label, isd, "rw"); PvlGroup &kernels = testCube->label()->findObject("IsisCube").findGroup("Kernels"); @@ -639,7 +639,7 @@ namespace Isis { delete testCube; // This is now a MRO cube - testCube = new Cube(fileName, "rw"); + testCube = new Cube(fileName.toStdString(), "rw"); // create a jitter file QString jitter = R"(# Sample Line ET @@ -739,7 +739,7 @@ namespace Isis { QString fileName = tempDir.path() + "/leisa.cub"; delete testCube; testCube = new Cube(); - testCube->fromIsd(fileName, label, isd, "rw"); + testCube->fromIsd(fileName.toStdString(), label, isd, "rw"); LineManager line(*testCube); double pixelValue = 0.0; @@ -756,7 +756,7 @@ namespace Isis { delete testCube; testCube = new Cube(); - FileName newCube(tempDir.path() + "/testing.cub"); + FileName newCube(tempDir.path().toStdString() + "/testing.cub"); testCube->fromIsd(newCube, label, isd, "rw"); @@ -817,7 +817,7 @@ namespace Isis { QString fileName = testCube->fileName(); delete testCube; - testCube = new Cube(fileName, "rw"); + testCube = new Cube(fileName.toStdString(), "rw"); } void OsirisRexTagcamsNAVCamCube::setInstrument(QString ikid, QString instrumentId) { @@ -829,7 +829,7 @@ namespace Isis { Pvl testLabel; cubeLabel >> testLabel; - testCube->fromLabel(tempDir.path() + "/testCube.cub", testLabel, "rw"); + testCube->fromLabel(tempDir.path().toStdString() + "/testCube.cub", testLabel, "rw"); } @@ -842,7 +842,7 @@ namespace Isis { Pvl testLabel; cubeLabel >> testLabel; - testCube->fromLabel(tempDir.path() + "/testCube.cub", testLabel, "rw"); + testCube->fromLabel(tempDir.path().toStdString() + "/testCube.cub", testLabel, "rw"); } @@ -851,7 +851,7 @@ namespace Isis { QString testPath = tempDir.path() + "/test.cub"; QFile::copy("data/mgsImages/mocImage.cub", testPath); - testCube.reset(new Cube(testPath)); + testCube.reset(new Cube(testPath.toStdString())); } @@ -864,7 +864,7 @@ namespace Isis { QString testPath = tempDir.path() + "/test.cub"; QFile::copy("data/clipper/ClipperWacFc.cub", testPath); - wacFcCube = new Cube(testPath); + wacFcCube = new Cube(testPath.toStdString()); PvlGroup &wacKernels = wacFcCube->label()->findObject("IsisCube").findGroup("Kernels"); wacKernels.findKeyword("NaifFrameCode").setValue("-159102"); @@ -891,7 +891,7 @@ namespace Isis { delete testCube; testCube = new Cube(); - FileName newCube(tempDir.path() + "/testing.cub"); + FileName newCube(tempDir.path().toStdString() + "/testing.cub"); testCube->fromIsd(newCube, label, isd, "rw"); @@ -936,7 +936,7 @@ namespace Isis { QString fileName = testCube->fileName(); delete testCube; - testCube = new Cube(fileName, "rw"); + testCube = new Cube(fileName.toStdString(), "rw"); double offset = 10; AlphaCube aCube(testCube->sampleCount(), testCube->lineCount(), @@ -959,12 +959,12 @@ namespace Isis { if (instrumentId == "EIS-NAC-PB") { QString testPath = tempDir.path() + "/nacTest.cub"; QFile::copy("data/clipper/ClipperNacPb.cub", testPath); - testCube = new Cube(testPath, "rw"); + testCube = new Cube(testPath.toStdString(), "rw"); } else if (instrumentId == "EIS-WAC-PB") { QString testPath = tempDir.path() + "/wacTest.cub"; QFile::copy("data/clipper/ClipperWacPb.cub", testPath); - testCube = new Cube(testPath, "rw"); + testCube = new Cube(testPath.toStdString(), "rw"); } } @@ -981,7 +981,7 @@ namespace Isis { cubeLabel >> label; testCube.reset( new Cube() ) ; - testCube->fromIsd(tempDir.path() + "/m0155881376f3_2p_cif_dbl.cub", label, isd, "rw"); + testCube->fromIsd(tempDir.path().toStdString() + "/m0155881376f3_2p_cif_dbl.cub", label, isd, "rw"); } void NearMsiCameraCube::TearDown() { diff --git a/isis/tests/CnetWinnowTests.cpp b/isis/tests/CnetWinnowTests.cpp index d5e0dab249..f6dc82a954 100644 --- a/isis/tests/CnetWinnowTests.cpp +++ b/isis/tests/CnetWinnowTests.cpp @@ -16,7 +16,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/cnetwinnow.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/cnetwinnow.xml").expanded()); TEST_F(ThreeImageNetwork, FunctionalTestCnetwinnowDefault) { QString onetPath = tempDir.path()+"/winnowedNetwork.net"; diff --git a/isis/tests/ColorTests.cpp b/isis/tests/ColorTests.cpp index c52665a103..bd84bb3e8c 100644 --- a/isis/tests/ColorTests.cpp +++ b/isis/tests/ColorTests.cpp @@ -27,7 +27,7 @@ namespace Isis{ TEST (ColorTests, InvalidColorToString) { - std::string message = "Can not convert an invalid color to an RGBA string. " + QString message = "Can not convert an invalid color to an RGBA string. " "There is no string representation of an invalid color"; try { Color::toRGBAString(QColor()); diff --git a/isis/tests/ColumnTests.cpp b/isis/tests/ColumnTests.cpp index 8416d6c994..00e848a9a3 100644 --- a/isis/tests/ColumnTests.cpp +++ b/isis/tests/ColumnTests.cpp @@ -94,7 +94,7 @@ TEST(Column, Precision) { //Should throw an error when SetName is called with a string //whose length is greater than Width. TEST(Column, SetNameError) { - std::string message = "Name [Test Column] is wider than width"; + QString message = "Name [Test Column] is wider than width"; Column column; column.SetWidth(1); try { @@ -113,7 +113,7 @@ TEST(Column, SetNameError) { //Should throw an error when SetWidth is called with a value less than //the length of Name TEST(Column, SetWidthError) { - std::string message = "Width is insufficient to contain name[Test Column]"; + QString message = "Width is insufficient to contain name[Test Column]"; Column column; column.SetName("Test Column"); try { @@ -132,7 +132,7 @@ TEST(Column, SetWidthError) { //Should throw an error when Alignment is Decimal and //SetType is called with String or Integer TEST_P(TypeError, SetTypeError) { - std::string message = "Integer or string type is not sensible if alignment is Decimal."; + QString message = "Integer or string type is not sensible if alignment is Decimal."; Column column; column.SetAlignment(Column::Decimal); try { @@ -151,7 +151,7 @@ TEST_P(TypeError, SetTypeError) { //Should throw an error when Type is String or Integer and //SetAllignment is called with Decimal TEST_P(TypeError, SetAlignmentError) { - std::string message = "Decimal alignment does not make sense for integer or string values."; + QString message = "Decimal alignment does not make sense for integer or string values."; Column column; column.SetType(GetParam()); try { @@ -172,7 +172,7 @@ INSTANTIATE_TEST_SUITE_P(Column, TypeError, ::testing::Values( //Tests that Precision's exceptions are working correctly //Should throw an error when SetPrecision is called and Alignment is not Decimal TEST_P(PrecisionError, SetPrecisionError) { - std::string message = "Setting precision only makes sense for Decimal Alignment"; + QString message = "Setting precision only makes sense for Decimal Alignment"; Column column; column.SetAlignment(GetParam()); diff --git a/isis/tests/CsmFixtures.cpp b/isis/tests/CsmFixtures.cpp index 697d980829..0f81a2bcc2 100644 --- a/isis/tests/CsmFixtures.cpp +++ b/isis/tests/CsmFixtures.cpp @@ -160,7 +160,7 @@ namespace Isis { } void CSMNetwork::SetUp(){ - QString APP_XML = FileName("$ISISROOT/bin/xml/csminit.xml").expanded(); + QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/csminit.xml").expanded()); QVector fNames = {"/Test_A", "/Test_B", "/Test_C", "/Test_D", "/Test_E", "/Test_F", @@ -176,10 +176,10 @@ namespace Isis { for (int i = 0; i < cubes.size() ; i++){ cubes[i] = new Cube(); cubes[i]->setDimensions(1024,1024,1); - FileName cubName = FileName(tempDir.path()+fNames[i]+".cub"); - cubes[i]->create(cubName.expanded()); - cubeList->append(cubes[i]->fileName()); - QVector args = {"from="+cubName.expanded(), + FileName cubName = FileName(tempDir.path().toStdString()+fNames[i].toStdString()+".cub"); + cubes[i]->create(QString::fromStdString(cubName.expanded())); + cubeList->append(cubes[i]->fileName().toStdString()); + QVector args = {"from="+QString::fromStdString(cubName.expanded()), "state=data/CSMNetwork/"+fNames[i]+".json", "modelname=TestCsmModel", "pluginname=TestCsmPlugin" @@ -187,7 +187,7 @@ namespace Isis { UserInterface ui(APP_XML, args); csminit(ui); } - cubeList->write(cubeListFile); + cubeList->write(cubeListFile.toStdString()); } void CSMNetwork::TearDown() { diff --git a/isis/tests/CubeFixtures.cpp b/isis/tests/CubeFixtures.cpp index fe835b4837..cda198f7e6 100644 --- a/isis/tests/CubeFixtures.cpp +++ b/isis/tests/CubeFixtures.cpp @@ -354,7 +354,7 @@ namespace Isis { cubeListPath = tempDir.path() + "/filelist.txt"; cubeFileList.append("data/rings/rings1proj.cub"); cubeFileList.append("data/rings/rings2proj.cub"); - cubeFileList.write(cubeListPath); + cubeFileList.write(cubeListPath.toStdString()); } } \ No newline at end of file diff --git a/isis/tests/CubeTests.cpp b/isis/tests/CubeTests.cpp index 91348eb305..ab48aa1955 100644 --- a/isis/tests/CubeTests.cpp +++ b/isis/tests/CubeTests.cpp @@ -210,7 +210,7 @@ TEST(CubeTest, TestCubeAttachSpiceFromIsd) { QTemporaryFile tempFile; Cube testCube; - testCube.fromIsd(tempFile.fileName() + ".cub", label, isd, "rw"); + testCube.fromIsd(tempFile.fileName().toStdString() + ".cub", label, isd, "rw"); PvlGroup kernels = testCube.group("Kernels"); diff --git a/isis/tests/DisplacementTests.cpp b/isis/tests/DisplacementTests.cpp index 3a18327fc0..8b04e3274b 100644 --- a/isis/tests/DisplacementTests.cpp +++ b/isis/tests/DisplacementTests.cpp @@ -176,8 +176,8 @@ TEST(Displacement, UninitializedComparison) } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Displacement has not been" - " initialized")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Displacement has not been" + " initialized") != std::string::npos) << e.toString(); } catch(...) { @@ -194,8 +194,8 @@ TEST(Displacement, UninitializedComparison) } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Displacement has not been" - " initialized")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Displacement has not been" + " initialized") != std::string::npos) << e.toString(); } catch(...) { diff --git a/isis/tests/DistanceTests.cpp b/isis/tests/DistanceTests.cpp index 8d6765ff6a..2d66340923 100644 --- a/isis/tests/DistanceTests.cpp +++ b/isis/tests/DistanceTests.cpp @@ -103,8 +103,8 @@ TEST(DistanceTests, SetNegativeDistance) { FAIL() << "Expected error message: Negative distances are not supported"; } catch(IException &e) { - EXPECT_TRUE(e.toString().contains("Negative distances are not supported")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Negative distances are not supported") != std::string::npos) + << e.toString(); } catch(...) { FAIL() << "Expected error message: Negative distances are not supported"; @@ -153,8 +153,8 @@ TEST(DistanceTests, GreaterThanNull) { FAIL() << "Expected error message: Distance has not been initialized"; } catch(IException &e) { - EXPECT_TRUE(e.toString().contains("Distance has not been initialized")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Distance has not been initialized") != std::string::npos) + << e.toString(); } catch(...) { FAIL() << "Expected error message: Distance has not been initialized"; @@ -185,8 +185,8 @@ TEST(DistanceTests, LessThanNull) { FAIL() << "Expected error message: Distance has not been initialized"; } catch(IException &e) { - EXPECT_TRUE(e.toString().contains("Distance has not been initialized")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Distance has not been initialized") != std::string::npos) + << e.toString(); } catch(...) { FAIL() << "Expected error message: Distance has not been initialized"; @@ -271,8 +271,8 @@ TEST(DistanceTests, SubtractAssignNegative) { FAIL() << "Expected error message: Negative distances are not supported"; } catch(IException &e) { - EXPECT_TRUE(e.toString().contains("Negative distances are not supported")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Negative distances are not supported") != std::string::npos) + << e.toString(); } catch(...) { FAIL() << "Expected error message: Negative distances are not supported"; diff --git a/isis/tests/EndianTests.cpp b/isis/tests/EndianTests.cpp index 59957674ba..1d55f184f4 100644 --- a/isis/tests/EndianTests.cpp +++ b/isis/tests/EndianTests.cpp @@ -2,6 +2,7 @@ #include #include +#include using namespace Isis; @@ -10,8 +11,8 @@ class ConversionTest : public ::testing::TestWithParam noOrder("None", Isis::ByteOrder::NoByteOrder); diff --git a/isis/tests/FileNameTests.cpp b/isis/tests/FileNameTests.cpp index ce19019a71..96baab5f71 100644 --- a/isis/tests/FileNameTests.cpp +++ b/isis/tests/FileNameTests.cpp @@ -1,7 +1,5 @@ #include "FileName.h" -#include - #include #include #include @@ -38,110 +36,110 @@ TEST(FileName, CopyConstructor) { } TEST(FileName, OriginalPath) { - QString test = "/testy/mc/test/face/test.cub"; + std::string test = "/testy/mc/test/face/test.cub"; FileName file(test); EXPECT_EQ("/testy/mc/test/face", file.originalPath()); } TEST(FileName, Path) { - QString test = "/testy/mc/test/face/test.cub"; + std::string test = "/testy/mc/test/face/test.cub"; FileName file(test); EXPECT_EQ("/testy/mc/test/face", file.path()); } TEST(FileName, Attributes) { - QString test = "/testy/mc/test/face/test.cub"; + std::string test = "/testy/mc/test/face/test.cub"; FileName file(test); EXPECT_EQ("", file.attributes()); - QString testAtt = "/testy/mc/test/face/test.cub+Bsq"; + std::string testAtt = "/testy/mc/test/face/test.cub+Bsq"; FileName fileAtt(testAtt); EXPECT_EQ("Bsq", fileAtt.attributes()); } TEST(FileName, BaseName) { - QString test = "/testy/mc/test/face/test.cub"; + std::string test = "/testy/mc/test/face/test.cub"; FileName file(test); EXPECT_EQ("test", file.baseName()); } TEST(FileName, Name) { - QString test = "/testy/mc/test/face/test.cub"; + std::string test = "/testy/mc/test/face/test.cub"; FileName file(test); EXPECT_EQ("test.cub", file.name()); } TEST(FileName, Extension) { - QString test = "/testy/mc/test/face/test.cub"; + std::string test = "/testy/mc/test/face/test.cub"; FileName file(test); EXPECT_EQ("cub", file.extension()); } TEST(FileName, ExpandedDefault) { - QString relativeFileName("test.cub"); + std::string relativeFileName("test.cub"); FileName file("$ISISROOT/" + relativeFileName); - QString isisRoot(getenv("ISISROOT")); + std::string isisRoot(getenv("ISISROOT")); EXPECT_EQ(isisRoot + "/" + relativeFileName, file.expanded()); } TEST(FileName, ExpandedUnderscore) { - QString relativeFileName("test.cub"); + std::string relativeFileName("test.cub"); setenv("SOME_FILE_PATH", getenv("ISISROOT"), 1); FileName file("$SOME_FILE_PATH/" + relativeFileName); - QString someFilePath(getenv("ISISROOT")); + std::string someFilePath(getenv("ISISROOT")); EXPECT_EQ(someFilePath + "/" + relativeFileName, file.expanded()); } TEST(FileName, Original) { - QString test = "$ISISROOT/testy/mc/test/face/test.cub"; + std::string test = "$ISISROOT/testy/mc/test/face/test.cub"; FileName file(test); EXPECT_EQ("$ISISROOT/testy/mc/test/face/test.cub", file.original()); } TEST(FileName, AddExtension) { - QString test = "/testy/mc/test/face/test.cub"; + std::string test = "/testy/mc/test/face/test.cub"; FileName file(test); EXPECT_EQ("txt", file.addExtension(".txt").extension()); } TEST(FileName, RemoveExtension) { - QString test = "/testy/mc/test/face/test.cub"; + std::string test = "/testy/mc/test/face/test.cub"; FileName file(test); EXPECT_EQ("", file.removeExtension().extension()); } TEST(FileName, SetExtension) { - QString test = "/testy/mc/test/face/test.cub"; + std::string test = "/testy/mc/test/face/test.cub"; FileName file(test); EXPECT_EQ("log", file.setExtension("log").extension()); } TEST(FileName, isQuestionMarksNoExtensionVersioned) { - QString test = "/testy/mc/test/face/test??????"; + std::string test = "/testy/mc/test/face/test??????"; FileName file(test); EXPECT_TRUE(file.isVersioned()); } TEST(FileName, isQuestionMarksExtensionVersioned) { - QString test = "/testy/mc/test/face/test??????.cub"; + std::string test = "/testy/mc/test/face/test??????.cub"; FileName file(test); EXPECT_TRUE(file.isVersioned()); } TEST(FileName, isDDMMMYYYVersioned) { - QString test = "/testy/mc/test/face/test{ddMMMyyyy}..cub"; + std::string test = "/testy/mc/test/face/test{ddMMMyyyy}..cub"; FileName file(test); EXPECT_TRUE(file.isVersioned()); @@ -202,13 +200,13 @@ TEST(FileName, CreateTempFile) { EXPECT_EQ("cub", temp.extension()); EXPECT_TRUE(temp.fileExists()); - remove(temp.expanded().toLatin1()); + remove(temp.expanded().c_str()); } TEST(FileName, ToString) { - QString relativeFileName("test.cub"); + std::string relativeFileName("test.cub"); FileName file("$ISISROOT/" + relativeFileName); - QString isisRoot(getenv("ISISROOT")); + std::string isisRoot(getenv("ISISROOT")); EXPECT_EQ(isisRoot + "/" + relativeFileName, file.toString()); } diff --git a/isis/tests/FitsToJsonTests.cpp b/isis/tests/FitsToJsonTests.cpp index c02b717056..1adad98b57 100644 --- a/isis/tests/FitsToJsonTests.cpp +++ b/isis/tests/FitsToJsonTests.cpp @@ -16,7 +16,7 @@ TEST(FitsToJson, FitsConversion) { jsonData = fitsToJson(fileTemplate); } catch (IException &e) { - FAIL() << "Unable to convert lorri fits label to json " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to convert lorri fits label to json " << e.toString().c_str() << std::endl; } // Instrument info EXPECT_EQ(jsonData["FitsLabels"][0]["HOSTNAME"]["Value"], "NEW HORIZONS"); @@ -41,7 +41,7 @@ TEST(FitsToJson, FitsConversion) { jsonData = fitsToJson(fileTemplate); } catch (IException &e) { - FAIL() << "Unable to convert fits leisa label to json " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to convert fits leisa label to json " << e.toString().c_str() << std::endl; } // Instrument info diff --git a/isis/tests/FunctionalTestsApollocal.cpp b/isis/tests/FunctionalTestsApollocal.cpp index 9c6c1cdd22..073479f58e 100644 --- a/isis/tests/FunctionalTestsApollocal.cpp +++ b/isis/tests/FunctionalTestsApollocal.cpp @@ -11,7 +11,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/apollocal.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/apollocal.xml").expanded()); TEST_F(ApolloCube, FunctionalTestApollocalDefault) { QTemporaryDir prefix; @@ -28,7 +28,7 @@ TEST_F(ApolloCube, FunctionalTestApollocalDefault) { FAIL() << "Call failed, Unable to process cube: " << e.what() << std::endl; } - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); // Check a region with both Null and non-Null data Brick brick(reseauSize + 10,reseauSize + 10,1,oCube.pixelType()); diff --git a/isis/tests/FunctionalTestsApollofindrx.cpp b/isis/tests/FunctionalTestsApollofindrx.cpp index e18689bc14..311f63ed3d 100644 --- a/isis/tests/FunctionalTestsApollofindrx.cpp +++ b/isis/tests/FunctionalTestsApollofindrx.cpp @@ -9,7 +9,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/apollofindrx.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/apollofindrx.xml").expanded()); TEST_F(LargeCube, FunctionalTestApollofindrxDefault) { diff --git a/isis/tests/FunctionalTestsApollopanstitcher.cpp b/isis/tests/FunctionalTestsApollopanstitcher.cpp index 1c8579d2da..977c7fe889 100644 --- a/isis/tests/FunctionalTestsApollopanstitcher.cpp +++ b/isis/tests/FunctionalTestsApollopanstitcher.cpp @@ -17,7 +17,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/apollopanstitcher.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/apollopanstitcher.xml").expanded()); TEST_F(TempTestingFiles, FunctionalTestApollopanstitcherDefault) { QVector args = {"file_base=$ISISTESTDATA/isis/src/apollo/apps/apollopanstitcher/tsts/default/input/AS15_P_0177R10", @@ -29,9 +29,9 @@ TEST_F(TempTestingFiles, FunctionalTestApollopanstitcherDefault) { apolloPanStitcher(options); } catch (IException &e) { - FAIL() << "Unable to stitcher apollo images: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to stitcher apollo images: " << e.toString().c_str() << std::endl; } - Cube outputCube(options.GetCubeName("TO")); + Cube outputCube(options.GetCubeName("TO").toStdString()); std::unique_ptr hist (outputCube.histogram()); diff --git a/isis/tests/FunctionalTestsApolloremrx.cpp b/isis/tests/FunctionalTestsApolloremrx.cpp index 7c2b31051b..caa44d5a30 100644 --- a/isis/tests/FunctionalTestsApolloremrx.cpp +++ b/isis/tests/FunctionalTestsApolloremrx.cpp @@ -12,7 +12,7 @@ using namespace Isis; using ::testing::HasSubstr; -static QString APP_XML = FileName("$ISISROOT/bin/xml/apolloremrx.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/apolloremrx.xml").expanded()); TEST_F(ApolloCube, FunctionalTestApolloremrxDefault) { @@ -31,7 +31,7 @@ TEST_F(ApolloCube, FunctionalTestApolloremrxDefault) { FAIL() << "Call failed, Unable to process cube: " << e.what() << std::endl; } - Cube cube(outCubeFileName); + Cube cube(outCubeFileName.toStdString()); Pvl *isisLabel = cube.label(); PvlGroup reseausGroup = isisLabel->findObject("IsisCube").findGroup("Reseaus"); @@ -86,7 +86,7 @@ TEST_F(ApolloCube, FunctionalTestApolloremrxPatch) { FAIL() << "Call failed, Unable to process cube: " << e.what() << std::endl; } - Cube cube(outCubeFileName); + Cube cube(outCubeFileName.toStdString()); Brick brick(reseauSize,reseauSize,1,cube.pixelType()); diff --git a/isis/tests/FunctionalTestsAutomos.cpp b/isis/tests/FunctionalTestsAutomos.cpp index 7b7bdb2eb5..9f588796e9 100644 --- a/isis/tests/FunctionalTestsAutomos.cpp +++ b/isis/tests/FunctionalTestsAutomos.cpp @@ -10,13 +10,13 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/automos.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/automos.xml").expanded()); TEST_F(DefaultCube, FunctionalTestAutomosDefault) { QString singleCubeListPath = tempDir.path() + "/newCubeList.lis"; FileList singleCubeList; - singleCubeList.append(projTestCube->fileName()); - singleCubeList.write(singleCubeListPath); + singleCubeList.append(projTestCube->fileName().toStdString()); + singleCubeList.write(singleCubeListPath.toStdString()); QString outPath = tempDir.path() + "/mosaic.cub"; QVector args = {"fromlist=" + singleCubeListPath, "mosaic=" + outPath}; @@ -27,7 +27,7 @@ TEST_F(DefaultCube, FunctionalTestAutomosDefault) { EXPECT_TRUE(appLog.hasGroup("ImageLocation")); - Cube mos(outPath); + Cube mos(outPath.toStdString()); Pvl label = *mos.label(); PvlGroup mapping = label.findObject("IsisCube").findGroup("Mapping"); @@ -63,8 +63,8 @@ TEST_F(DefaultCube, FunctionalTestAutomosSetRanges) { QString singleCubeListPath = tempDir.path() + "/newCubeList.lis"; FileList singleCubeList; - singleCubeList.append(projTestCube->fileName()); - singleCubeList.write(singleCubeListPath); + singleCubeList.append(projTestCube->fileName().toStdString()); + singleCubeList.write(singleCubeListPath.toStdString()); QVector args = {"fromlist=" + singleCubeListPath, "mosaic=" + outPath, "tolist=" + oFileListPath, "priority=beneath", "grange=user", @@ -75,7 +75,7 @@ TEST_F(DefaultCube, FunctionalTestAutomosSetRanges) { automos(options); - Cube mos(outPath); + Cube mos(outPath.toStdString()); Pvl label = *mos.label(); PvlGroup mapping = label.findObject("IsisCube").findGroup("Mapping"); @@ -91,10 +91,10 @@ TEST_F(DefaultCube, FunctionalTestAutomosSetRanges) { EXPECT_DOUBLE_EQ((double)mapping.findKeyword("MaximumLatitude"), 8.0); FileList lout; - lout.read(oFileListPath); + lout.read(oFileListPath.toStdString()); EXPECT_EQ(lout.size(), singleCubeList.size()); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, lout.at(0).expanded(), singleCubeList.at(0).expanded()); + EXPECT_PRED_FORMAT2(AssertStringsEqual, lout.at(0).expanded(), singleCubeList.at(0).expanded()); } @@ -103,8 +103,8 @@ TEST_F(DefaultCube, FunctionalTestAutomosPriority) { QString singleCubeListPath = tempDir.path() + "/newCubeList.lis"; FileList singleCubeList; - singleCubeList.append(projTestCube->fileName()); - singleCubeList.write(singleCubeListPath); + singleCubeList.append(projTestCube->fileName().toStdString()); + singleCubeList.write(singleCubeListPath.toStdString()); QVector args = {"fromlist=" + singleCubeListPath, "mosaic=" + outPath, "priority=average", "highsat=true", "lowsat=true", "null=true"}; @@ -113,7 +113,7 @@ TEST_F(DefaultCube, FunctionalTestAutomosPriority) { automos(options); - Cube mos(outPath); + Cube mos(outPath.toStdString()); Pvl label = *mos.label(); PvlGroup mapping = label.findObject("IsisCube").findGroup("Mapping"); @@ -148,8 +148,8 @@ TEST_F(DefaultCube, FunctionalTestAutomosTracking) { QString trackingPath = tempDir.path() + "/mosaic_tracking.cub"; FileList singleCubeList; - singleCubeList.append(projTestCube->fileName()); - singleCubeList.write(singleCubeListPath); + singleCubeList.append(projTestCube->fileName().toStdString()); + singleCubeList.write(singleCubeListPath.toStdString()); QVector args = {"fromlist=" + singleCubeListPath, "mosaic=" + outPath, "priority=band", "highsat=true", "lowsat=true", "null=true", "track=true"}; @@ -158,8 +158,8 @@ TEST_F(DefaultCube, FunctionalTestAutomosTracking) { automos(options); - Cube mos(outPath); - Cube track(trackingPath); + Cube mos(outPath.toStdString()); + Cube track(trackingPath.toStdString()); Pvl label = *mos.label(); Pvl trackingLabel = *track.label(); @@ -189,8 +189,8 @@ TEST_F(DefaultCube, FunctionalTestAutomosBandSelect) { QString singleCubeListPath = tempDir.path() + "/newCubeList.lis"; FileList singleCubeList; - singleCubeList.append(projTestCube->fileName()); - singleCubeList.write(singleCubeListPath); + singleCubeList.append(projTestCube->fileName().toStdString()); + singleCubeList.write(singleCubeListPath.toStdString()); QVector args = {"fromlist=" + singleCubeListPath, "mosaic=" + outPath, "priority=band", "number=1", "criteria=lesser"}; @@ -199,7 +199,7 @@ TEST_F(DefaultCube, FunctionalTestAutomosBandSelect) { automos(options); - Cube mos(outPath); + Cube mos(outPath.toStdString()); Pvl label = *mos.label(); PvlGroup mapping = label.findObject("IsisCube").findGroup("Mapping"); diff --git a/isis/tests/FunctionalTestsBandnorm.cpp b/isis/tests/FunctionalTestsBandnorm.cpp index 73d790a594..1f06a89a32 100644 --- a/isis/tests/FunctionalTestsBandnorm.cpp +++ b/isis/tests/FunctionalTestsBandnorm.cpp @@ -11,7 +11,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/bandnorm.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/bandnorm.xml").expanded()); TEST_F(SmallCube, FunctionalTestBandnormDefault) { QString outCubeFileName = tempDir.path() + "/outTEMP.cub"; @@ -35,7 +35,7 @@ TEST_F(SmallCube, FunctionalTestBandnormDefault) { FAIL() << "Unable to process image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName); + Cube oCube(outCubeFileName.toStdString()); std::unique_ptr oCubeStats; for (int i = 1; i <= testCube->bandCount(); i++) { @@ -73,7 +73,7 @@ TEST_F(SmallCube, FunctionalTestBandnormPencil) { FAIL() << "Unable to process image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName); + Cube oCube(outCubeFileName.toStdString()); std::unique_ptr oCubeStats(oCube.histogram()); ASSERT_DOUBLE_EQ(oCubeStats->Average(), 49.5); ASSERT_DOUBLE_EQ(oCubeStats->Sum(), 4950); @@ -166,7 +166,7 @@ TEST_F(SmallCube, FunctionalTestBandnormByNumber) { FAIL() << "Unable to process image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName); + Cube oCube(outCubeFileName.toStdString()); std::unique_ptr oCubeStats(oCube.histogram(7)); EXPECT_NEAR(oCubeStats->Average(), 92.7857, 0.0001); EXPECT_NEAR(oCubeStats->Sum(), 9278.5714263916016, 0.0001); @@ -196,7 +196,7 @@ TEST_F(SmallCube, FunctionalTestBandnormByBandAvg) { FAIL() << "Unable to process image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName); + Cube oCube(outCubeFileName.toStdString()); std::unique_ptr oCubeStats(oCube.histogram(1)); EXPECT_NEAR(oCubeStats->Average(), 1, 0.0001); EXPECT_NEAR(oCubeStats->Sum(), 100.0, 0.0001); @@ -226,7 +226,7 @@ TEST_F(SmallCube, FunctionalTestBandnormByCubeAvg) { FAIL() << "Unable to process image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName); + Cube oCube(outCubeFileName.toStdString()); std::unique_ptr oCubeStats(oCube.histogram(1)); EXPECT_NEAR(oCubeStats->Average(), 0.099099099056329576, 0.0001); EXPECT_NEAR(oCubeStats->Sum(), 9.9099099056329578, 0.0001); diff --git a/isis/tests/FunctionalTestsBandtrim.cpp b/isis/tests/FunctionalTestsBandtrim.cpp index 71f39029e5..1812ba311f 100644 --- a/isis/tests/FunctionalTestsBandtrim.cpp +++ b/isis/tests/FunctionalTestsBandtrim.cpp @@ -11,7 +11,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/bandtrim.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/bandtrim.xml").expanded()); /** * BandtrimDefault Test @@ -82,11 +82,11 @@ TEST_F(DefaultCube, FunctionalTestBandtrimDefault) { bandtrim(testCube, ui); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // Open output cube - Cube outCube(tempDir.path() + "/bandtrimDefaultOut.cub"); + Cube outCube(tempDir.path().toStdString() + "/bandtrimDefaultOut.cub"); // validate histogram statistics for each band in output cube std::unique_ptr band1Hist (outCube.histogram(1)); @@ -174,11 +174,11 @@ TEST_F(DefaultCube, FunctionalTestBandtrimOneBand) { bandtrim(testCube, ui); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // Open output cube - Cube outCube(tempDir.path() + "/bandtrimOneBandOut.cub"); + Cube outCube(tempDir.path().toStdString() + "/bandtrimOneBandOut.cub"); // validate histogram statistics for each band in output cube std::unique_ptr band1Hist (outCube.histogram(1)); diff --git a/isis/tests/FunctionalTestsCam2cam.cpp b/isis/tests/FunctionalTestsCam2cam.cpp index b4f38c6dff..8765d9155d 100644 --- a/isis/tests/FunctionalTestsCam2cam.cpp +++ b/isis/tests/FunctionalTestsCam2cam.cpp @@ -20,7 +20,7 @@ using namespace Isis; using ::testing::Return; using ::testing::AtLeast; -static QString APP_XML = FileName("$ISISROOT/bin/xml/cam2cam.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/cam2cam.xml").expanded()); TEST_F(DefaultCube, FunctionalTestCam2camNoChange) { @@ -29,14 +29,14 @@ TEST_F(DefaultCube, FunctionalTestCam2camNoChange) { testCube->reopen("r"); QString inFile = testCube->fileName(); - Cube mcube(inFile,"r"); + Cube mcube(inFile.toStdString(),"r"); cam2cam(testCube, &mcube, ui); - Cube icube(inFile); + Cube icube(inFile.toStdString()); PvlGroup icubeInstrumentGroup = icube.label()->findGroup("Instrument", Pvl::Traverse); - Cube ocube(tempDir.path()+"/Cam2CamNoChange.cub"); + Cube ocube(tempDir.path().toStdString()+"/Cam2CamNoChange.cub"); PvlGroup ocubeInstrumentGroup = ocube.label()->findGroup("Instrument", Pvl::Traverse); ASSERT_EQ(icubeInstrumentGroup.findKeyword("SpacecraftName"), ocubeInstrumentGroup.findKeyword("SpacecraftName")); diff --git a/isis/tests/FunctionalTestsCamdev.cpp b/isis/tests/FunctionalTestsCamdev.cpp index c946e3ace2..6cd23d0da6 100644 --- a/isis/tests/FunctionalTestsCamdev.cpp +++ b/isis/tests/FunctionalTestsCamdev.cpp @@ -11,7 +11,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/camdev.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/camdev.xml").expanded()); TEST_F(LineScannerCube, FunctionalTestCamdevDefault) { LineManager line(*testCube); @@ -80,7 +80,7 @@ TEST_F(LineScannerCube, FunctionalTestCamdevDefault) { FAIL() << "Unable to process image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName); + Cube oCube(outCubeFileName.toStdString()); std::unique_ptr oCubeStats; double average = 0; diff --git a/isis/tests/FunctionalTestsCaminfo.cpp b/isis/tests/FunctionalTestsCaminfo.cpp index 56eac3445c..d6e2198322 100644 --- a/isis/tests/FunctionalTestsCaminfo.cpp +++ b/isis/tests/FunctionalTestsCaminfo.cpp @@ -15,7 +15,7 @@ using namespace Isis; using ::testing::HasSubstr; -static QString APP_XML = FileName("$ISISROOT/bin/xml/caminfo.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/caminfo.xml").expanded()); TEST_F(DefaultCube, FunctionalTestCaminfoCsv) { diff --git a/isis/tests/FunctionalTestsCampt.cpp b/isis/tests/FunctionalTestsCampt.cpp index 1e6aed93c5..d06d17fe4a 100644 --- a/isis/tests/FunctionalTestsCampt.cpp +++ b/isis/tests/FunctionalTestsCampt.cpp @@ -18,7 +18,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/campt.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/campt.xml").expanded()); TEST_F(DefaultCube, FunctionalTestCamptBadColumnError) { // set up bad coordinates file @@ -39,8 +39,8 @@ TEST_F(DefaultCube, FunctionalTestCamptBadColumnError) { FAIL() << "Expected an exception to be thrown"; } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Coordinate file formatted incorrectly.")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Coordinate file formatted incorrectly.") != std::string::npos) + << e.toString(); } catch(...) { FAIL() << "Expected an IException with message: \"Coordinate file formatted incorrectly.\n" @@ -60,8 +60,8 @@ TEST_F(DefaultCube, FunctionalTestCamptFlatFileError) { FAIL() << "Expected an exception to be thrown"; } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Flat file must have a name.")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Flat file must have a name.") != std::string::npos) + << e.toString(); } catch(...) { FAIL() << "Expected an IException with message: \"Flat file must have a name.\""; diff --git a/isis/tests/FunctionalTestsCamrange.cpp b/isis/tests/FunctionalTestsCamrange.cpp index 62d93f59d3..892416d95a 100644 --- a/isis/tests/FunctionalTestsCamrange.cpp +++ b/isis/tests/FunctionalTestsCamrange.cpp @@ -11,7 +11,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/camrange.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/camrange.xml").expanded()); TEST_F(DefaultCube, FunctionalTestCamrangeMeta) { QVector args = { "FROM=" + testCube->fileName() }; diff --git a/isis/tests/FunctionalTestsCamstats.cpp b/isis/tests/FunctionalTestsCamstats.cpp index e92852f9fb..8ffa93ed02 100644 --- a/isis/tests/FunctionalTestsCamstats.cpp +++ b/isis/tests/FunctionalTestsCamstats.cpp @@ -11,7 +11,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/camstats.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/camstats.xml").expanded()); TEST_F(DefaultCube, FunctionalTestCamstatsDefaultParameters) { QVector args = {}; diff --git a/isis/tests/FunctionalTestsChan1m32isis.cpp b/isis/tests/FunctionalTestsChan1m32isis.cpp index e2bfee3a17..ddcf4dc94a 100644 --- a/isis/tests/FunctionalTestsChan1m32isis.cpp +++ b/isis/tests/FunctionalTestsChan1m32isis.cpp @@ -13,7 +13,7 @@ using namespace Isis; using ::testing::HasSubstr; -static QString APP_XML = FileName("$ISISROOT/bin/xml/chan1m32isis.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/chan1m32isis.xml").expanded()); TEST(Chan1m32Isis, Chan1m32IsisTestFowardAscending) { QTemporaryDir prefix; @@ -33,9 +33,9 @@ TEST(Chan1m32Isis, Chan1m32IsisTestFowardAscending) { chan1m32isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest Chandrayaan image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest Chandrayaan image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group @@ -127,9 +127,9 @@ TEST(Chan1m32Isis, Chan1m32IsisTestFowardDescending) { chan1m32isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest Chandrayaan image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest Chandrayaan image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Instrument Group @@ -178,9 +178,9 @@ TEST(Chan1m32Isis, Chan1m32IsisTestReverseDescending) { chan1m32isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest Chandrayaan image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest Chandrayaan image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Instrument Group @@ -231,9 +231,9 @@ TEST(Chan1m32Isis, Chan1m32IsisTestReverseAscending) { chan1m32isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest Chandrayaan image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest Chandrayaan image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Instrument Group @@ -275,9 +275,9 @@ TEST(Chan1m32Isis, Chan1m32IsisTestLinerateNotConstant) { chan1m32isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest Chandrayaan image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest Chandrayaan image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Instrument Group @@ -315,9 +315,9 @@ TEST(Chan1m32Isis, Chan1m32IsisTestL0) { chan1m32isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest Chandrayaan image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest Chandrayaan image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group diff --git a/isis/tests/FunctionalTestsCiss2isis.cpp b/isis/tests/FunctionalTestsCiss2isis.cpp index 2590cf1540..2bb4a3a81f 100644 --- a/isis/tests/FunctionalTestsCiss2isis.cpp +++ b/isis/tests/FunctionalTestsCiss2isis.cpp @@ -10,7 +10,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/ciss2isis.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/ciss2isis.xml").expanded()); TEST(Ciss2Isis, Ciss2isisTestNac) { Pvl appLog; @@ -23,10 +23,10 @@ TEST(Ciss2Isis, Ciss2isisTestNac) { ciss2isis(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to ingest file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest file: " << e.toString().c_str() << std::endl; } - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup dimensions = outLabel->findGroup("Dimensions", Pvl::Traverse); @@ -132,10 +132,10 @@ TEST(Ciss2Isis, Ciss2isisTestWac) { ciss2isis(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to ingest file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest file: " << e.toString().c_str() << std::endl; } - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup dimensions = outLabel->findGroup("Dimensions", Pvl::Traverse); @@ -247,10 +247,10 @@ TEST(Ciss2Isis, Ciss2isisCustomMax) { ciss2isis(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to ingest file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest file: " << e.toString().c_str() << std::endl; } - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup dimensions = outLabel->findGroup("Dimensions", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsCkwriter.cpp b/isis/tests/FunctionalTestsCkwriter.cpp index b7a8bd5969..ff29651f74 100644 --- a/isis/tests/FunctionalTestsCkwriter.cpp +++ b/isis/tests/FunctionalTestsCkwriter.cpp @@ -15,7 +15,7 @@ using namespace Isis; using namespace testing; -static QString APP_XML = FileName("$ISISROOT/bin/xml/ckwriter.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/ckwriter.xml").expanded()); TEST_F(DefaultCube, FunctionalTestCkwriterDefault) { Pvl appLog; @@ -27,11 +27,11 @@ TEST_F(DefaultCube, FunctionalTestCkwriterDefault) { ckwriter(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to write kernel file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to write kernel file: " << e.toString().c_str() << std::endl; } Cube newKernelCube; - newKernelCube.fromLabel(tempDir.path() + "/newKernelCube.cub", label, "rw"); + newKernelCube.fromLabel(tempDir.path().toStdString() + "/newKernelCube.cub", label, "rw"); PvlGroup &kernels = newKernelCube.label()->findObject("IsisCube").findGroup("Kernels"); PvlKeyword targetPosition("TargetPosition"); @@ -55,7 +55,7 @@ TEST_F(DefaultCube, FunctionalTestCkwriterDefault) { try { newCamera = newKernelCube.camera(); } catch(IException &e) { - FAIL() << "Unable to generate camera with new ck kernel: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to generate camera with new ck kernel: " << e.toString().c_str() << std::endl; } SpiceRotation *newKernelRotation = newCamera->instrumentRotation(); @@ -83,10 +83,10 @@ TEST_F(DefaultCube, FunctionalTestCkwriterDefault) { TEST_F(DefaultCube, FunctionalTestCkwriterFromlist) { Pvl appLog; FileList cubeList; - cubeList.append(testCube->fileName()); + cubeList.append(testCube->fileName().toStdString()); QString cubeListFile = tempDir.path() + "/cubes.lis"; - cubeList.write(cubeListFile); + cubeList.write(cubeListFile.toStdString()); QVector args = {"fromlist=" + cubeListFile, "to=" + tempDir.path() + "/newKernel.bc"}; @@ -95,11 +95,11 @@ TEST_F(DefaultCube, FunctionalTestCkwriterFromlist) { ckwriter(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to write kernel file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to write kernel file: " << e.toString().c_str() << std::endl; } Cube newKernelCube; - newKernelCube.fromLabel(tempDir.path() + "/newKernelCube.cub", label, "rw"); + newKernelCube.fromLabel(tempDir.path().toStdString() + "/newKernelCube.cub", label, "rw"); PvlGroup &kernels = newKernelCube.label()->findObject("IsisCube").findGroup("Kernels"); PvlKeyword targetPosition("TargetPosition"); @@ -124,7 +124,7 @@ TEST_F(DefaultCube, FunctionalTestCkwriterFromlist) { try { newCamera = newKernelCube.camera(); } catch(IException &e) { - FAIL() << "Unable to generate camera with new ck kernel: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to generate camera with new ck kernel: " << e.toString().c_str() << std::endl; } SpiceRotation *newKernelRotation = newCamera->instrumentRotation(); @@ -175,7 +175,7 @@ TEST_F(ObservationPair, FunctionalTestCkwriterWarnValidate) { ckwriter(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to write kernel file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to write kernel file: " << e.toString().c_str() << std::endl; } EXPECT_TRUE(appLog.hasGroup("Overlaps")); @@ -199,7 +199,7 @@ TEST_F(DefaultCube, FunctionalTestCkwriterComSum) { ckwriter(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to write kernel file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to write kernel file: " << e.toString().c_str() << std::endl; } TextFile kernelFile(options.GetFileName("summary")); @@ -226,7 +226,7 @@ TEST(Ckwriter, FunctionalTestCkwriterOffsets) { ckwriter(options); } catch (IException &e) { - FAIL() << "Unable to write kernel file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to write kernel file: " << e.toString().c_str() << std::endl; } QString tmp = options.GetFileName("TO"); furnsh_c(tmp.toLatin1().data()); diff --git a/isis/tests/FunctionalTestsCnetbin2pvl.cpp b/isis/tests/FunctionalTestsCnetbin2pvl.cpp index 83a170022b..d244e9d4c2 100644 --- a/isis/tests/FunctionalTestsCnetbin2pvl.cpp +++ b/isis/tests/FunctionalTestsCnetbin2pvl.cpp @@ -10,7 +10,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/cnetbin2pvl.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/cnetbin2pvl.xml").expanded()); TEST_F(ThreeImageNetwork, FunctionalTestCnetbin2pvlDefault) { QString pvlOut = tempDir.path()+"/cnetbin2pvlNetwork.pvl"; diff --git a/isis/tests/FunctionalTestsCnetcheck.cpp b/isis/tests/FunctionalTestsCnetcheck.cpp index 17941d7207..74cc45e4d1 100644 --- a/isis/tests/FunctionalTestsCnetcheck.cpp +++ b/isis/tests/FunctionalTestsCnetcheck.cpp @@ -20,7 +20,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/cnetcheck.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/cnetcheck.xml").expanded()); TEST_F(ThreeImageNetwork, FunctionalTestCnetcheckCamera) { QVector args = {"fromlist="+cubeListFile, "prefix="+tempDir.path()+"/", "nocube=false", "lowcoverage=false"}; diff --git a/isis/tests/FunctionalTestsCnetcombinept.cpp b/isis/tests/FunctionalTestsCnetcombinept.cpp index 03b5b2aeb9..4b72c16e8b 100644 --- a/isis/tests/FunctionalTestsCnetcombinept.cpp +++ b/isis/tests/FunctionalTestsCnetcombinept.cpp @@ -24,7 +24,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/cnetcombinept.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/cnetcombinept.xml").expanded()); class CombineNetworks : public TempTestingFiles { protected: diff --git a/isis/tests/FunctionalTestsCnetdiff.cpp b/isis/tests/FunctionalTestsCnetdiff.cpp index a52d9d52fd..e424a742c6 100644 --- a/isis/tests/FunctionalTestsCnetdiff.cpp +++ b/isis/tests/FunctionalTestsCnetdiff.cpp @@ -18,7 +18,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/cnetdiff.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/cnetdiff.xml").expanded()); class CompareNetsReportFirstDiff : public TempTestingFiles { protected: @@ -589,7 +589,7 @@ TEST_F(CompareNetsReportFirstDiff, FunctionalTestCnetdiffReportFirst) { log = cnetdiff(ui1); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // read back CompareSame1 output file @@ -616,7 +616,7 @@ TEST_F(CompareNetsReportFirstDiff, FunctionalTestCnetdiffReportFirst) { log = cnetdiff(ui2); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // read back CompareSame2 output file @@ -643,7 +643,7 @@ TEST_F(CompareNetsReportFirstDiff, FunctionalTestCnetdiffReportFirst) { log = cnetdiff(ui3); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // read back CompareDifferent output file @@ -675,7 +675,7 @@ TEST_F(CompareNetsReportFirstDiff, FunctionalTestCnetdiffReportFirst) { log = cnetdiff(ui4); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // read back CompareDifferent2 output file @@ -739,7 +739,7 @@ TEST_F(CompareNetsReportFull, FunctionalTestCnetdiffReportFull) { log = cnetdiff(ui1); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // read back compareSame1 output file @@ -771,7 +771,7 @@ TEST_F(CompareNetsReportFull, FunctionalTestCnetdiffReportFull) { log = cnetdiff(ui2); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // read back compareSame2 output file @@ -803,7 +803,7 @@ TEST_F(CompareNetsReportFull, FunctionalTestCnetdiffReportFull) { log = cnetdiff(ui3); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // read back compareDifferent1 output file @@ -939,7 +939,7 @@ TEST_F(CompareNetsReportFull, FunctionalTestCnetdiffReportFull) { log = cnetdiff(ui4); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // read back compareDifferent2 output file diff --git a/isis/tests/FunctionalTestsCnetedit.cpp b/isis/tests/FunctionalTestsCnetedit.cpp index 6ea73549b4..d3eab78092 100644 --- a/isis/tests/FunctionalTestsCnetedit.cpp +++ b/isis/tests/FunctionalTestsCnetedit.cpp @@ -20,7 +20,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/cnetedit.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/cnetedit.xml").expanded()); class CneteditCheckValid : public TempTestingFiles { protected: @@ -47,9 +47,9 @@ class CneteditCheckValid : public TempTestingFiles { Cube cube1; Cube cube2; - cube1.fromLabel(tempDir.path() + "/PSP_002733_1880_RED4.crop.cub", + cube1.fromLabel(tempDir.path().toStdString() + "/PSP_002733_1880_RED4.crop.cub", label1, "rw"); - cube2.fromLabel(tempDir.path() + "/PSP_002733_1880_RED5.crop.cub", + cube2.fromLabel(tempDir.path().toStdString() + "/PSP_002733_1880_RED5.crop.cub", label2, "rw"); LineManager line(cube1); @@ -72,9 +72,9 @@ class CneteditCheckValid : public TempTestingFiles { // set up cube list for checkValid tests FileList chkValidCubeList; - chkValidCubeList.append(cube1.fileName()); - chkValidCubeList.append(cube2.fileName()); - chkValidCubeList.write(chkValidCubeListFile); + chkValidCubeList.append(cube1.fileName().toStdString()); + chkValidCubeList.append(cube2.fileName().toStdString()); + chkValidCubeList.write(chkValidCubeListFile.toStdString()); // set up pvl def file PvlGroup validMeasureGroup("ValidMeasure"); @@ -123,11 +123,11 @@ class CneteditMeasureList : public TempTestingFiles { badMeasureList1.append("I24827003RDR_bndry_53,data/cnetedit/I24827003RDR.dstr.cub.label.pvl"); badMeasureList1.append("I24827003RDR_bndry_56,data/cnetedit/I24827003RDR.dstr.cub.label.pvl"); badMeasureList1.append("I24827003RDR_bndry_8,data/cnetedit/I07873009RDR.dstr.cub.label.pvl"); - badMeasureList1.write(badMeasureListFile1); + badMeasureList1.write(badMeasureListFile1.toStdString()); FileList badMeasureList2(badMeasureList1); badMeasureList2.append("I24827003RDR_bndry_11,data/cnetedit/I24827003RDR.dstr.cub.label.pvl"); - badMeasureList2.write(badMeasureListFile2); + badMeasureList2.write(badMeasureListFile2.toStdString()); } }; @@ -150,12 +150,12 @@ class Cnetedit : public TempTestingFiles { // set up cube list FileList cubeList; cubeList.append("data/cnetedit/e0902065.cal.sub.cub"); - cubeList.write(cubeListFile); + cubeList.write(cubeListFile.toStdString()); // set up measureList FileList measureList; measureList.append("new0001,data/cnetedit/e0902065.cal.sub.cub"); - measureList.write(measureListFile); + measureList.write(measureListFile.toStdString()); // set up point list FileList pointList; @@ -165,7 +165,7 @@ class Cnetedit : public TempTestingFiles { pointList.append("new0036"); pointList.append("new0020"); pointList.append("new0008"); - pointList.write(pointListFile); + pointList.write(pointListFile.toStdString()); } }; @@ -206,7 +206,7 @@ TEST_F(CneteditCheckValid, FunctionalTestCneteditCheckValid) { cneteditLog = cnetedit(ui); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // read back log file @@ -329,7 +329,7 @@ TEST_F(CneteditCheckValid, FunctionalTestCneteditCheckValidIgnoreAll) { cneteditLog = cnetedit(ui); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // read back log file @@ -464,7 +464,7 @@ TEST_F(Cnetedit, FunctionalTestCneteditDefault) { cneteditLog = cnetedit(ui); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // read back log file @@ -628,7 +628,7 @@ TEST_F(Cnetedit, FunctionalTestCneteditEditlock) { cneteditLog = cnetedit(ui); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // read back log file @@ -748,7 +748,7 @@ TEST_F(Cnetedit, FunctionalTestCneteditEditUnlock) { cneteditLog = cnetedit(ui); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // read back log file @@ -851,8 +851,8 @@ TEST_F(Cnetedit, FunctionalTestCneteditError) { FAIL() << "Expected Exception for an invalid control network"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Invalid control network")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Invalid control network")) + << e.toString(); } } @@ -894,7 +894,7 @@ TEST_F(Cnetedit, CneteditIgnore) { cneteditlog = cnetedit(ui); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // read back log file @@ -1219,7 +1219,7 @@ TEST_F(Cnetedit, CneteditIgnoreMeasuresPoints) { cneteditlog = cnetedit(ui); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // read back log file @@ -1567,7 +1567,7 @@ TEST_F(Cnetedit, CneteditIgnorePoints) { cneteditlog = cnetedit(ui); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // read back log file @@ -1779,7 +1779,7 @@ TEST_F(Cnetedit, CneteditIgnoreAllPoints) { cneteditlog = cnetedit(ui); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // read back log file @@ -2033,7 +2033,7 @@ TEST_F(Cnetedit, CneteditNoDelete) { cneteditlog = cnetedit(ui); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // read back log file @@ -2297,7 +2297,7 @@ TEST_F(Cnetedit, CneteditPreservePoints) { cneteditlog = cnetedit(ui); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // read back log file @@ -2624,7 +2624,7 @@ TEST_F(CneteditMeasureList, CneteditMeasureListGeneral) { cneteditlog = cnetedit(ui); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // read back log file @@ -2732,7 +2732,7 @@ TEST_F(CneteditMeasureList, CneteditMeasureListIgnoreAll) { cneteditlog = cnetedit(ui); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // read back log file @@ -2838,7 +2838,7 @@ TEST_F(CneteditMeasureList, CneteditMeasureListDelete) { cneteditlog = cnetedit(ui); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // read back log file diff --git a/isis/tests/FunctionalTestsCnetextract.cpp b/isis/tests/FunctionalTestsCnetextract.cpp index 350a9fa398..8b0d8f1b9b 100644 --- a/isis/tests/FunctionalTestsCnetextract.cpp +++ b/isis/tests/FunctionalTestsCnetextract.cpp @@ -13,7 +13,7 @@ using namespace Isis; using testing::HasSubstr; -static QString APP_XML = FileName("$ISISROOT/bin/xml/cnetextract.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/cnetextract.xml").expanded()); TEST_F(ThreeImageNetwork, FunctionalTestCnetextractExclusiveNoFromlist) { QVector args = {"prefix=" + tempDir.path() + "/", @@ -90,7 +90,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetextractExclusiveNoIgnore) { ASSERT_EQ(network->GetNumPoints() - outputNet.GetNumPoints(), 1); ASSERT_EQ(network->GetNumMeasures() - outputNet.GetNumMeasures(), 2); - FileName ignoredPointsFile(options.GetAsString("prefix") + "IgnoredPoints.txt"); + FileName ignoredPointsFile(options.GetAsString("prefix").toStdString() + "IgnoredPoints.txt"); EXPECT_TRUE(ignoredPointsFile.fileExists()); } @@ -120,7 +120,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetextractExclusiveNoSingleMeasure) { ASSERT_EQ(network->GetNumPoints() - outputNet.GetNumPoints(), 1); ASSERT_EQ(network->GetNumMeasures() - outputNet.GetNumMeasures(), 1); - FileName measurePointsFile(options.GetAsString("prefix") + "SingleMeasurePoints.txt"); + FileName measurePointsFile(options.GetAsString("prefix").toStdString() + "SingleMeasurePoints.txt"); EXPECT_TRUE(measurePointsFile.fileExists()); } @@ -149,7 +149,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetextractExclusiveNoMeasureless) { ASSERT_EQ(network->GetNumPoints() - outputNet.GetNumPoints(), 1); ASSERT_EQ(network->GetNumMeasures() - outputNet.GetNumMeasures(), 0); - FileName measurelessPointsFile(options.GetAsString("prefix") + "MeasurelessPoints.txt"); + FileName measurelessPointsFile(options.GetAsString("prefix").toStdString() + "MeasurelessPoints.txt"); EXPECT_TRUE(measurelessPointsFile.fileExists()); } @@ -171,7 +171,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetextractInclusiveReference) { ASSERT_EQ(network->GetNumPoints() - outputNet.GetNumPoints(), 0); ASSERT_EQ(network->GetNumMeasures() - outputNet.GetNumMeasures(), 25); - FileName referencePointsFile(options.GetAsString("prefix") + "NonReferenceMeasures.txt"); + FileName referencePointsFile(options.GetAsString("prefix").toStdString() + "NonReferenceMeasures.txt"); EXPECT_TRUE(referencePointsFile.fileExists()); } @@ -199,7 +199,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetextractInclusiveFixed) { ASSERT_EQ(network->GetNumPoints() - outputNet.GetNumPoints(), 13); ASSERT_EQ(network->GetNumMeasures() - outputNet.GetNumMeasures(), 35); - FileName fixedPointsFile(options.GetAsString("prefix") + "NonFixedPoints.txt"); + FileName fixedPointsFile(options.GetAsString("prefix").toStdString() + "NonFixedPoints.txt"); EXPECT_TRUE(fixedPointsFile.fileExists()); } @@ -274,7 +274,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetextractInclusivePixeltolerence) { ASSERT_EQ(network->GetNumPoints() - outputNet.GetNumPoints(), 9); ASSERT_EQ(network->GetNumMeasures() - outputNet.GetNumMeasures(), 23); - FileName tolerancePointsFile(options.GetAsString("prefix") + "TolerancePoints.txt"); + FileName tolerancePointsFile(options.GetAsString("prefix").toStdString() + "TolerancePoints.txt"); EXPECT_TRUE(tolerancePointsFile.fileExists()); } @@ -292,7 +292,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetextractInclusivePointlist) { pointList.append("test0003"); pointList.append("test0004"); pointList.append("test0005"); - pointList.write(pointListFile); + pointList.write(pointListFile.toStdString()); UserInterface options(APP_XML, args); Pvl appLog; @@ -306,7 +306,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetextractInclusivePointlist) { ASSERT_EQ(network->GetNumPoints() - outputNet.GetNumPoints(), 11); ASSERT_EQ(network->GetNumMeasures() - outputNet.GetNumMeasures(), 30); - FileName nonListedPointsFile(options.GetAsString("prefix") + "NonListedPoints.txt"); + FileName nonListedPointsFile(options.GetAsString("prefix").toStdString() + "NonListedPoints.txt"); EXPECT_TRUE(nonListedPointsFile.fileExists()); } @@ -314,7 +314,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetextractCubeCubelist) { QString reducedCubeList = tempDir.path() + "/reducedCubes.lis"; cubeList->pop_back(); cubeList->pop_back(); - cubeList->write(reducedCubeList); + cubeList->write(reducedCubeList.toStdString()); QVector args = {"fromlist=" + cubeListFile, "prefix=" + tempDir.path() + "/", @@ -335,7 +335,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetextractCubeCubelist) { ASSERT_EQ(network->GetNumPoints() - outputNet.GetNumPoints(), 3); ASSERT_EQ(network->GetNumMeasures() - outputNet.GetNumMeasures(), 6); - FileName nonCubePointsFile(options.GetAsString("prefix") + "NonCubePoints.txt"); + FileName nonCubePointsFile(options.GetAsString("prefix").toStdString() + "NonCubePoints.txt"); EXPECT_TRUE(nonCubePointsFile.fileExists()); } @@ -343,7 +343,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetextractCubeCubemeasures) { QString reducedCubeList = tempDir.path() + "/reducedCubes.lis"; cubeList->pop_back(); cubeList->pop_back(); - cubeList->write(reducedCubeList); + cubeList->write(reducedCubeList.toStdString()); QVector args = {"fromlist=" + cubeListFile, "prefix=" + tempDir.path() + "/", @@ -366,10 +366,10 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetextractCubeCubemeasures) { ASSERT_EQ(network->GetNumPoints() - outputNet.GetNumPoints(), 3); ASSERT_EQ(network->GetNumMeasures() - outputNet.GetNumMeasures(), 28); - FileName nonCubePointsFile(options.GetAsString("prefix") + "NonCubePoints.txt"); + FileName nonCubePointsFile(options.GetAsString("prefix").toStdString() + "NonCubePoints.txt"); EXPECT_TRUE(nonCubePointsFile.fileExists()); - FileName nonCubeMeasuresFile(options.GetAsString("prefix") + "NonCubeMeasures.txt"); + FileName nonCubeMeasuresFile(options.GetAsString("prefix").toStdString() + "NonCubeMeasures.txt"); EXPECT_TRUE(nonCubeMeasuresFile.fileExists()); } @@ -377,7 +377,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetextractCubeRetainreference) { QString reducedCubeList = tempDir.path() + "/reducedCubes.lis"; cubeList->pop_back(); cubeList->pop_back(); - cubeList->write(reducedCubeList); + cubeList->write(reducedCubeList.toStdString()); QVector args = {"fromlist=" + cubeListFile, "prefix=" + tempDir.path() + "/", @@ -405,10 +405,10 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetextractCubeRetainreference) { ASSERT_EQ(network->GetNumPoints() - outputNet.GetNumPoints(), 3); ASSERT_EQ(network->GetNumMeasures() - outputNet.GetNumMeasures(), 27); - FileName nonCubePointsFile(options.GetAsString("prefix") + "NonCubePoints.txt"); + FileName nonCubePointsFile(options.GetAsString("prefix").toStdString() + "NonCubePoints.txt"); EXPECT_TRUE(nonCubePointsFile.fileExists()); - FileName nonCubeMeasuresFile(options.GetAsString("prefix") + "NonCubeMeasures.txt"); + FileName nonCubeMeasuresFile(options.GetAsString("prefix").toStdString() + "NonCubeMeasures.txt"); EXPECT_TRUE(nonCubeMeasuresFile.fileExists()); } @@ -434,9 +434,9 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetextractLatlon) { ASSERT_EQ(network->GetNumPoints() - outputNet.GetNumPoints(), 10); ASSERT_EQ(network->GetNumMeasures() - outputNet.GetNumMeasures(), 25); - FileName outOfRangeFile(options.GetAsString("prefix") + "LatLonOutOfRange.txt"); + FileName outOfRangeFile(options.GetAsString("prefix").toStdString() + "LatLonOutOfRange.txt"); EXPECT_TRUE(outOfRangeFile.fileExists()); - FileName noLatLonPointsFile(options.GetAsString("prefix") + "NoLatLonPoints.txt"); + FileName noLatLonPointsFile(options.GetAsString("prefix").toStdString() + "NoLatLonPoints.txt"); EXPECT_FALSE(noLatLonPointsFile.fileExists()); } diff --git a/isis/tests/FunctionalTestsCnetpvl2bin.cpp b/isis/tests/FunctionalTestsCnetpvl2bin.cpp index 22919a7ef4..1efe43c834 100644 --- a/isis/tests/FunctionalTestsCnetpvl2bin.cpp +++ b/isis/tests/FunctionalTestsCnetpvl2bin.cpp @@ -9,7 +9,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/cnetpvl2bin.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/cnetpvl2bin.xml").expanded()); TEST_F(ThreeImageNetwork, FunctionalTestCnetpvl2binDefault) { QString binOut = tempDir.path()+"/cnetbin2Network.net"; diff --git a/isis/tests/FunctionalTestsCnetstats.cpp b/isis/tests/FunctionalTestsCnetstats.cpp index f0ee413c08..a3ddf24543 100644 --- a/isis/tests/FunctionalTestsCnetstats.cpp +++ b/isis/tests/FunctionalTestsCnetstats.cpp @@ -12,7 +12,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/cnetstats.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/cnetstats.xml").expanded()); TEST_F(ThreeImageNetwork, FunctionalTestCnetstatsDefault) { QVector args = {}; @@ -218,7 +218,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetstatsInvalidDefFile) { Pvl log; QString serialNumList = tempDir.path() + "/cubes.lis"; - std::string message = "Invalid Deffile"; + QString message = "Invalid Deffile"; try { cnetstats(*network, serialNumList, options, &log); FAIL() << "Expected an exception to be thrown"; diff --git a/isis/tests/FunctionalTestsCnetthinner.cpp b/isis/tests/FunctionalTestsCnetthinner.cpp index c5fd631a32..2823fde61c 100644 --- a/isis/tests/FunctionalTestsCnetthinner.cpp +++ b/isis/tests/FunctionalTestsCnetthinner.cpp @@ -12,9 +12,9 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/cnetthinner.xml").expanded(); -static QString APP1_XML = FileName("$ISISROOT/bin/xml/cnetdiff.xml").expanded(); -static QString APP2_XML = FileName("$ISISROOT/bin/xml/cnetedit.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/cnetthinner.xml").expanded()); +static QString APP1_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/cnetdiff.xml").expanded()); +static QString APP2_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/cnetedit.xml").expanded()); class Cnetthinner : public TempTestingFiles { protected: @@ -50,8 +50,8 @@ TEST_F(Cnetthinner, FunctionalTestCnetthinnerEmptyControlNet) { FAIL() << "Expected Exception for invalid, empty control network file"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Invalid control network")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Invalid control network") != std::string::npos) + << e.toString(); } } @@ -84,7 +84,7 @@ TEST_F(Cnetthinner, FunctionalTestCnetthinnerDefault) { cnetthinner(ui); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // check output ControlNetwork @@ -151,7 +151,7 @@ TEST_F(Cnetthinner, FunctionalTestCnetthinnerIgnoreOrRemove) { cnetthinner(ui1); } catch(IException &e) { - FAIL() << "cnetthinner ignore failure: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "cnetthinner ignore failure: " << e.toString().c_str() << std::endl; } // Use cnetthinner to suppress points by removing in customPointsTruth.net. @@ -167,7 +167,7 @@ TEST_F(Cnetthinner, FunctionalTestCnetthinnerIgnoreOrRemove) { cnetthinner(ui2); } catch(IException &e) { - FAIL() << "cnetthinner remove failure: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "cnetthinner remove failure: " << e.toString().c_str() << std::endl; } // confirm 64 points are ignored in both runs @@ -192,7 +192,7 @@ TEST_F(Cnetthinner, FunctionalTestCnetthinnerIgnoreOrRemove) { cnetedit(ui3); } catch(IException &e) { - FAIL() << "cnetedit failure to delete removed points: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "cnetedit failure to delete removed points: " << e.toString().c_str() << std::endl; } // Use cnetdiff to compare ignored_removed.net and removed.net. @@ -209,7 +209,7 @@ TEST_F(Cnetthinner, FunctionalTestCnetthinnerIgnoreOrRemove) { cnetdiff(ui4); } catch(IException &e) { - FAIL() << "cnetdiff failure to compare networks: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "cnetdiff failure to compare networks: " << e.toString().c_str() << std::endl; } // read back compareIgnored_IgnoredRemoved log file @@ -259,7 +259,7 @@ TEST_F(Cnetthinner, FunctionalTestCnetthinnerMinMaxPoints) { cnetthinner(ui1); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } ControlNet outNet50(tempDir.path()+ "/50.net"); @@ -275,7 +275,7 @@ TEST_F(Cnetthinner, FunctionalTestCnetthinnerMinMaxPoints) { cnetthinner(ui2); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } ControlNet outNet200(tempDir.path()+ "/200.net"); @@ -291,7 +291,7 @@ TEST_F(Cnetthinner, FunctionalTestCnetthinnerMinMaxPoints) { cnetthinner(ui3); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } ControlNet outNet400(tempDir.path()+"/400.net"); @@ -330,7 +330,7 @@ TEST_F(Cnetthinner, FunctionalTestCnetthinnerTolerance) { cnetthinner(ui1); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } ControlNet smallTol(tempDir.path()+"/tolSmall.net"); @@ -347,7 +347,7 @@ TEST_F(Cnetthinner, FunctionalTestCnetthinnerTolerance) { cnetthinner(ui2); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } ControlNet mediumTol(tempDir.path()+"/tolMedium.net"); @@ -364,7 +364,7 @@ TEST_F(Cnetthinner, FunctionalTestCnetthinnerTolerance) { cnetthinner(ui3); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } ControlNet largeTol(tempDir.path()+"/tolLarge.net"); @@ -403,7 +403,7 @@ TEST_F(Cnetthinner, FunctionalTestCnetthinnerWeight) { cnetthinner(ui1); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } ControlNet smallWeight(tempDir.path()+"/Small.net"); @@ -420,7 +420,7 @@ TEST_F(Cnetthinner, FunctionalTestCnetthinnerWeight) { cnetthinner(ui2); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } ControlNet mediumWeight(tempDir.path()+"/Medium.net"); @@ -437,7 +437,7 @@ TEST_F(Cnetthinner, FunctionalTestCnetthinnerWeight) { cnetthinner(ui3); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } ControlNet largeWeight(tempDir.path() + "/Large.net"); @@ -454,7 +454,7 @@ TEST_F(Cnetthinner, FunctionalTestCnetthinnerWeight) { cnetthinner(ui4); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } ControlNet xLargeWeight(tempDir.path() + "/XLarge.net"); diff --git a/isis/tests/FunctionalTestsCrism2isis.cpp b/isis/tests/FunctionalTestsCrism2isis.cpp index 438caf2c1c..ee6d8d73bb 100644 --- a/isis/tests/FunctionalTestsCrism2isis.cpp +++ b/isis/tests/FunctionalTestsCrism2isis.cpp @@ -14,7 +14,7 @@ using namespace Isis; using ::testing::HasSubstr; -static QString APP_XML = FileName("$ISISROOT/bin/xml/crism2isis.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/crism2isis.xml").expanded()); TEST(Crism2isis, Crism2IsisTestDdr) { QTemporaryDir prefix; @@ -28,9 +28,9 @@ TEST(Crism2isis, Crism2IsisTestDdr) { crism2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest CRISM image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest CRISM image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group @@ -97,9 +97,9 @@ TEST(Crism2isis, Crism2IsisTestMrdr) { crism2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest CRISM image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest CRISM image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group @@ -156,9 +156,9 @@ TEST(Crism2isis, Crism2IsisTestTrdr) { crism2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest CRISM image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest CRISM image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group @@ -195,9 +195,9 @@ TEST(Crism2isis, Crism2IsisTestMrral) { crism2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest CRISM image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest CRISM image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group diff --git a/isis/tests/FunctionalTestsCrop.cpp b/isis/tests/FunctionalTestsCrop.cpp index 719df2d4d9..74842ded17 100644 --- a/isis/tests/FunctionalTestsCrop.cpp +++ b/isis/tests/FunctionalTestsCrop.cpp @@ -13,7 +13,7 @@ using namespace Isis; using ::testing::HasSubstr; -static QString APP_XML = FileName("$ISISROOT/bin/xml/crop.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/crop.xml").expanded()); TEST_F(LargeCube, FunctionalTestCropDefault) { QTemporaryDir tempDir; @@ -29,7 +29,7 @@ TEST_F(LargeCube, FunctionalTestCropDefault) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); Histogram *oCubeStats = oCube.histogram(); @@ -53,7 +53,7 @@ TEST_F(LargeCube, FunctionalTestCropSkip1) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); Histogram *oCubeStats = oCube.histogram(); @@ -77,7 +77,7 @@ TEST_F(LargeCube, FunctionalTestCropSkip2) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); Histogram *oCubeStats = oCube.histogram(); @@ -101,7 +101,7 @@ TEST_F(LargeCube, FunctionalTestCropSkip5) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); Histogram *oCubeStats = oCube.histogram(); @@ -127,7 +127,7 @@ TEST_F(DefaultCube, FunctionalTestCropNoSpice) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); Histogram *oCubeStats = oCube.histogram(); @@ -153,7 +153,7 @@ TEST_F(DefaultCube, FunctionalTestCropProj) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); Histogram *oCubeStats = oCube.histogram(); diff --git a/isis/tests/FunctionalTestsCsminit.cpp b/isis/tests/FunctionalTestsCsminit.cpp index d4a5b405a3..daf160e255 100644 --- a/isis/tests/FunctionalTestsCsminit.cpp +++ b/isis/tests/FunctionalTestsCsminit.cpp @@ -20,7 +20,7 @@ using json = nlohmann::json; using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/csminit.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/csminit.xml").expanded()); class CSMPluginFixture : public TempTestingFiles { protected: @@ -65,7 +65,7 @@ class CSMPluginFixture : public TempTestingFiles { cubeLabel >> label; testCube = new Cube(); filename = tempDir.path() + "/csminitCube.cub"; - testCube->fromLabel(filename, label, "rw"); + testCube->fromLabel(filename.toStdString(), label, "rw"); testCube->close(); plugin = csm::Plugin::findPlugin(TestCsmPlugin::PLUGIN_NAME); @@ -322,7 +322,7 @@ TEST_F(DefaultCube, CSMInitSpiceCleanup) { testCube->close(); csminit(options); - Cube outputCube(cubeFile); + Cube outputCube(cubeFile.toStdString()); EXPECT_FALSE(outputCube.hasTable("InstrumentPointing")); EXPECT_FALSE(outputCube.hasTable("InstrumentPosition")); @@ -362,7 +362,7 @@ TEST_F(DefaultCube, CSMInitSpiceRestoredAfterFailure) { ASSERT_ANY_THROW(csminit(options)); - Cube outputCube(cubeFile); + Cube outputCube(cubeFile.toStdString()); ASSERT_NO_THROW(outputCube.camera()); EXPECT_TRUE(outputCube.hasTable("InstrumentPointing")); @@ -399,7 +399,7 @@ TEST_F(DefaultCube, CSMInitSpiceNoCleanup) { testCube->close(); // Expect a failure due to being unable to construct any model from the isd EXPECT_ANY_THROW(csminit(options)); - Cube outputCube(cubeFile); + Cube outputCube(cubeFile.toStdString()); // The cube should still be intact and we should still be able to get a camera EXPECT_NO_THROW(outputCube.camera()); diff --git a/isis/tests/FunctionalTestsCtxcal.cpp b/isis/tests/FunctionalTestsCtxcal.cpp index 80aca499c6..a168ee76e6 100644 --- a/isis/tests/FunctionalTestsCtxcal.cpp +++ b/isis/tests/FunctionalTestsCtxcal.cpp @@ -10,7 +10,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/ctxcal.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/ctxcal.xml").expanded()); TEST_F(MroCtxCube, FunctionalTestCtxcalDefault) { @@ -26,7 +26,7 @@ TEST_F(MroCtxCube, FunctionalTestCtxcalDefault) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); PvlGroup radGroup = oCube.label()->findObject("IsisCube").findGroup("Radiometry"); EXPECT_DOUBLE_EQ((double)radGroup.findKeyword("iof"), 1.86764430855461e-04); @@ -53,7 +53,7 @@ TEST_F(MroCtxCube, FunctionalTestCtxcalFlatfile) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); Histogram *oCubeStats = oCube.histogram(); @@ -76,7 +76,7 @@ TEST_F(MroCtxCube, FunctionalTestCtxcalMonthlyFlatfile) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); Histogram *oCubeStats = oCube.histogram(); @@ -100,7 +100,7 @@ TEST_F(MroCtxCube, FunctionalTestCtxcalIofFalse) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); PvlGroup radGroup = oCube.label()->findObject("IsisCube").findGroup("Radiometry"); EXPECT_DOUBLE_EQ((double)radGroup.findKeyword("iof"), 1); @@ -141,8 +141,8 @@ TEST_F(MroCtxCube, FunctionalTestCtxcalCameraComparison) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube oNoCamCube(outCubeFileNameCam, "r"); - Cube oCamCube(outCubeFileNameCam, "r"); + Cube oNoCamCube(outCubeFileNameCam.toStdString(), "r"); + Cube oCamCube(outCubeFileNameCam.toStdString(), "r"); Pvl *noCamLab = oNoCamCube.label(); Pvl *camLab = oCamCube.label(); diff --git a/isis/tests/FunctionalTestsCubeatt.cpp b/isis/tests/FunctionalTestsCubeatt.cpp index 8994e600b3..6c789f6d05 100644 --- a/isis/tests/FunctionalTestsCubeatt.cpp +++ b/isis/tests/FunctionalTestsCubeatt.cpp @@ -10,7 +10,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/cubeatt.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/cubeatt.xml").expanded()); // Tests setting output attributes: bit type and range TEST_F(SmallCube, FunctionalTestCubeattBitttypeAndRange) { @@ -20,7 +20,7 @@ TEST_F(SmallCube, FunctionalTestCubeattBitttypeAndRange) { UserInterface options(APP_XML, args); cubeatt(options); - Cube outputCube(cubePath); + Cube outputCube(cubePath.toStdString()); // Check attributes: pixel type, storage format, label format, storage order, pixel range, bands EXPECT_EQ(outputCube.pixelType(), PixelType::UnsignedByte); @@ -41,7 +41,7 @@ TEST_F(SmallCube, FunctionalTestCubeattNoChange) { UserInterface options(APP_XML, args); cubeatt(options); - Cube outputCube(cubePath); + Cube outputCube(cubePath.toStdString()); // Check attributes: pixel type, storage format, label format, storage order, pixel range, bands EXPECT_EQ(outputCube.pixelType(), PixelType::Real); @@ -67,7 +67,7 @@ TEST_F(SmallCube, FunctionalTestCubeattVirtualBands) { QVector args = {"from=" + testCube->fileName() + "+3,2,4,2,1,5,7,6,4", "to=" + cubePath}; UserInterface options(APP_XML, args); cubeatt(options); - Cube outputCube(cubePath); + Cube outputCube(cubePath.toStdString()); EXPECT_EQ(outputCube.bandCount(), 9); // Do need to check the label for this one, since outputCube.physicalBand() will not work @@ -105,7 +105,7 @@ TEST_F(SmallCube, FunctionalTestCubeattInputCube) { UserInterface options(APP_XML, args); cubeatt(testCube, options); - Cube outputCube(outputCubePath); + Cube outputCube(outputCubePath.toStdString()); EXPECT_EQ(outputCube.pixelType(), PixelType::UnsignedByte); // Setting the pixel range modifies the base/multiplier, so check those. @@ -125,7 +125,7 @@ TEST_F(SmallCube, FunctionalTestCubeattInputCubeOutputPath) { CubeAttributeOutput attributeOutput("+8bit+0.0:1.0"); cubeatt(testCube, outputCubePath, attributeOutput); - Cube outputCube(outputCubePath); + Cube outputCube(outputCubePath.toStdString()); // Setting the pixel range modifies the base/multiplier, so check those. EXPECT_NE(outputCube.base(), 0); @@ -146,7 +146,7 @@ TEST_F(SmallCube, FunctionalTestCubeattInputAndOutputAttributes) { cubeatt(inputCubePath, attributeInput, outputCubePath, attributeOutput); - Cube outputCube(outputCubePath); + Cube outputCube(outputCubePath.toStdString()); Statistics *outputStats = outputCube.statistics(); EXPECT_GE(outputStats->Minimum(), 200); diff --git a/isis/tests/FunctionalTestsDemprep.cpp b/isis/tests/FunctionalTestsDemprep.cpp index e03f044502..134b543ca6 100644 --- a/isis/tests/FunctionalTestsDemprep.cpp +++ b/isis/tests/FunctionalTestsDemprep.cpp @@ -16,7 +16,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/demprep.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/demprep.xml").expanded()); TEST(Demprep, DemprepDefault){ Pvl appLog; @@ -29,10 +29,10 @@ TEST(Demprep, DemprepDefault){ demprep(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to prep DEM: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to prep DEM: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); ASSERT_EQ(cube.sampleCount(), 439); @@ -100,10 +100,10 @@ TEST(Demprep, DemprepInside){ demprep(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to prep DEM: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to prep DEM: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); ASSERT_EQ(cube.sampleCount(), 250); ASSERT_EQ(cube.lineCount(), 250); @@ -131,10 +131,10 @@ TEST(Demprep, DemprepSpecialPixels){ demprep(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to prep DEM: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to prep DEM: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); ASSERT_EQ(cube.sampleCount(), 366); ASSERT_EQ(cube.lineCount(), 184); @@ -174,10 +174,10 @@ TEST(Demprep, DemprepSouthPole){ demprep(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to prep DEM: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to prep DEM: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); ASSERT_EQ(cube.sampleCount(), 250); ASSERT_EQ(cube.lineCount(), 251); ASSERT_EQ(cube.bandCount(), 1); @@ -204,10 +204,10 @@ TEST(Demprep, DemprepNorthPole){ demprep(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to prep DEM: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to prep DEM: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); ASSERT_EQ(cube.sampleCount(), 250); ASSERT_EQ(cube.lineCount(), 251); ASSERT_EQ(cube.bandCount(), 1); diff --git a/isis/tests/FunctionalTestsEis2isis.cpp b/isis/tests/FunctionalTestsEis2isis.cpp index 35190f11db..2e7783edfd 100644 --- a/isis/tests/FunctionalTestsEis2isis.cpp +++ b/isis/tests/FunctionalTestsEis2isis.cpp @@ -13,7 +13,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/eis2isis.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/eis2isis.xml").expanded()); TEST(Eis2Isis, Eis2IsisTestNacDefault) { /* @@ -36,10 +36,10 @@ TEST(Eis2Isis, Eis2IsisTestNacDefault) { eis2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group @@ -101,10 +101,10 @@ TEST(Eis2Isis, Eis2IsisTestNacCheckline) eis2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group @@ -169,7 +169,7 @@ TEST(Eis2Isis, Eis2IsisTestNacChecklineError) FAIL(); } catch (IException &e) { - ASSERT_TRUE(e.toString().contains("as the [CHECKLINEREADOUT] parameter")); + ASSERT_TRUE(e.toString().find("as the [CHECKLINEREADOUT] parameter") != std::string::npos); } } @@ -194,10 +194,10 @@ TEST(Eis2Isis, Eis2IsisTestWacDefault) { eis2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group diff --git a/isis/tests/FunctionalTestsEnlarge.cpp b/isis/tests/FunctionalTestsEnlarge.cpp index 8caac69b7e..e6c2430d7b 100644 --- a/isis/tests/FunctionalTestsEnlarge.cpp +++ b/isis/tests/FunctionalTestsEnlarge.cpp @@ -12,7 +12,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/enlarge.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/enlarge.xml").expanded()); TEST_F(SmallCube, FunctionalTestEnlargeDefaultParameters) { QVector args = {"to=" + tempDir.path()+"/output.cub"}; @@ -67,7 +67,7 @@ TEST_F(SmallCube, FunctionalTestEnlargeSmallDimensions) { UserInterface options(APP_XML, args); Pvl appLog; - std::string message = "Number of output samples/lines must be greater than or equal"; + QString message = "Number of output samples/lines must be greater than or equal"; try { enlarge(testCube, options, &appLog); FAIL() << "Expected an exception to be thrown"; diff --git a/isis/tests/FunctionalTestsFillGap.cpp b/isis/tests/FunctionalTestsFillGap.cpp index 60402caf41..8e5f726677 100644 --- a/isis/tests/FunctionalTestsFillGap.cpp +++ b/isis/tests/FunctionalTestsFillGap.cpp @@ -13,7 +13,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/fillgap.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/fillgap.xml").expanded()); // First 9 test cases are checking for EXPECTed output depending on @@ -32,10 +32,10 @@ TEST_F( SmallGapCube, FillGapTestBandAkima ) fillgap(options, &log); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *label = outCube.label(); PvlGroup &dims = label->findGroup("Dimensions", Pvl::Traverse); @@ -71,10 +71,10 @@ TEST_F( SmallGapCube, FillGapTestBandCubic ) fillgap(options, &log); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *label = outCube.label(); PvlGroup &dims = label->findGroup("Dimensions", Pvl::Traverse); @@ -110,10 +110,10 @@ TEST_F( SmallGapCube, FillGapTestBandLinear ) fillgap(options, &log); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *label = outCube.label(); PvlGroup &dims = label->findGroup("Dimensions", Pvl::Traverse); @@ -149,10 +149,10 @@ TEST_F( SmallGapCube, FillGapTestHorzAkima ) fillgap(options, &log); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *label = outCube.label(); PvlGroup &dims = label->findGroup("Dimensions", Pvl::Traverse); @@ -188,10 +188,10 @@ TEST_F( SmallGapCube, FillGapTestHorzCubic ) fillgap(options, &log); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *label = outCube.label(); PvlGroup &dims = label->findGroup("Dimensions", Pvl::Traverse); @@ -227,10 +227,10 @@ TEST_F( SmallGapCube, FillGapTestHorzLinear ) fillgap(options, &log); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *label = outCube.label(); PvlGroup &dims = label->findGroup("Dimensions", Pvl::Traverse); @@ -266,10 +266,10 @@ TEST_F( SmallGapCube, FillGapTestVertAkima ) fillgap(options, &log); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *label = outCube.label(); PvlGroup &dims = label->findGroup("Dimensions", Pvl::Traverse); @@ -305,10 +305,10 @@ TEST_F( SmallGapCube, FillGapTestVertCubic ) fillgap(options, &log); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *label = outCube.label(); PvlGroup &dims = label->findGroup("Dimensions", Pvl::Traverse); @@ -344,10 +344,10 @@ TEST_F( SmallGapCube, FillGapTestVertLinear ) fillgap(options, &log); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *label = outCube.label(); PvlGroup &dims = label->findGroup("Dimensions", Pvl::Traverse); @@ -403,7 +403,7 @@ TEST_F( SmallGapCube, FillGapTestGapsOnEdge ) fillgap(options, &log); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } PvlGroup &mess = log.findGroup("Messages", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsFindGaps.cpp b/isis/tests/FunctionalTestsFindGaps.cpp index d2c8a4e0e2..095dbf82dc 100644 --- a/isis/tests/FunctionalTestsFindGaps.cpp +++ b/isis/tests/FunctionalTestsFindGaps.cpp @@ -13,7 +13,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/findgaps.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/findgaps.xml").expanded()); // Tests a basic gap detection TEST_F( SmallCube, FindGapsDefault ) @@ -48,10 +48,10 @@ TEST_F( SmallCube, FindGapsDefault ) findgaps(options); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); // test that nullified gaps were written to output cube as expected std::unique_ptr outHist (outCube.histogram()); @@ -99,10 +99,10 @@ TEST_F( SmallCube, FindGapsEndOfBand ) findgaps(options); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); // test that nullified gaps were written to output cube as expected std::unique_ptr outHist (outCube.histogram()); @@ -162,10 +162,10 @@ TEST_F( SmallCube, FindGapsCorTol ) findgaps(options); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); // test that nullified gaps were written to output cube as expected std::unique_ptr outHist (outCube.histogram()); diff --git a/isis/tests/FunctionalTestsFindfeatures.cpp b/isis/tests/FunctionalTestsFindfeatures.cpp index d820e87241..8ed36a2e41 100644 --- a/isis/tests/FunctionalTestsFindfeatures.cpp +++ b/isis/tests/FunctionalTestsFindfeatures.cpp @@ -20,7 +20,7 @@ using namespace Isis; using ::testing::HasSubstr; -static QString APP_XML = FileName("$ISISROOT/bin/xml/findfeatures.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/findfeatures.xml").expanded()); // All FastGeom Keys expected in logs for algorithms static const QStringList fastgeom_generic_keywords = { "FastGeomAlgorithm", @@ -346,7 +346,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestFindfeaturesFastGeomDefault) { ASSERT_EQ( keyvalues.get( "FastGeomRadialSegments", "null"), "14"); // Do the floating point special - EXPECT_NEAR( toDouble(keyvalues.get( "FastGeomMaximumRadius", "-1") ), 339.411, 1.0E-4); + EXPECT_NEAR( keyvalues.get( "FastGeomMaximumRadius", "-1").toDouble(), 339.411, 1.0E-4); } TEST_F(ThreeImageNetwork, FunctionalTestFindfeaturesFastGeomRadialConfig) { @@ -414,7 +414,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestFindfeaturesFastGeomRadialConfig) { ASSERT_EQ( keyvalues.get( "FastGeomRadialSegments", "null"), "37"); // Do the floating point special - EXPECT_NEAR( toDouble(keyvalues.get( "FastGeomMaximumRadius", "-1") ), 360.624, 1.0E-4); + EXPECT_NEAR( keyvalues.get( "FastGeomMaximumRadius", "-1").toDouble(), 360.624, 1.0E-4); } TEST_F(ThreeImageNetwork, FunctionalTestFindfeaturesFastGeomGridDefault) { diff --git a/isis/tests/FunctionalTestsFindimageoverlaps.cpp b/isis/tests/FunctionalTestsFindimageoverlaps.cpp index 6d0b2ebe99..d7c23895bb 100644 --- a/isis/tests/FunctionalTestsFindimageoverlaps.cpp +++ b/isis/tests/FunctionalTestsFindimageoverlaps.cpp @@ -25,7 +25,7 @@ using json = nlohmann::json; using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/findimageoverlaps.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/findimageoverlaps.xml").expanded()); TEST_F(ThreeImageNetwork, FunctionalTestFindimageoverlapsNoOverlap) { ImagePolygon fp1; @@ -34,25 +34,25 @@ TEST_F(ThreeImageNetwork, FunctionalTestFindimageoverlapsNoOverlap) { Cube newCube2; json newIsd2; - std::ifstream i(isdPath2->expanded().toStdString()); + std::ifstream i(isdPath2->expanded()); i >> newIsd2; newIsd2["instrument_position"]["positions"] = {{1,1,1}, {2,2,2}, {3,3,3}}; - newCube2.fromIsd(tempDir.path()+"/new2.cub", *cube2->label(), newIsd2, "rw"); + newCube2.fromIsd(tempDir.path().toStdString()+"/new2.cub", *cube2->label(), newIsd2, "rw"); ImagePolygon fp2; fp2.Create(newCube2); newCube2.write(fp2); FileList cubes; - cubes.append(cube1->fileName()); - cubes.append(newCube2.fileName()); + cubes.append(cube1->fileName().toStdString()); + cubes.append(newCube2.fileName().toStdString()); cube1->close(); cube2->close(); newCube2.close(); QString cubeListPath = tempDir.path() + "/cubes.lis"; - cubes.write(cubeListPath); + cubes.write(cubeListPath.toStdString()); QVector args = {"from="+cubeListPath, "overlapList="+tempDir.path()+"/overlaps.txt"}; UserInterface options(APP_XML, args); Pvl appLog; @@ -62,8 +62,8 @@ TEST_F(ThreeImageNetwork, FunctionalTestFindimageoverlapsNoOverlap) { FAIL() << "Expected an IException with message: \"No overlaps were found\"."; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("No overlaps were found")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("No overlaps were found") != std::string::npos) + << e.toString(); } } @@ -72,8 +72,8 @@ TEST_F(ThreeImageNetwork, FunctionalTestFindimageoverlapsTwoImageOverlap) { QVector args = {"OVERLAPLIST=" + tempDir.path() + "/overlaps.txt", "detailed=true", "errors=true"}; UserInterface ui(APP_XML, args); FileList images; - images.append(FileName(cube1->fileName())); - images.append(FileName(cube2->fileName())); + images.append(FileName(cube1->fileName().toStdString())); + images.append(FileName(cube2->fileName().toStdString())); findimageoverlaps(images, ui, false, nullptr); // Find all the overlaps between the images in the FROMLIST @@ -119,8 +119,8 @@ TEST_F(ThreeImageNetwork, FunctionalTestFindimageoverlapsFullOverlap) { QVector args = {"OVERLAPLIST=" + tempDir.path() + "/overlaps.txt", "detailed=true", "errors=true"}; UserInterface ui(APP_XML, args); FileList images; - images.append(FileName(cube1->fileName())); - images.append(FileName(cube2->fileName())); + images.append(FileName(cube1->fileName().toStdString())); + images.append(FileName(cube2->fileName().toStdString())); findimageoverlaps(images, ui, false, nullptr); // Find all the overlaps between the images in the FROMLIST diff --git a/isis/tests/FunctionalTestsFits2isis.cpp b/isis/tests/FunctionalTestsFits2isis.cpp index 63d9c57180..88e80417e8 100644 --- a/isis/tests/FunctionalTestsFits2isis.cpp +++ b/isis/tests/FunctionalTestsFits2isis.cpp @@ -10,7 +10,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/fits2isis.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/fits2isis.xml").expanded()); TEST(Fits2Isis, Fits2IsisTestDefault) { QTemporaryDir prefix; @@ -22,9 +22,9 @@ TEST(Fits2Isis, Fits2IsisTestDefault) { fits2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest fits file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest fits file: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group @@ -65,10 +65,10 @@ TEST(Fits2Isis, Fits2IsisOrganizationBsq) { fits2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest fits file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest fits file: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group ASSERT_EQ(cube.sampleCount(), 25); @@ -95,7 +95,7 @@ TEST(Fits2Isis, Fits2IsisOrganizationBsq) { TEST(Fits2Isis, Fits2IsisOrganizationBil) { QTemporaryDir prefix; - QString APP_XML = FileName("$ISISROOT/bin/xml/fits2isis.xml").expanded(); + QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/fits2isis.xml").expanded()); QString cubeFileName = prefix.path() + "/fits2isisTEMP.cub"; QVector args = {"from=data/fits2isis/organization.fits", "to=" + cubeFileName, @@ -107,10 +107,10 @@ TEST(Fits2Isis, Fits2IsisOrganizationBil) { fits2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest fits file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest fits file: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group diff --git a/isis/tests/FunctionalTestsFootprintinit.cpp b/isis/tests/FunctionalTestsFootprintinit.cpp index f927ca092b..136bd3555a 100644 --- a/isis/tests/FunctionalTestsFootprintinit.cpp +++ b/isis/tests/FunctionalTestsFootprintinit.cpp @@ -20,7 +20,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/footprintinit.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/footprintinit.xml").expanded()); TEST_F(DefaultCube, FunctionalTestFootprintinitDefault) { QVector footprintArgs = {}; diff --git a/isis/tests/FunctionalTestsFrameStitch.cpp b/isis/tests/FunctionalTestsFrameStitch.cpp index 92de4796db..1279874359 100644 --- a/isis/tests/FunctionalTestsFrameStitch.cpp +++ b/isis/tests/FunctionalTestsFrameStitch.cpp @@ -19,21 +19,21 @@ using namespace Isis; using namespace testing; -static QString APP_XML = FileName("$ISISROOT/bin/xml/framestitch.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/framestitch.xml").expanded()); TEST_F(PushFramePair, FunctionalTestFramestitchManualHeight) { QString outCubePath = tempDir.path() + "/stitched.cub"; QVector args = { "EVEN="+evenCube->fileName(), "ODD="+oddCube->fileName(), - "FRAMEHEIGHT="+toString(frameHeight), + "FRAMEHEIGHT="+QString::number(frameHeight), "TO="+outCubePath}; UserInterface ui(APP_XML, args); framestitch(ui); - Cube outCube(outCubePath); + Cube outCube(outCubePath.toStdString()); std::shared_ptr bandStats(outCube.statistics()); EXPECT_EQ(bandStats->Minimum(), 1); EXPECT_EQ(bandStats->Maximum(), numFrames); @@ -77,7 +77,7 @@ TEST_F(PushFramePair, FunctionalTestFramestitchAutoHeight) { QVector manualArgs = { "EVEN="+evenCube->fileName(), "ODD="+oddCube->fileName(), - "FRAMEHEIGHT="+toString(frameHeight), + "FRAMEHEIGHT="+QString::number(frameHeight), "TO="+manualCubePath}; UserInterface manualUI(APP_XML, manualArgs); @@ -94,8 +94,8 @@ TEST_F(PushFramePair, FunctionalTestFramestitchAutoHeight) { framestitch(autoUI); - Cube manualCube(manualCubePath); - Cube autoCube(autoCubePath); + Cube manualCube(manualCubePath.toStdString()); + Cube autoCube(autoCubePath.toStdString()); std::shared_ptr manualStats(manualCube.statistics()); std::shared_ptr autoStats(autoCube.statistics()); @@ -120,7 +120,7 @@ TEST_F(PushFramePair, FunctionalTestFramestitchFlip) { QVector args = { "EVEN="+evenCube->fileName(), "ODD="+oddCube->fileName(), - "FRAMEHEIGHT="+toString(frameHeight), + "FRAMEHEIGHT="+QString::number(frameHeight), "TO="+outCubePath, "FLIP=YES"}; @@ -128,7 +128,7 @@ TEST_F(PushFramePair, FunctionalTestFramestitchFlip) { framestitch(ui); - Cube outCube(outCubePath); + Cube outCube(outCubePath.toStdString()); // Check the order on the first two and last two frames Brick outBrick(numSamps, frameHeight, numBands, outCube.pixelType()); @@ -171,14 +171,14 @@ TEST_F(FlippedPushFramePair, FunctionalTestFramestitchNoFlip) { QVector args = { "EVEN="+evenCube->fileName(), "ODD="+oddCube->fileName(), - "FRAMEHEIGHT="+toString(frameHeight), + "FRAMEHEIGHT="+QString::number(frameHeight), "TO="+outCubePath}; UserInterface ui(APP_XML, args); framestitch(ui); - Cube outCube(outCubePath); + Cube outCube(outCubePath.toStdString()); // Check the order on the first two and last two frames Brick outBrick(numSamps, frameHeight, numBands, outCube.pixelType()); @@ -221,7 +221,7 @@ TEST_F(FlippedPushFramePair, FunctionalTestFramestitchFlip) { QVector args = { "EVEN="+evenCube->fileName(), "ODD="+oddCube->fileName(), - "FRAMEHEIGHT="+toString(frameHeight), + "FRAMEHEIGHT="+QString::number(frameHeight), "TO="+outCubePath, "FLIP=YES"}; @@ -229,7 +229,7 @@ TEST_F(FlippedPushFramePair, FunctionalTestFramestitchFlip) { framestitch(ui); - Cube outCube(outCubePath); + Cube outCube(outCubePath.toStdString()); // Check the order on the first two and last two frames Brick outBrick(numSamps, frameHeight, numBands, outCube.pixelType()); @@ -274,7 +274,7 @@ TEST_F(PushFramePair, FunctionalTestFramestitchDifferentObservations) { QVector args = { "EVEN="+evenCube->fileName(), "ODD="+oddCube->fileName(), - "FRAMEHEIGHT="+toString(frameHeight), + "FRAMEHEIGHT="+QString::number(frameHeight), "TO="+tempDir.path() + "/stitched.cub"}; UserInterface ui(APP_XML, args); @@ -298,7 +298,7 @@ TEST_F(FlippedPushFramePair, FunctionalTestFramestitchDifferentFlipping) { QVector args = { "EVEN="+evenCube->fileName(), "ODD="+oddCube->fileName(), - "FRAMEHEIGHT="+toString(frameHeight), + "FRAMEHEIGHT="+QString::number(frameHeight), "TO="+tempDir.path() + "/stitched.cub"}; UserInterface ui(APP_XML, args); @@ -429,15 +429,15 @@ TEST_F(PushFramePair, FunctionalTestFramestitchRemoveOverlap) { QVector args = { "EVEN="+evenCube->fileName(), "ODD="+oddCube->fileName(), - "FRAMEHEIGHT="+toString(frameHeight), - "NUM_LINES_OVERLAP=" + toString(numLinesOverlap), + "FRAMEHEIGHT="+QString::number(frameHeight), + "NUM_LINES_OVERLAP=" + QString::number(numLinesOverlap), "TO="+outCubePath}; UserInterface ui(APP_XML, args); framestitch(ui); - Cube outCube(outCubePath); + Cube outCube(outCubePath.toStdString()); std::shared_ptr bandStats(outCube.statistics()); EXPECT_EQ(bandStats->Minimum(), 1); EXPECT_EQ(bandStats->Maximum(), numFrames); diff --git a/isis/tests/FunctionalTestsGaussstretch.cpp b/isis/tests/FunctionalTestsGaussstretch.cpp index 163fe8df65..e55353409d 100644 --- a/isis/tests/FunctionalTestsGaussstretch.cpp +++ b/isis/tests/FunctionalTestsGaussstretch.cpp @@ -10,7 +10,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/gaussstretch.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/gaussstretch.xml").expanded()); TEST_F(DefaultCube, FunctionalTestGaussstretch) { QString outputCubePath = tempDir.path() + "/tempGaussStretchOut.cub"; @@ -23,7 +23,7 @@ TEST_F(DefaultCube, FunctionalTestGaussstretch) { catch (IException &e) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube outputCube(outputCubePath); + Cube outputCube(outputCubePath.toStdString()); EXPECT_FLOAT_EQ(outputCube.histogram()->Median(), -1.79769e+308); } diff --git a/isis/tests/FunctionalTestsGetsn.cpp b/isis/tests/FunctionalTestsGetsn.cpp index 7cd1daa23a..3cf45702de 100644 --- a/isis/tests/FunctionalTestsGetsn.cpp +++ b/isis/tests/FunctionalTestsGetsn.cpp @@ -19,7 +19,7 @@ using namespace Isis; // check for all correct outputs TEST_F(DefaultCube, FunctionalTestGetsnAllTrue) { - QString APP_XML = FileName("$ISISROOT/bin/xml/getsn.xml").expanded(); + QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/getsn.xml").expanded()); QString expectedSN = "Viking1/VISB/33322515"; QString expectedON = "Viking1/VISB/33322515"; @@ -42,7 +42,7 @@ TEST_F(DefaultCube, FunctionalTestGetsnAllTrue) { // Set sn=false; so all output params are false // resulting data should not contain any of the three output types TEST_F(DefaultCube, FunctionalTestGetsnAllFalse) { - QString APP_XML = FileName("$ISISROOT/bin/xml/getsn.xml").expanded(); + QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/getsn.xml").expanded()); QVector args = { "SN=FALSE" }; UserInterface options(APP_XML, args); Pvl appLog; @@ -59,7 +59,7 @@ TEST_F(DefaultCube, FunctionalTestGetsnAllFalse) { // Test the param DEFAULT=TRUE // when no SN can be generated, the SN should default to the file name TEST_F(DefaultCube, FunctionalTestGetsnDefaultTrue) { - QString APP_XML = FileName("$ISISROOT/bin/xml/getsn.xml").expanded(); + QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/getsn.xml").expanded()); QString fileName = "default.cub"; QVector args = { "DEFAULT=TRUE" }; UserInterface options(APP_XML, args); @@ -77,7 +77,7 @@ TEST_F(DefaultCube, FunctionalTestGetsnDefaultTrue) { // Test the param DEFAULT=FALSE // when no SN can be generated, the SN should default to "Unknown" TEST_F(DefaultCube, FunctionalTestGetsnDefaultFalse) { - QString APP_XML = FileName("$ISISROOT/bin/xml/getsn.xml").expanded(); + QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/getsn.xml").expanded()); QString fileName = "Unknown"; QVector args = { "DEFAULT=FALSE" }; UserInterface options(APP_XML, args); @@ -94,7 +94,7 @@ TEST_F(DefaultCube, FunctionalTestGetsnDefaultFalse) { // Test flatfile mode gives expected output TEST_F(DefaultCube, FunctionalTestGetsnFlat) { - QString APP_XML = FileName("$ISISROOT/bin/xml/getsn.xml").expanded(); + QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/getsn.xml").expanded()); QString expectedSN = "Viking1/VISB/33322515"; QFile flatFile(tempDir.path()+"/testOut.txt"); QVector args = { @@ -115,7 +115,7 @@ TEST_F(DefaultCube, FunctionalTestGetsnFlat) { // Test that append true appends to file TEST_F(DefaultCube, FunctionalTestGetsnAppend) { - QString APP_XML = FileName("$ISISROOT/bin/xml/getsn.xml").expanded(); + QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/getsn.xml").expanded()); QFile flatFile(tempDir.path()+"testOut.txt"); QVector args = { "FORMAT=FLAT", @@ -135,7 +135,7 @@ TEST_F(DefaultCube, FunctionalTestGetsnAppend) { // Test that append false overwrites file TEST_F(DefaultCube, FunctionalTestGetsnOverwrite) { - QString APP_XML = FileName("$ISISROOT/bin/xml/getsn.xml").expanded(); + QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/getsn.xml").expanded()); QFile flatFile(tempDir.path()+"testOut.txt"); QVector args = { "FORMAT=FLAT", diff --git a/isis/tests/FunctionalTestsGllssical.cpp b/isis/tests/FunctionalTestsGllssical.cpp index 3971d86af0..dca70d7113 100644 --- a/isis/tests/FunctionalTestsGllssical.cpp +++ b/isis/tests/FunctionalTestsGllssical.cpp @@ -10,7 +10,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/gllssical.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/gllssical.xml").expanded()); TEST_F(GalileoSsiCube, FunctionalTestGllssicalDefault) { // tempDir exists if the fixture subclasses TempTestingFiles, which most do @@ -25,7 +25,7 @@ TEST_F(GalileoSsiCube, FunctionalTestGllssicalDefault) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); PvlGroup radGroup = oCube.label()->findObject("IsisCube").findGroup("RadiometricCalibration"); @@ -78,7 +78,7 @@ TEST_F(GalileoSsiCube, FunctionalTestGllssicalClear) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); PvlGroup radGroup = oCube.label()->findObject("IsisCube").findGroup("RadiometricCalibration"); @@ -117,7 +117,7 @@ TEST_F(GalileoSsiCube, FunctionalTestGllssicalRadiance) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); PvlGroup radGroup = oCube.label()->findObject("IsisCube").findGroup("RadiometricCalibration"); diff --git a/isis/tests/FunctionalTestsGrid.cpp b/isis/tests/FunctionalTestsGrid.cpp index 315bdf6475..128eddfe6c 100644 --- a/isis/tests/FunctionalTestsGrid.cpp +++ b/isis/tests/FunctionalTestsGrid.cpp @@ -16,7 +16,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/grid.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/grid.xml").expanded()); TEST_F(DefaultCube, FunctionalTestGridGround) { QVector args = {"to=" + tempDir.path() + "/output.cub"}; @@ -346,7 +346,7 @@ TEST_F(DefaultCube, FunctionalTestGridWorld) { delete projTestCube; // Cube now has new mapping group - projTestCube = new Cube(fileName, "rw"); + projTestCube = new Cube(fileName.toStdString(), "rw"); QVector args = {"to=" + tempDir.path() + "/output.cub", "ticks=true", "diagonal=true", "loninc=45"}; UserInterface options(APP_XML, args); diff --git a/isis/tests/FunctionalTestsHi2isis.cpp b/isis/tests/FunctionalTestsHi2isis.cpp index 0b149ff286..9d318cad10 100644 --- a/isis/tests/FunctionalTestsHi2isis.cpp +++ b/isis/tests/FunctionalTestsHi2isis.cpp @@ -11,7 +11,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/hi2isis.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/hi2isis.xml").expanded()); TEST(hi2isisTest, FunctionalTestHi2isisDefault) { QTemporaryDir prefix; @@ -27,7 +27,7 @@ TEST(hi2isisTest, FunctionalTestHi2isisDefault) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube cube(outCubeFileName); + Cube cube(outCubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions group @@ -152,7 +152,7 @@ TEST(hi2isisTest, FunctionalTestHi2isisDefaultWorstCase) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube cube(outCubeFileName); + Cube cube(outCubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions group @@ -246,7 +246,7 @@ TEST(hi2isisTest, FunctionalTestHi2isisUnlut) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube cube(outCubeFileName); + Cube cube(outCubeFileName.toStdString()); std::unique_ptr hist (cube.histogram()); diff --git a/isis/tests/FunctionalTestsHical.cpp b/isis/tests/FunctionalTestsHical.cpp index f75f63b084..4f4ce78b6e 100644 --- a/isis/tests/FunctionalTestsHical.cpp +++ b/isis/tests/FunctionalTestsHical.cpp @@ -16,7 +16,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/hical.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/hical.xml").expanded()); TEST(HicalTest, Default) { QTemporaryDir prefix; @@ -30,11 +30,11 @@ TEST(HicalTest, Default) { hical(options); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // Check calibrated cube - Cube outCube(outFileName); + Cube outCube(outFileName.toStdString()); ASSERT_TRUE(outCube.hasGroup("RadiometricCalibration")); @@ -379,11 +379,11 @@ TEST(HicalTest, Dns) { hical(options); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // Check calibrated cube - Cube outCube(outFileName); + Cube outCube(outFileName.toStdString()); std::unique_ptr stats (outCube.statistics()); EXPECT_NEAR(stats->Average(), 800.43395004272, .00001); @@ -421,11 +421,11 @@ TEST(HicalTest, DnsPerMicrosecond) { hical(options); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // Check calibrated cube - Cube outCube(outFileName); + Cube outCube(outFileName.toStdString()); std::unique_ptr stats (outCube.statistics()); EXPECT_NEAR(stats->Average(), 9.2871234171093, .00001); @@ -484,11 +484,11 @@ TEST(HicalTest, DarkRate) { hical(options); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // Check calibrated cube - Cube outCube(outFileName); + Cube outCube(outFileName.toStdString()); std::unique_ptr stats (outCube.statistics()); EXPECT_NEAR(stats->Average(), 0.029009951796252, .00001); @@ -547,11 +547,11 @@ TEST(HicalTest, DarkRateFallback) { hical(options); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // Check calibrated cube - Cube outCube(outFileName); + Cube outCube(outFileName.toStdString()); std::unique_ptr stats (outCube.statistics()); EXPECT_NEAR(stats->Average(), 0.066949089371337325, .00001); diff --git a/isis/tests/FunctionalTestsHicolormos.cpp b/isis/tests/FunctionalTestsHicolormos.cpp index d2e60c8faa..fde37b7c6a 100644 --- a/isis/tests/FunctionalTestsHicolormos.cpp +++ b/isis/tests/FunctionalTestsHicolormos.cpp @@ -11,7 +11,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/hicolormos.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/hicolormos.xml").expanded()); TEST_F(MroHiriseCube, FunctionalTestHicolormosDefault) { QString outCubeFileName = tempDir.path() + "/outTEMP.cub"; @@ -25,7 +25,7 @@ TEST_F(MroHiriseCube, FunctionalTestHicolormosDefault) { FAIL() << "Unable to process HRISE image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName); + Cube oCube(outCubeFileName.toStdString()); Pvl *label = oCube.label(); PvlGroup group = label->findObject("IsisCube").findGroup("Mosaic"); diff --git a/isis/tests/FunctionalTestsHicrop.cpp b/isis/tests/FunctionalTestsHicrop.cpp index 65dddfc0fd..fca9749d1a 100644 --- a/isis/tests/FunctionalTestsHicrop.cpp +++ b/isis/tests/FunctionalTestsHicrop.cpp @@ -11,7 +11,7 @@ using namespace Isis; using namespace testing; -static QString APP_XML = FileName("$ISISROOT/bin/xml/hicrop.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/hicrop.xml").expanded()); TEST_F(MroHiriseCube, FunctionalTestHicropCropByCk) { // make the image stretch outside of the CK time ranges @@ -45,7 +45,7 @@ TEST_F(MroHiriseCube, FunctionalTestHicropCropByCk) { EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStartClock"), "4/0895484265.14186"); EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStopClock"), "4/0895484271.36245"); - Cube oCube(outCubeFileName); + Cube oCube(outCubeFileName.toStdString()); PvlGroup oCubeInstrument = testCube->label()->findObject("IsisCube").findGroup("Instrument"); EXPECT_EQ(oCube.lineCount(), 1002); @@ -85,7 +85,7 @@ TEST_F(MroHiriseCube, FunctionalTestHicropCropByLine) { EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStartClock"), "4/0895484264.57678"); EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStopClock"), "4/0895484264.63921"); - Cube oCube(outCubeFileName); + Cube oCube(outCubeFileName.toStdString()); PvlGroup oCubeInstrument = testCube->label()->findObject("IsisCube").findGroup("Instrument"); EXPECT_EQ(oCube.lineCount(), 1002); @@ -126,7 +126,7 @@ TEST_F(MroHiriseCube, FunctionalTestHicropCropByTimes) { EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStartClock"), "4/0895484264.57342"); EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStopClock"), "4/0895484264.63279"); - Cube oCube(outCubeFileName); + Cube oCube(outCubeFileName.toStdString()); PvlGroup oCubeInstrument = testCube->label()->findObject("IsisCube").findGroup("Instrument"); EXPECT_EQ(oCube.lineCount(), 953); @@ -167,7 +167,7 @@ TEST_F(MroHiriseCube, FunctionalTestHicropCropByJitterDefault) { EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStartClock"), "4/0895484264.57342"); EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStopClock"), "4/0895484264.63279"); - Cube oCube(outCubeFileName); + Cube oCube(outCubeFileName.toStdString()); PvlGroup oCubeInstrument = testCube->label()->findObject("IsisCube").findGroup("Instrument"); EXPECT_EQ(oCube.lineCount(), 953); @@ -229,7 +229,7 @@ TEST_F(MroHiriseCube, FunctionalTestHicropCropByJitterZero) { EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStartClock"), "4/0895484264.58046"); EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStopClock"), "4/0895484264.63279"); - Cube oCube(outCubeFileName); + Cube oCube(outCubeFileName.toStdString()); PvlGroup oCubeInstrument = testCube->label()->findObject("IsisCube").findGroup("Instrument"); EXPECT_EQ(oCube.lineCount(), 840); @@ -291,7 +291,7 @@ TEST_F(MroHiriseCube, FunctionalTestHicropCropByJitterZeroSample) { EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStartClock"), "4/0895484264.57342"); EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStopClock"), "4/0895484264.63279"); - Cube oCube(outCubeFileName); + Cube oCube(outCubeFileName.toStdString()); PvlGroup oCubeInstrument = testCube->label()->findObject("IsisCube").findGroup("Instrument"); EXPECT_EQ(oCube.lineCount(), 953); @@ -353,7 +353,7 @@ TEST_F(MroHiriseCube, FunctionalTestHicropCropByJitterZeroLine) { EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStartClock"), "4/0895484264.57342"); EXPECT_PRED_FORMAT2(AssertStringsEqual, results.findKeyword("OututStopClock"), "4/0895484264.63279"); - Cube oCube(outCubeFileName); + Cube oCube(outCubeFileName.toStdString()); PvlGroup oCubeInstrument = testCube->label()->findObject("IsisCube").findGroup("Instrument"); EXPECT_EQ(oCube.lineCount(), 953); diff --git a/isis/tests/FunctionalTestsHicubeit.cpp b/isis/tests/FunctionalTestsHicubeit.cpp index 8c2174a05e..6d620bb49e 100644 --- a/isis/tests/FunctionalTestsHicubeit.cpp +++ b/isis/tests/FunctionalTestsHicubeit.cpp @@ -11,7 +11,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/hicubeit.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/hicubeit.xml").expanded()); TEST(Hicubeit, Default) { QTemporaryDir prefix; @@ -26,10 +26,10 @@ TEST(Hicubeit, Default) { hicubeit(options); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } - Cube outCube(outFileName); + Cube outCube(outFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup dimensions = outLabel->findGroup("Dimensions", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsHicubenorm.cpp b/isis/tests/FunctionalTestsHicubenorm.cpp index ecbc1360b8..d485039970 100644 --- a/isis/tests/FunctionalTestsHicubenorm.cpp +++ b/isis/tests/FunctionalTestsHicubenorm.cpp @@ -11,7 +11,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/hicubenorm.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/hicubenorm.xml").expanded()); TEST_F(MroHiriseCube, FunctionalTestHicubenormSubtract) { QTemporaryDir prefix; @@ -52,7 +52,7 @@ TEST_F(MroHiriseCube, FunctionalTestHicubenormSubtract) { ASSERT_DOUBLE_EQ((double)res[9630], 1204); ASSERT_DOUBLE_EQ((double)res[9631], 1204); - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); Histogram *oCubeStats = oCube.histogram(); @@ -80,7 +80,7 @@ TEST_F(MroHiriseCube, FunctionalTestHicubenormDivide) { FAIL() << "Unable to process HRISE image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); Histogram *oCubeStats = oCube.histogram(); @@ -107,7 +107,7 @@ TEST_F(MroHiriseCube, FunctionalTestHicubenormAverage) { FAIL() << "Unable to process HRISE image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); Histogram *oCubeStats = oCube.histogram(); @@ -154,7 +154,7 @@ TEST_F(MroHiriseCube, FunctionalTestHicubenormNewVersion) { FAIL() << "Unable to process HRISE image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); Histogram *oCubeStats = oCube.histogram(); @@ -193,7 +193,7 @@ TEST_F(MroHiriseCube, FunctionalTestHicubenormPreserve) { FAIL() << "Unable to process HRISE image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); Histogram *oCubeStats = oCube.histogram(); diff --git a/isis/tests/FunctionalTestsHidtmgen.cpp b/isis/tests/FunctionalTestsHidtmgen.cpp index 0a7e9682f7..ebc4194881 100644 --- a/isis/tests/FunctionalTestsHidtmgen.cpp +++ b/isis/tests/FunctionalTestsHidtmgen.cpp @@ -12,7 +12,7 @@ using namespace Isis; using ::testing::HasSubstr; -static QString APP_XML = FileName("$ISISROOT/bin/xml/hidtmgen.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/hidtmgen.xml").expanded()); TEST(Hidtmgen, HidtmgenTestColor){ //Serves as default test case -- test all keywords for all generated products. @@ -30,7 +30,7 @@ TEST(Hidtmgen, HidtmgenTestColor){ hidtmgen(options); } catch (IException &e) { - FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().c_str() << std::endl; } Pvl dtmLabel(prefix.path().toStdString() +"/DTEEZ_042252_1930_042753_1930_A31.IMG"); @@ -259,7 +259,7 @@ TEST(Hidtmgen, HidtmgenTestDtmOnly){ hidtmgen(options); } catch (IException &e) { - FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().c_str() << std::endl; } Pvl dtmLabel(prefix.path().toStdString() +"/DTEEZ_042252_1930_042753_1930_A15.IMG"); @@ -286,7 +286,7 @@ TEST(Hidtmgen, HidtmgenTestEqui){ hidtmgen(options); } catch (IException &e) { - FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().c_str() << std::endl; } Pvl dtmLabel(prefix.path().toStdString() +"/DTEEZ_002118_1510_003608_1510_A02.IMG"); @@ -536,7 +536,7 @@ TEST(Hidtmgen, HidtmgenTestNonDefaultNames){ hidtmgen(options); } catch (IException &e) { - FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().c_str() << std::endl; } Pvl dtmLabel(prefix.path().toStdString() +"/dtm.img"); @@ -563,7 +563,7 @@ TEST(Hidtmgen, HidtmgenTestOrthoOnly){ hidtmgen(options); } catch (IException &e) { - FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().c_str() << std::endl; } Pvl orthoLabel(prefix.path().toStdString() +"/ESP_042252_1930_IRB_D_31_ORTHO.IMG"); @@ -600,7 +600,7 @@ TEST(Hidtmgen, HidtmgenTestOutputTypesAll832){ hidtmgen(options); } catch (IException &e) { - FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().c_str() << std::endl; } Pvl dtmLabel(prefix.path().toStdString() +"/DTEEZ_042252_1930_042753_1930_A31.IMG"); @@ -650,7 +650,7 @@ TEST(Hidtmgen, HidtmgenTestOutputTypesAllU16S16){ hidtmgen(options); } catch (IException &e) { - FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().c_str() << std::endl; } Pvl dtmLabel(prefix.path().toStdString() +"/DTEEZ_042252_1930_042753_1930_A07.IMG"); @@ -699,7 +699,7 @@ TEST(Hidtmgen, HidtmgenTestOutputTypesNoneS16U16){ hidtmgen(options); } catch (IException &e) { - FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().c_str() << std::endl; } Pvl dtmLabel(prefix.path().toStdString() +"/DTEEZ_042252_1930_042753_1930_A07.IMG"); @@ -740,7 +740,7 @@ TEST(Hidtmgen, HidtmgenTestPolar){ hidtmgen(options); } catch (IException &e) { - FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to HIRISE generate PDS products: " << e.toString().c_str() << std::endl; } Pvl dtmLabel(prefix.path().toStdString() +"/DTEPZ_009404_2635_010221_2635_Z12.IMG"); diff --git a/isis/tests/FunctionalTestsHimos.cpp b/isis/tests/FunctionalTestsHimos.cpp index 7b6e771ba1..a37a1e14e3 100644 --- a/isis/tests/FunctionalTestsHimos.cpp +++ b/isis/tests/FunctionalTestsHimos.cpp @@ -13,17 +13,17 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/himos.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/himos.xml").expanded()); TEST_F(MroHiriseCube, FunctionalTestHimosDefault) { - FileName mosFileList(tempDir.path() + "/himosFileList.lis"); + FileName mosFileList(tempDir.path().toStdString() + "/himosFileList.lis"); FileList * cubeList = new FileList(); - cubeList->append(dejitteredCube.fileName()); + cubeList->append(dejitteredCube.fileName().toStdString()); cubeList->write(mosFileList); - QVector args = {"from=" + mosFileList.toString(), + QVector args = {"from=" + QString::fromStdString(mosFileList.toString()), "to=" + tempDir.path() + "/outputMos.cub"}; UserInterface options(APP_XML, args); @@ -31,9 +31,9 @@ TEST_F(MroHiriseCube, FunctionalTestHimosDefault) { himos(options); } catch (IException &e) { - FAIL() << "Unable to create mosaic image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to create mosaic image: " << e.toString().c_str() << std::endl; } - Cube outputMos(options.GetCubeName("TO")); + Cube outputMos(options.GetCubeName("TO").toStdString()); PvlObject inputCubeLabel = dejitteredCube.label()->findObject("IsisCube"); PvlObject outputCubeLabel = outputMos.label()->findObject("IsisCube"); PvlGroup dimensions = outputCubeLabel.findObject("Core").findGroup("Dimensions"); @@ -76,13 +76,13 @@ TEST_F(MroHiriseCube, FunctionalTestHimosDefault) { TEST_F(MroHiriseCube, FunctionalTestHimosError) { - FileName mosFileList(tempDir.path() + "/himosFileList.lis"); + FileName mosFileList(tempDir.path().toStdString() + "/himosFileList.lis"); FileList * cubeList = new FileList(); - cubeList->append(testCube->fileName()); + cubeList->append(testCube->fileName().toStdString()); cubeList->write(mosFileList); - QVector args = {"from=" + mosFileList.toString(), + QVector args = {"from=" + QString::fromStdString(mosFileList.toString()), "to=" + tempDir.path() + "/outputMos.cub"}; UserInterface options(APP_XML, args); @@ -96,19 +96,19 @@ TEST_F(MroHiriseCube, FunctionalTestHimosError) { } TEST_F(MroHiriseCube, FunctionalTestHimosMismatchObs) { - CubeAttributeOutput cubeAtts(FileName(dejitteredCube.fileName())); - Cube *copyDejitteredCube = dejitteredCube.copy(tempDir.path() + "/copyDejitteredCube.cub", cubeAtts); + CubeAttributeOutput cubeAtts(FileName(dejitteredCube.fileName().toStdString())); + Cube *copyDejitteredCube = dejitteredCube.copy(tempDir.path().toStdString() + "/copyDejitteredCube.cub", cubeAtts); copyDejitteredCube->label()->findObject("IsisCube").findGroup("Archive")["ObservationId"] = "Banana"; copyDejitteredCube->reopen("rw"); - FileName mosFileList(tempDir.path() + "/himosFileList.lis"); + FileName mosFileList(tempDir.path().toStdString() + "/himosFileList.lis"); FileList * cubeList = new FileList(); - cubeList->append(dejitteredCube.fileName()); - cubeList->append(copyDejitteredCube->fileName()); + cubeList->append(dejitteredCube.fileName().toStdString()); + cubeList->append(copyDejitteredCube->fileName().toStdString()); cubeList->write(mosFileList); - QVector args = {"from=" + mosFileList.toString(), + QVector args = {"from=" + QString::fromStdString(mosFileList.toString()), "to=" + tempDir.path() + "/outputMos.cub"}; UserInterface options(APP_XML, args); @@ -122,19 +122,19 @@ TEST_F(MroHiriseCube, FunctionalTestHimosMismatchObs) { } TEST_F(MroHiriseCube, FunctionalTestHimosMismatchFilter) { - CubeAttributeOutput cubeAtts(FileName(dejitteredCube.fileName())); - Cube *copyDejitteredCube = dejitteredCube.copy(tempDir.path() + "/copyDejitteredCube.cub", cubeAtts); + CubeAttributeOutput cubeAtts(FileName(dejitteredCube.fileName().toStdString())); + Cube *copyDejitteredCube = dejitteredCube.copy(tempDir.path().toStdString() + "/copyDejitteredCube.cub", cubeAtts); copyDejitteredCube->label()->findObject("IsisCube").findGroup("BandBin")["Name"] = "Red"; copyDejitteredCube->reopen("rw"); - FileName mosFileList(tempDir.path() + "/himosFileList.lis"); + FileName mosFileList(tempDir.path().toStdString() + "/himosFileList.lis"); FileList * cubeList = new FileList(); - cubeList->append(dejitteredCube.fileName()); - cubeList->append(copyDejitteredCube->fileName()); + cubeList->append(dejitteredCube.fileName().toStdString()); + cubeList->append(copyDejitteredCube->fileName().toStdString()); cubeList->write(mosFileList); - QVector args = {"from=" + mosFileList.toString(), + QVector args = {"from=" + QString::fromStdString(mosFileList.toString()), "to=" + tempDir.path() + "/outputMos.cub"}; UserInterface options(APP_XML, args); diff --git a/isis/tests/FunctionalTestsHist.cpp b/isis/tests/FunctionalTestsHist.cpp index c1e3aa87ea..7e33ab3c92 100644 --- a/isis/tests/FunctionalTestsHist.cpp +++ b/isis/tests/FunctionalTestsHist.cpp @@ -14,7 +14,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/hist.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/hist.xml").expanded()); TEST_F(SmallCube, FunctionalTestHistDefault) { QString outputFile = tempDir.path()+"/output.txt"; diff --git a/isis/tests/FunctionalTestsHrsc2isis.cpp b/isis/tests/FunctionalTestsHrsc2isis.cpp index 496e12d4ad..5573b7eec0 100644 --- a/isis/tests/FunctionalTestsHrsc2isis.cpp +++ b/isis/tests/FunctionalTestsHrsc2isis.cpp @@ -14,7 +14,7 @@ using namespace Isis; using ::testing::HasSubstr; -static QString APP_XML = FileName("$ISISROOT/bin/xml/hrsc2isis.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/hrsc2isis.xml").expanded()); TEST(Hrsc2isis, Hrsc2IsisTestDefault) { QTemporaryDir prefix; @@ -27,9 +27,9 @@ TEST(Hrsc2isis, Hrsc2IsisTestDefault) { hrsc2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest HRSC image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest HRSC image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group @@ -100,9 +100,9 @@ TEST(Hrsc2isis, Hrsc2IsisTestPhobos) { hrsc2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest HRSC image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest HRSC image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group @@ -174,9 +174,9 @@ TEST(Hrsc2isis, Hrsc2IsisTestSrcImage) { hrsc2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest HRSC image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest HRSC image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group diff --git a/isis/tests/FunctionalTestsHyb2onc2isis.cpp b/isis/tests/FunctionalTestsHyb2onc2isis.cpp index 2add142355..7c8dad66aa 100644 --- a/isis/tests/FunctionalTestsHyb2onc2isis.cpp +++ b/isis/tests/FunctionalTestsHyb2onc2isis.cpp @@ -14,7 +14,7 @@ using namespace Isis; using ::testing::HasSubstr; -static QString APP_XML = FileName("$ISISROOT/bin/xml/hyb2onc2isis.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/hyb2onc2isis.xml").expanded()); TEST(Hyb2onc2isis, Hyb2onc2isisTestDefault) { QTemporaryDir prefix; @@ -27,9 +27,9 @@ TEST(Hyb2onc2isis, Hyb2onc2isisTestDefault) { hyb2onc2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest HYB2ONC image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest HYB2ONC image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group diff --git a/isis/tests/FunctionalTestsIsis2Std.cpp b/isis/tests/FunctionalTestsIsis2Std.cpp index 9e0bbd59ef..a4de0498f1 100644 --- a/isis/tests/FunctionalTestsIsis2Std.cpp +++ b/isis/tests/FunctionalTestsIsis2Std.cpp @@ -19,8 +19,8 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/isis2std.xml").expanded(); -static QString STD2ISIS_XML = FileName("$ISISROOT/bin/xml/std2isis.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/isis2std.xml").expanded()); +static QString STD2ISIS_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/std2isis.xml").expanded()); class IsisTruthCube : public TempTestingFiles { protected: @@ -149,7 +149,7 @@ void checkReingestedCube(QString tempDirPath, QString exportedFile, int chunkSiz catch (IException &e) { FAIL() << "Unable to reingest image: " << e.what() << std::endl; } - Cube reingestCube(reingestCubeFilename); + Cube reingestCube(reingestCubeFilename.toStdString()); Portal checkReader(reingestCube.sampleCount(), chunkSize, reingestCube.pixelType()); @@ -332,7 +332,7 @@ TEST_F(SmallARGBCube, FunctionalTestsIsis2StdJpeg2KRGB) { FAIL() << "Unable to reingest image: " << e.what() << std::endl; } - Cube reingestCube(reingestCubeFilename); + Cube reingestCube(reingestCubeFilename.toStdString()); inputCube.open(inputCubeFilename); int pixelsPerBand = inputCube.lineCount() * inputCube.sampleCount(); @@ -394,7 +394,7 @@ TEST_F(SmallARGBCube, FunctionalTestsIsis2StdJpeg2KARGB) { FAIL() << "Unable to reingest image: " << e.what() << std::endl; } - Cube reingestCube(reingestCubeFilename); + Cube reingestCube(reingestCubeFilename.toStdString()); inputCube.open(inputCubeFilename); int pixelsPerBand = inputCube.lineCount() * inputCube.sampleCount(); @@ -528,7 +528,7 @@ TEST_F(SmallARGBCube, FunctionalTestsIsis2StdPNGRGB) { FAIL() << "Unable to reingest image: " << e.what() << std::endl; } - Cube reingestCube(reingestCubeFilename); + Cube reingestCube(reingestCubeFilename.toStdString()); inputCube.open(inputCubeFilename); int pixelsPerBand = inputCube.lineCount() * inputCube.sampleCount(); @@ -672,7 +672,7 @@ TEST_F(SmallARGBCube, FunctionalTestsIsis2StdTIFFRGB) { FAIL() << "Unable to reingest image: " << e.what() << std::endl; } - Cube reingestCube(reingestCubeFilename); + Cube reingestCube(reingestCubeFilename.toStdString()); inputCube.open(inputCubeFilename); int pixelsPerBand = inputCube.lineCount() * inputCube.sampleCount(); @@ -756,7 +756,7 @@ TEST_F(IsisTruthCube, FunctionalTestsIsis2StdTIFFS16) { // std2isis smashes the 16-bit output back down to 8-bit on re-ingest // this results in negative values underflowing to large positive values - Cube reingestCube(reingestCubeFilename); + Cube reingestCube(reingestCubeFilename.toStdString()); Portal checkReader(reingestCube.sampleCount(), chunkSize, reingestCube.pixelType()); @@ -951,7 +951,7 @@ TEST_F(SmallARGBCube, FunctionalTestsIsis2StdManualStretch) { FAIL() << "Unable to reingest image: " << e.what() << std::endl; } - Cube reingestCube(reingestCubeFilename); + Cube reingestCube(reingestCubeFilename.toStdString()); inputCube.open(inputCubeFilename); int pixelsPerBand = inputCube.lineCount() * inputCube.sampleCount(); @@ -1002,7 +1002,7 @@ TEST_F(SmallARGBCube, FunctionalTestsIsis2StdManualStretchRGB) { FAIL() << "Unable to reingest image: " << e.what() << std::endl; } - Cube reingestCube(reingestCubeFilename); + Cube reingestCube(reingestCubeFilename.toStdString()); inputCube.open(inputCubeFilename); int pixelsPerBand = inputCube.lineCount() * inputCube.sampleCount(); diff --git a/isis/tests/FunctionalTestsIsis2ascii.cpp b/isis/tests/FunctionalTestsIsis2ascii.cpp index 8c318541aa..b9a1bf5390 100644 --- a/isis/tests/FunctionalTestsIsis2ascii.cpp +++ b/isis/tests/FunctionalTestsIsis2ascii.cpp @@ -14,7 +14,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/isis2ascii.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/isis2ascii.xml").expanded()); TEST_F(SmallCube, FunctionalTestIsis2asciiDefaultParameters) { QString outputFile = tempDir.path()+"/output.txt"; diff --git a/isis/tests/FunctionalTestsIsis2pds.cpp b/isis/tests/FunctionalTestsIsis2pds.cpp index b38a6de772..9bc013cbe1 100644 --- a/isis/tests/FunctionalTestsIsis2pds.cpp +++ b/isis/tests/FunctionalTestsIsis2pds.cpp @@ -10,7 +10,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/isis2pds.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/isis2pds.xml").expanded()); TEST_F(DefaultCube, FunctionalTestIsis2pdsDefault) { QTemporaryDir prefix; @@ -411,7 +411,7 @@ TEST(isis2pdsTest, FunctionalTestIsis2pdsPds4) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - FileName xmlTransFile(prefix.path() + "/outTemp.xml"); + FileName xmlTransFile(prefix.path().toStdString() + "/outTemp.xml"); XmlToPvlTranslationManager outputLabel(xmlTransFile, "data/isis2pds/isis2pds4.trn"); EXPECT_EQ(outputLabel.Translate("Target_Name"), "Vesta"); diff --git a/isis/tests/FunctionalTestsIsisDataEval.cpp b/isis/tests/FunctionalTestsIsisDataEval.cpp index aef908a681..6c9d0d0112 100644 --- a/isis/tests/FunctionalTestsIsisDataEval.cpp +++ b/isis/tests/FunctionalTestsIsisDataEval.cpp @@ -37,7 +37,7 @@ inline QStringList get_header( const CSVReader &csv ) { return ( row_from_csv( csv.getHeader() ) ); } -static QString APP_XML = FileName("$ISISROOT/bin/xml/isisdataeval.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/isisdataeval.xml").expanded()); TEST_F( IsisDataInventory, ConfirmIsisDataInventory ) { Pvl appLog; @@ -82,7 +82,7 @@ TEST_F( IsisDataInventory, ConfirmIsisDataInventory ) { (int) results["ExternalKernelFiles"] + (int) results["SymlinkKernelFiles"]; - FileName issues( isisissuesfile ); + FileName issues( isisissuesfile.toStdString() ); if ( issues.fileExists() ) { CSVReader csv_issues = load_isisdata_csv( isisissuesfile ); EXPECT_EQ( csv_issues.rows() ,n_issues ); @@ -108,9 +108,9 @@ TEST_F( IsisDataInventory, ConfirmIsisDataInventory ) { const QString status = rowdata[status_t]; QString isisdata_filename = rowdata[filespec_t]; - FileName fnFile( isisdata_filename ); + FileName fnFile( isisdata_filename.toStdString() ); // if ( fnFile.isVersioned() ) fnFile.highestVersion(); - QFileInfo qfFile( fnFile.expanded() ); + QFileInfo qfFile( QString::fromStdString(fnFile.expanded()) ); if ( "empty" == status ) { n_empty_found++; @@ -145,7 +145,7 @@ TEST_F( IsisDataInventory, ConfirmIsisDataInventory ) { } // There are no errors for this case - FileName errors( isiserrorsfile ); + FileName errors( isiserrorsfile.toStdString() ); EXPECT_EQ( errors.fileExists() , true ); if ( errors.fileExists() ) { CSVReader csv_errors = load_isisdata_csv( isiserrorsfile ); diff --git a/isis/tests/FunctionalTestsIsisImport.cpp b/isis/tests/FunctionalTestsIsisImport.cpp index b8b0d899e9..bb1c279ca5 100644 --- a/isis/tests/FunctionalTestsIsisImport.cpp +++ b/isis/tests/FunctionalTestsIsisImport.cpp @@ -20,7 +20,7 @@ using namespace Isis; using namespace testing; using json = nlohmann::json; -static QString APP_XML = FileName("$ISISROOT/bin/xml/isisimport.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/isisimport.xml").expanded()); TEST_F(TempTestingFiles, FunctionalTestIsisImportLabelXmlInput) { QString labelFileName = "data/isisimport/pds4.xml"; diff --git a/isis/tests/FunctionalTestsIsisImportCassiniISS.cpp b/isis/tests/FunctionalTestsIsisImportCassiniISS.cpp index a7be1b66ca..7b9ef23739 100644 --- a/isis/tests/FunctionalTestsIsisImportCassiniISS.cpp +++ b/isis/tests/FunctionalTestsIsisImportCassiniISS.cpp @@ -19,7 +19,7 @@ using namespace Isis; using json = nlohmann::json; -static QString APP_XML = FileName("$ISISROOT/bin/xml/isisimport.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/isisimport.xml").expanded()); TEST_F(TempTestingFiles, FunctionalTestIsisImportCassiniIssNac) { Pvl appLog; @@ -130,13 +130,13 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportCassiniIssNac) { isisimport(options); } catch (IException &e) { - FAIL() << "Unable to ingest file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest file: " << e.toString().c_str() << std::endl; } Pvl truthLabel; PvlInput >> truthLabel; - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup truthGroup = truthLabel.findGroup("Dimensions", Pvl::Traverse); @@ -282,13 +282,13 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportCassiniIssWac) { isisimport(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to ingest file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest file: " << e.toString().c_str() << std::endl; } Pvl truthLabel; PvlInput >> truthLabel; - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup truthGroup = truthLabel.findGroup("Dimensions", Pvl::Traverse); @@ -441,13 +441,13 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportCassiniIssCustomMax) { isisimport(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to ingest file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest file: " << e.toString().c_str() << std::endl; } Pvl truthLabel; PvlInput >> truthLabel; - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup truthGroup = truthLabel.findGroup("Dimensions", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsIsisImportEis.cpp b/isis/tests/FunctionalTestsIsisImportEis.cpp index d067bddb94..779369e96d 100644 --- a/isis/tests/FunctionalTestsIsisImportEis.cpp +++ b/isis/tests/FunctionalTestsIsisImportEis.cpp @@ -25,7 +25,7 @@ using namespace Isis; using namespace testing; using json = nlohmann::json; -static QString APP_XML = FileName("$ISISROOT/bin/xml/isisimport.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/isisimport.xml").expanded()); TEST_F(TempTestingFiles, FunctionalTestIsisImportEisNacFrame){ std::istringstream PvlInput(R"( @@ -150,7 +150,7 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportEisNacFrame){ Pvl truthLabel; PvlInput >> truthLabel; - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup truthGroup = truthLabel.findGroup("Dimensions", Pvl::Traverse); @@ -178,7 +178,7 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportEisNacFrame){ UserInterface optionsNoTemp(APP_XML, argsNoTemp); isisimport(optionsNoTemp); - Cube outCubeNoTemp(cubeFileName); + Cube outCubeNoTemp(cubeFileName.toStdString()); Pvl *outLabelNoTemp = outCubeNoTemp.label(); truthGroup = truthLabel.findGroup("Dimensions", Pvl::Traverse); @@ -326,7 +326,7 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportEisNacPb){ Pvl truthLabel; PvlInput >> truthLabel; - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup truthGroup = truthLabel.findGroup("Dimensions", Pvl::Traverse); @@ -354,7 +354,7 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportEisNacPb){ UserInterface optionsNoTemp(APP_XML, argsNoTemp); isisimport(optionsNoTemp); - Cube outCubeNoTemp(cubeFileName); + Cube outCubeNoTemp(cubeFileName.toStdString()); Pvl *outLabelNoTemp = outCubeNoTemp.label(); truthGroup = truthLabel.findGroup("Dimensions", Pvl::Traverse); @@ -501,7 +501,7 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportEisWacFrame){ Pvl truthLabel; PvlInput >> truthLabel; - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup truthGroup = truthLabel.findGroup("Dimensions", Pvl::Traverse); @@ -529,7 +529,7 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportEisWacFrame){ UserInterface optionsNoTemp(APP_XML, argsNoTemp); isisimport(optionsNoTemp); - Cube outCubeNoTemp(cubeFileName); + Cube outCubeNoTemp(cubeFileName.toStdString()); Pvl *outLabelNoTemp = outCubeNoTemp.label(); truthGroup = truthLabel.findGroup("Dimensions", Pvl::Traverse); @@ -678,7 +678,7 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportEisWacPb){ Pvl truthLabel; PvlInput >> truthLabel; - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup truthGroup = truthLabel.findGroup("Dimensions", Pvl::Traverse); @@ -706,7 +706,7 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportEisWacPb){ UserInterface optionsNoTemp(APP_XML, argsNoTemp); isisimport(optionsNoTemp); - Cube outCubeNoTemp(cubeFileName); + Cube outCubeNoTemp(cubeFileName.toStdString()); Pvl *outLabelNoTemp = outCubeNoTemp.label(); truthGroup = truthLabel.findGroup("Dimensions", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsIsisImportKaguyaMI.cpp b/isis/tests/FunctionalTestsIsisImportKaguyaMI.cpp index 817a908e93..7eee5c6d37 100644 --- a/isis/tests/FunctionalTestsIsisImportKaguyaMI.cpp +++ b/isis/tests/FunctionalTestsIsisImportKaguyaMI.cpp @@ -20,7 +20,7 @@ using namespace Isis; using namespace testing; using json = nlohmann::json; -static QString APP_XML = FileName("$ISISROOT/bin/xml/isisimport.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/isisimport.xml").expanded()); TEST_F(TempTestingFiles, FunctionalTestIsisImportKaguyamiVis) { QTemporaryDir prefix; @@ -32,10 +32,10 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportKaguyamiVis) { isisimport(options); } catch (IException &e) { - FAIL() << "Unable to ingest Kaguya MI image: " < hist (cube.histogram()); EXPECT_EQ(hist->ValidPixels(), 79); @@ -234,10 +234,10 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportKaguyamiHrsRange) { isisimport(options); } catch (IException &e) { - FAIL() << "Unable to ingest Kaguya MI image: " < hist (cube.histogram()); EXPECT_EQ(hist->ValidPixels(), 79); @@ -258,10 +258,10 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportKaguyamiHisRange) { isisimport(options); } catch (IException &e) { - FAIL() << "Unable to ingest Kaguya MI image: " < hist (cube.histogram()); EXPECT_EQ(hist->ValidPixels(), 79); @@ -282,10 +282,10 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportKaguyamiLrsRange) { isisimport(options); } catch (IException &e) { - FAIL() << "Unable to ingest Kaguya MI image: " < hist (cube.histogram()); EXPECT_EQ(hist->ValidPixels(), 79); @@ -306,10 +306,10 @@ TEST_F(TempTestingFiles, FunctionalTestIsisImportKaguyamiLisRange) { isisimport(options); } catch (IException &e) { - FAIL() << "Unable to ingest Kaguya MI image: " < hist (cube.histogram()); EXPECT_EQ(hist->ValidPixels(), 79); diff --git a/isis/tests/FunctionalTestsIsisImportKaguyaTC.cpp b/isis/tests/FunctionalTestsIsisImportKaguyaTC.cpp index 5065049bed..b38a0753ac 100644 --- a/isis/tests/FunctionalTestsIsisImportKaguyaTC.cpp +++ b/isis/tests/FunctionalTestsIsisImportKaguyaTC.cpp @@ -18,7 +18,7 @@ using namespace Isis; using json = nlohmann::json; -static QString APP_XML = FileName("$ISISROOT/bin/xml/isisimport.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/isisimport.xml").expanded()); TEST_F(TempTestingFiles, FunctionalTestIsisImportKaguyaTC) { std::istringstream PvlInput(R"( diff --git a/isis/tests/FunctionalTestsIsisImportLo.cpp b/isis/tests/FunctionalTestsIsisImportLo.cpp index 341e1bb26e..a45d1ee036 100644 --- a/isis/tests/FunctionalTestsIsisImportLo.cpp +++ b/isis/tests/FunctionalTestsIsisImportLo.cpp @@ -20,7 +20,7 @@ using namespace Isis; using namespace testing; using json = nlohmann::json; -static QString APP_XML = FileName("$ISISROOT/bin/xml/isisimport.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/isisimport.xml").expanded()); TEST(IsisImportTests, loTestDefault) { QTemporaryDir prefix; @@ -32,10 +32,10 @@ TEST(IsisImportTests, loTestDefault) { isisimport(options); } catch (IException &e) { - FAIL() << "Unable to ingest LO image: " < Something )"; ofxml.close(); OriginalXmlLabel origLabel; - origLabel.readFromXmlFile(labelFileName); + origLabel.readFromXmlFile(labelFileName.toStdString()); testCube->write(origLabel); QString templateFile = tempDir.path()+"/test_result.tpl"; diff --git a/isis/tests/FunctionalTestsJigsaw.cpp b/isis/tests/FunctionalTestsJigsaw.cpp index 64f1ee4e70..43c1ec6d9c 100644 --- a/isis/tests/FunctionalTestsJigsaw.cpp +++ b/isis/tests/FunctionalTestsJigsaw.cpp @@ -28,7 +28,7 @@ using namespace Isis; using namespace testing; -static QString APP_XML = FileName("$ISISROOT/bin/xml/jigsaw.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/jigsaw.xml").expanded()); TEST_F(ApolloNetwork, FunctionalTestJigsawApollo) { QVector args = {"radius=yes", @@ -499,8 +499,8 @@ TEST_F(ObservationPair, FunctionalTestJigsawCamSolveAll) { } // images were updated - cubeL = new Cube(cubeLPath, "r"); - cubeR = new Cube(cubeRPath, "r"); + cubeL = new Cube(cubeLPath.toStdString(), "r"); + cubeR = new Cube(cubeRPath.toStdString(), "r"); ControlNet oNet; oNet.ReadControl(outCnetFileName); @@ -622,8 +622,8 @@ TEST_F(ApolloNetwork, FunctionalTestJigsawHeldList) { QString heldlistpath = prefix.path() + "/heldlist.lis"; FileList heldList; - heldList.append(cubes[5]->fileName()); - heldList.write(heldlistpath); + heldList.append(cubes[5]->fileName().toStdString()); + heldList.write(heldlistpath.toStdString()); QString outCnetFileName = prefix.path() + "/outTemp.net"; QVector args = {"fromlist="+cubeListFile, "cnet="+controlNetPath, "onet="+outCnetFileName, "heldlist="+heldlistpath, @@ -1353,7 +1353,7 @@ TEST_F(VikThmNetwork, FunctionalTestJigsawScconfigHeld) { QString heldListPath = prefix.path() + "/heldlist.lis"; FileList heldList; heldList.append("data/vikingThemisNetwork/I28234014RDR_crop.cub"); - heldList.write(heldListPath); + heldList.write(heldListPath.toStdString()); QString outCnetFileName = prefix.path() + "/outTemp.net"; QString scconfigPath = "data/vikingThemisNetwork/themis_vo.pvl"; @@ -1671,31 +1671,31 @@ TEST_F(CSMNetwork, FunctionalTestJigsawCSM) { "Test_J.cub, 2.76E-12, 9.95E-14, 1.96E-12, -0.0625, 0.0625," "-2.63E-17, 0.016650391, 0, -0.03125, 0.03125, 6.23E-15, 0.016650391", 1); - Cube testB(tempDir.path() + "/Test_B.cub"); + Cube testB(tempDir.path().toStdString() + "/Test_B.cub"); CSMCamera *camB = dynamic_cast(testB.camera()); EXPECT_NEAR(camB->getParameterValue(0), 3.0, 0.00000001); EXPECT_NEAR(camB->getParameterValue(1), 0.0, 0.00000001); EXPECT_NEAR(camB->getParameterValue(2), 256.0, 0.00000001); - Cube testD(tempDir.path() + "/Test_D.cub"); + Cube testD(tempDir.path().toStdString() + "/Test_D.cub"); CSMCamera *camD = dynamic_cast(testD.camera()); EXPECT_NEAR(camD->getParameterValue(0), 0.0, 0.00000001); EXPECT_NEAR(camD->getParameterValue(1), -3.0, 0.00000001); EXPECT_NEAR(camD->getParameterValue(2), 256.0, 0.00000001); - Cube testF(tempDir.path() + "/Test_F.cub"); + Cube testF(tempDir.path().toStdString() + "/Test_F.cub"); CSMCamera *camF = dynamic_cast(testF.camera()); EXPECT_NEAR(camF->getParameterValue(0), 0.0, 0.00000001); EXPECT_NEAR(camF->getParameterValue(1), 3.0, 0.00000001); EXPECT_NEAR(camF->getParameterValue(2), 256.0, 0.00000001); - Cube testH(tempDir.path() + "/Test_H.cub"); + Cube testH(tempDir.path().toStdString() + "/Test_H.cub"); CSMCamera *camH = dynamic_cast(testH.camera()); EXPECT_NEAR(camH->getParameterValue(0), -3.0, 0.00000001); EXPECT_NEAR(camH->getParameterValue(1), 0.0, 0.00000001); EXPECT_NEAR(camH->getParameterValue(2), 256.0, 0.00000001); - Cube testJ(tempDir.path() + "/Test_J.cub"); + Cube testJ(tempDir.path().toStdString() + "/Test_J.cub"); CSMCamera *camJ = dynamic_cast(testJ.camera()); EXPECT_NEAR(camJ->getParameterValue(0), 0.0, 0.00000001); EXPECT_NEAR(camJ->getParameterValue(1), 0.0, 0.00000001); @@ -1709,13 +1709,13 @@ TEST_F(LidarNetwork, FunctionalTestJigsawLidar) { QString cube2fname = tempDir.path() + "/lidarObservationPair2Copy.cub"; cube1->reopen("rw"); cube2->reopen("rw"); - QScopedPointer cube1Copy( cube1->copy(cube1fname, CubeAttributeOutput()) ); - QScopedPointer cube2Copy( cube2->copy(cube2fname, CubeAttributeOutput()) ); + QScopedPointer cube1Copy( cube1->copy(cube1fname.toStdString(), CubeAttributeOutput()) ); + QScopedPointer cube2Copy( cube2->copy(cube2fname.toStdString(), CubeAttributeOutput()) ); FileList cubeListCopy; - cubeListCopy.append(cube1Copy->fileName()); - cubeListCopy.append(cube2Copy->fileName()); + cubeListCopy.append(cube1Copy->fileName().toStdString()); + cubeListCopy.append(cube2Copy->fileName().toStdString()); cube1->close(); cube2->close(); @@ -1723,7 +1723,7 @@ TEST_F(LidarNetwork, FunctionalTestJigsawLidar) { cube2Copy->close(); QString cubeListFileCopy = tempDir.path() + "/cubesCopy.lis"; - cubeListCopy.write(cubeListFileCopy); + cubeListCopy.write(cubeListFileCopy.toStdString()); // call jigsaw w/o lidar options & apply=true on copy of images QVector args1 = {"radius=yes", @@ -1770,10 +1770,10 @@ TEST_F(LidarNetwork, FunctionalTestJigsawLidar) { // re-open all cubes // Make a new cube object to get the updated camera models after bundle adjust - Cube bundledCube1(cube1Path); - Cube bundledCube2(cube2Path); - Cube bundledCube1Copy(cube1fname); - Cube bundledCube2Copy(cube2fname); + Cube bundledCube1(cube1Path.toStdString()); + Cube bundledCube2(cube2Path.toStdString()); + Cube bundledCube1Copy(cube1fname.toStdString()); + Cube bundledCube2Copy(cube2fname.toStdString()); std::map noLidarCameras; std::map lidarCameras; @@ -1813,9 +1813,9 @@ TEST_F(LidarNetwork, FunctionalTestJigsawLidar) { } LidarData lidarDataIn; - lidarDataIn.read(lidarDataPath); + lidarDataIn.read(lidarDataPath.toStdString()); LidarData lidarDataOut; - lidarDataOut.read(tempDir.path() + "/lidar_out.json"); + lidarDataOut.read(tempDir.path().toStdString() + "/lidar_out.json"); QFile bo(tempDir.path() + "/lidar_bundleout.txt"); QString contents; diff --git a/isis/tests/FunctionalTestsJitterfit.cpp b/isis/tests/FunctionalTestsJitterfit.cpp index 718fa076c5..df63209f59 100644 --- a/isis/tests/FunctionalTestsJitterfit.cpp +++ b/isis/tests/FunctionalTestsJitterfit.cpp @@ -8,7 +8,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/jitterfit.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/jitterfit.xml").expanded()); TEST_F(TempTestingFiles, DISABLED_FunctionalTestJitterfitDefault){ QTemporaryDir prefix; QString outputCoeffs = prefix.path() + "/coef.csv"; @@ -68,7 +68,7 @@ TEST_F(TempTestingFiles, DISABLED_FunctionalTestJitterfitDefault){ EXPECT_DOUBLE_EQ(csvLine[1].toDouble(), 0.0032581267520383002); // Test coefficients that were written to cube - Cube cube(dataCube); + Cube cube(dataCube.toStdString()); Pvl *isisLabel = cube.label(); PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsKaguyami2isis.cpp b/isis/tests/FunctionalTestsKaguyami2isis.cpp index 7cdc982c2e..6a083bbf85 100644 --- a/isis/tests/FunctionalTestsKaguyami2isis.cpp +++ b/isis/tests/FunctionalTestsKaguyami2isis.cpp @@ -14,7 +14,7 @@ using namespace Isis; using namespace testing; -static QString APP_XML = FileName("$ISISROOT/bin/xml/kaguyatc2isis.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/kaguyatc2isis.xml").expanded()); TEST(kaguyatc2isisTest, FunctionalTestKaguyami2isisVis) { QTemporaryDir prefix; @@ -26,10 +26,10 @@ TEST(kaguyatc2isisTest, FunctionalTestKaguyami2isisVis) { kaguyami2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest Kaguya MI image: " < hist (cube.histogram()); EXPECT_EQ(hist->ValidPixels(), 79); @@ -225,10 +225,10 @@ TEST(kaguyatc2isisTest, FunctionalTestKaguyami2isisHrsRange) { kaguyami2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest Kaguya MI image: " < hist (cube.histogram()); EXPECT_EQ(hist->ValidPixels(), 79); @@ -249,10 +249,10 @@ TEST(kaguyatc2isisTest, FunctionalTestKaguyami2isisHisRange) { kaguyami2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest Kaguya MI image: " < hist (cube.histogram()); EXPECT_EQ(hist->ValidPixels(), 79); @@ -273,10 +273,10 @@ TEST(kaguyatc2isisTest, FunctionalTestKaguyami2isisLrsRange) { kaguyami2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest Kaguya MI image: " < hist (cube.histogram()); EXPECT_EQ(hist->ValidPixels(), 79); @@ -297,10 +297,10 @@ TEST(kaguyatc2isisTest, FunctionalTestKaguyami2isisLisRange) { kaguyami2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest Kaguya MI image: " < hist (cube.histogram()); EXPECT_EQ(hist->ValidPixels(), 79); diff --git a/isis/tests/FunctionalTestsKaguyatc2isis.cpp b/isis/tests/FunctionalTestsKaguyatc2isis.cpp index 8b68de84a9..6aab5e9474 100644 --- a/isis/tests/FunctionalTestsKaguyatc2isis.cpp +++ b/isis/tests/FunctionalTestsKaguyatc2isis.cpp @@ -11,7 +11,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/kaguyatc2isis.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/kaguyatc2isis.xml").expanded()); TEST(kaguyatc2isisTest, kaguyatc2isisTestDefault) { Pvl appLog; @@ -24,10 +24,10 @@ TEST(kaguyatc2isisTest, kaguyatc2isisTestDefault) { kaguyatc2isis(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to ingest Kaguya TC image: " < args = {"from=data/leisa2isis/raw.fit", @@ -259,10 +259,10 @@ TEST(Leisa2Isis, Leisa2IsisTestRaw) { leisa2isis(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to ingest LEISA image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest LEISA image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group @@ -324,7 +324,7 @@ TEST(Leisa2Isis, Leisa2IsisTestRaw) { TEST(Leisa2Isis, Leisa2IsisTestRawErrormapFail) { Pvl appLog; QTemporaryDir prefix; - QString dAPP_XML = FileName("$ISISROOT/bin/xml/leisa2isis.xml").expanded(); + QString dAPP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/leisa2isis.xml").expanded()); QString cubeFileName = prefix.path() + "/leisa2isisTEMP.cub"; QString errFileName = prefix.path() + "/leisa2isisTEMPerr.cub"; @@ -341,7 +341,7 @@ TEST(Leisa2Isis, Leisa2IsisTestRawErrormapFail) { TEST(Leisa2Isis, Leisa2IsisTestRawQualityFail) { Pvl appLog; QTemporaryDir prefix; - QString dAPP_XML = FileName("$ISISROOT/bin/xml/leisa2isis.xml").expanded(); + QString dAPP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/leisa2isis.xml").expanded()); QString cubeFileName = prefix.path() + "/leisa2isisTEMP.cub"; QString qualityFileName = prefix.path() + "/leisa2isisTEMPqual.cub"; @@ -368,9 +368,9 @@ TEST(Leisa2Isis, Leisa2IsisTestQualityReplacement) { leisa2isis(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to ingest LEISA image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest LEISA image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Histogram *hist = cube.histogram(); diff --git a/isis/tests/FunctionalTestsLo2isis.cpp b/isis/tests/FunctionalTestsLo2isis.cpp index c2b57a47d7..665f5196ae 100644 --- a/isis/tests/FunctionalTestsLo2isis.cpp +++ b/isis/tests/FunctionalTestsLo2isis.cpp @@ -12,7 +12,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/lo2isis.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/lo2isis.xml").expanded()); TEST(lo2isisTest, lo2isisTestDefault) { QTemporaryDir prefix; @@ -24,10 +24,10 @@ TEST(lo2isisTest, lo2isisTestDefault) { lo2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest LO image: " < args = {"from=" + cubeLPath, diff --git a/isis/tests/FunctionalTestsLronaccal.cpp b/isis/tests/FunctionalTestsLronaccal.cpp index 0d16795db6..159f8bb9a5 100644 --- a/isis/tests/FunctionalTestsLronaccal.cpp +++ b/isis/tests/FunctionalTestsLronaccal.cpp @@ -30,7 +30,7 @@ using namespace testing; * cub since fx is not yet callable */ -static QString APP_XML = FileName("$ISISROOT/bin/xml/lronaccal.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/lronaccal.xml").expanded()); TEST(LronaccalDefault, FunctionalTestsLronaccal) { QTemporaryDir outputDir; @@ -53,16 +53,16 @@ TEST(LronaccalDefault, FunctionalTestsLronaccal) { lronaccal(options); } catch (IException &e) { - FAIL() << "Unable to calibrate the LRO image: " < argsCrop = {"from=" + oCubeFile, "to=" + oCubeCropFile, "sample=80", "nsamples=80", "line=80", "nlines=80"}; UserInterface options2(CROP_XML, argsCrop); crop(options2); - Cube oCube(oCubeCropFile, "r"); - Cube tCube(tCubeFile, "r"); + Cube oCube(oCubeCropFile.toStdString(), "r"); + Cube tCube(tCubeFile.toStdString(), "r"); Histogram *oCubeStats = oCube.histogram(); Histogram *tCubeStats = tCube.histogram(); @@ -76,7 +76,7 @@ TEST(LronaccalDefault, FunctionalTestsLronaccal) { oCube.close(); } catch(IException &e){ - FAIL() << "Unable to compare stats: " < argsCrop = {"from=" + oCubeFile, "to=" + oCubeCropFile, "sample=80", "nsamples=80", "line=80", "nlines=80"}; UserInterface options2(CROP_XML, argsCrop); crop(options2); - Cube oCube(oCubeCropFile, "r"); - Cube tCube(tCubeFile, "r"); + Cube oCube(oCubeCropFile.toStdString(), "r"); + Cube tCube(tCubeFile.toStdString(), "r"); Histogram *oCubeStats = oCube.histogram(); Histogram *tCubeStats = tCube.histogram(); @@ -124,7 +124,7 @@ TEST(LronaccalNear, FunctionalTestsLronaccal) { oCube.close(); } catch(IException &e){ - FAIL() << "Unable to open output cube: " < argsCrop = {"from=" + oCubeFile, "to=" + oCubeCropFile, "sample=80", "nsamples=80", "line=80", "nlines=80"}; UserInterface options2(CROP_XML, argsCrop); crop(options2); - Cube oCube(oCubeCropFile, "r"); - Cube tCube(tCubeFile, "r"); + Cube oCube(oCubeCropFile.toStdString(), "r"); + Cube tCube(tCubeFile.toStdString(), "r"); Histogram *oCubeStats = oCube.histogram(); Histogram *tCubeStats = tCube.histogram(); @@ -168,7 +168,7 @@ TEST(LronaccalPair, FunctionalTestsLronaccal) { oCube.close(); } catch(IException &e){ - FAIL() << "Unable to open output cube: " < hist(outCube.histogram()); @@ -95,7 +95,7 @@ TEST(Lrowacphomap, FunctionalTestLrowacphomapNoBack) { double expectedMax = 155.67340087891; double expectedSum = 195764.77809525; - Cube outCube(outCubeFileName); + Cube outCube(outCubeFileName.toStdString()); std::unique_ptr hist(outCube.histogram()); @@ -135,7 +135,7 @@ TEST(Lrowacphomap, FunctionalTestLrowacphomapDefaultAlgoAndParCubeWithBack) { double expectedMax = 157.08757019043; double expectedSum = 192367.54685402; - Cube outCube(outCubeFileName); + Cube outCube(outCubeFileName.toStdString()); std::unique_ptr hist(outCube.histogram()); @@ -174,7 +174,7 @@ TEST(Lrowacphomap, FunctionalTestLrowacphomapDefaultAlgoAndParCubeNoBack) { double expectedMax = 152.65106201172; double expectedSum = 191020.53982925; - Cube outCube(outCubeFileName); + Cube outCube(outCubeFileName.toStdString()); std::unique_ptr hist(outCube.histogram()); diff --git a/isis/tests/FunctionalTestsMap2map.cpp b/isis/tests/FunctionalTestsMap2map.cpp index c7c6a516df..c7325837f9 100644 --- a/isis/tests/FunctionalTestsMap2map.cpp +++ b/isis/tests/FunctionalTestsMap2map.cpp @@ -12,7 +12,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/map2map.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/map2map.xml").expanded()); TEST_F(ThreeImageNetwork, FunctionalTestMap2mapDefault) { @@ -32,7 +32,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestMap2mapDefault) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube ocube(outCubeFileName); + Cube ocube(outCubeFileName.toStdString()); PvlGroup &mapping = ocube.label()->findObject("IsisCube").findGroup("Mapping"); @@ -83,7 +83,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestMap2mapKeywords) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube ocube(outCubeFileName); + Cube ocube(outCubeFileName.toStdString()); PvlGroup &mapping = ocube.label()->findObject("IsisCube").findGroup("Mapping"); @@ -135,7 +135,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestMap2mapKeywords) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube ocubeNoScale(noScaleFile); + Cube ocubeNoScale(noScaleFile.toStdString()); PvlGroup &mapNoScale = ocubeNoScale.label()->findObject("IsisCube").findGroup("Mapping"); @@ -186,7 +186,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestMap2mapUnits) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube ocube(outCubeFileName); + Cube ocube(outCubeFileName.toStdString()); PvlGroup &mapping = ocube.label()->findObject("IsisCube").findGroup("Mapping"); @@ -237,7 +237,7 @@ TEST(Map2mapTest, FunctionalTestMap2mapProjection) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube ocube(outCubeFileName); + Cube ocube(outCubeFileName.toStdString()); PvlGroup &mapping = ocube.label()->findObject("IsisCube").findGroup("Mapping"); diff --git a/isis/tests/FunctionalTestsMapmos.cpp b/isis/tests/FunctionalTestsMapmos.cpp index 124a0821da..f5a4b19740 100644 --- a/isis/tests/FunctionalTestsMapmos.cpp +++ b/isis/tests/FunctionalTestsMapmos.cpp @@ -13,7 +13,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/mapmos.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/mapmos.xml").expanded()); TEST_F(ThreeImageNetwork, FunctionalTestMapmosOntop) { QTemporaryDir prefix; @@ -43,10 +43,10 @@ TEST_F(ThreeImageNetwork, FunctionalTestMapmosOntop) { mapmos(cube3options, &appLog); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } - Cube mosaic(mosPath); + Cube mosaic(mosPath.toStdString()); PvlObject mosaicLabel = mosaic.label()->findObject("IsisCube"); PvlGroup dimensions = mosaicLabel.findObject("Core").findGroup("Dimensions"); @@ -95,10 +95,10 @@ TEST_F(ThreeImageNetwork, FunctionalTestMapmosBeneath) { mapmos(cube3options, &appLog); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } - Cube mosaic(mosPath); + Cube mosaic(mosPath.toStdString()); PvlObject mosaicLabel = mosaic.label()->findObject("IsisCube"); PvlGroup dimensions = mosaicLabel.findObject("Core").findGroup("Dimensions"); @@ -134,10 +134,10 @@ TEST_F(ThreeImageNetwork, FunctionalTestMapmosAverage) { mapmos(cube3options, &appLog); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } - Cube mosaic(mosPath); + Cube mosaic(mosPath.toStdString()); PvlObject mosaicLabel = mosaic.label()->findObject("IsisCube"); PvlGroup dimensions = mosaicLabel.findObject("Core").findGroup("Dimensions"); @@ -166,10 +166,10 @@ TEST_F(ThreeImageNetwork, FunctionalTestMapmos720deg) { mapmos(cube1map, options, &appLog); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } - Cube mosaic(mosPath); + Cube mosaic(mosPath.toStdString()); PvlObject mosaicLabel = mosaic.label()->findObject("IsisCube"); PvlGroup mapping = mosaicLabel.findGroup("Mapping"); @@ -196,10 +196,10 @@ TEST_F(ThreeImageNetwork, FunctionalTestMapmosExtents) { mapmos(cube1map, options, &appLog); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } - Cube mosaic(mosPath); + Cube mosaic(mosPath.toStdString()); PvlObject mosaicLabel = mosaic.label()->findObject("IsisCube"); PvlGroup dimensions = mosaicLabel.findObject("Core").findGroup("Dimensions"); @@ -222,17 +222,17 @@ TEST_F(ThreeImageNetwork, FunctionalTestMapmosTracking) { mapmos(cube1map, options, &appLog); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } - Cube mosaic(mosPath); + Cube mosaic(mosPath.toStdString()); PvlObject mosaicLabel = mosaic.label()->findObject("IsisCube"); PvlGroup bandbin = mosaicLabel.findGroup("BandBin"); PvlGroup tracking = mosaicLabel.findGroup("Tracking"); QString trackPath = prefix.path() + "/" + QString::fromStdString(tracking["FileName"][0]); try { - Cube trackCube(trackPath); + Cube trackCube(trackPath.toStdString()); PvlObject trackLabel = trackCube.label()->findObject("IsisCube"); PvlGroup dimensions = trackLabel.findObject("Core").findGroup("Dimensions"); @@ -241,7 +241,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestMapmosTracking) { EXPECT_EQ(int(dimensions["Bands"]), 1); } catch (IException &e) { - FAIL() << "Invalid FileName for tracking cube: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Invalid FileName for tracking cube: " << e.toString().c_str() << std::endl; } } @@ -260,10 +260,10 @@ TEST_F(ThreeImageNetwork, FunctionalTestMapmosMatchBandBin) { mapmos(cube1map, options, &appLog); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } - Cube mosaic(mosPath); + Cube mosaic(mosPath.toStdString()); PvlObject mosaicLabel = mosaic.label()->findObject("IsisCube"); PvlGroup dimensions = mosaicLabel.findObject("Core").findGroup("Dimensions"); @@ -288,10 +288,10 @@ TEST_F(ThreeImageNetwork, FunctionalTestMapmosBandNumber) { mapmos(cube1map, options, &appLog); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } - Cube mosaic(mosPath); + Cube mosaic(mosPath.toStdString()); PvlObject mosaicLabel = mosaic.label()->findObject("IsisCube"); PvlGroup dimensions = mosaicLabel.findObject("Core").findGroup("Dimensions"); @@ -317,10 +317,10 @@ TEST_F(ThreeImageNetwork, FunctionalTestMapmosKeyword) { mapmos(cube1map, options, &appLog); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } - Cube mosaic(mosPath); + Cube mosaic(mosPath.toStdString()); PvlObject mosaicLabel = mosaic.label()->findObject("IsisCube"); PvlGroup dimensions = mosaicLabel.findObject("Core").findGroup("Dimensions"); @@ -344,10 +344,10 @@ TEST_F(ThreeImageNetwork, FunctionalTestMapmosMatchDEM) { mapmos(cube1map, options, &appLog); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } - Cube mosaic(mosPath); + Cube mosaic(mosPath.toStdString()); PvlObject mosaicLabel = mosaic.label()->findObject("IsisCube"); PvlGroup dimensions = mosaicLabel.findObject("Core").findGroup("Dimensions"); @@ -371,7 +371,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestMapmosAppLog) { mapmos(cube1map, options, &appLog); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } PvlGroup location = appLog.findGroup("ImageLocation"); diff --git a/isis/tests/FunctionalTestsMappt.cpp b/isis/tests/FunctionalTestsMappt.cpp index 32f7175fa3..485f4ac666 100644 --- a/isis/tests/FunctionalTestsMappt.cpp +++ b/isis/tests/FunctionalTestsMappt.cpp @@ -14,7 +14,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/mappt.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/mappt.xml").expanded()); TEST_F(DefaultCube, FunctionalTestMapptImageTest) { QVector args = {"append=false", "type=image", "sample=1", "line=1"}; @@ -354,8 +354,8 @@ TEST_F(DefaultCube, FunctionalTestMapptBadColumnError) { FAIL() << "Expected an exception to be thrown"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Coordinate file formatted incorrectly.")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Coordinate file formatted incorrectly.") != std::string::npos) + << e.toString(); } catch(...) { FAIL() << "Expected an IException with message: \"Coordinate file formatted incorrectly.\n" diff --git a/isis/tests/FunctionalTestsMaptrim.cpp b/isis/tests/FunctionalTestsMaptrim.cpp index bacb55f265..ff28e1b75f 100644 --- a/isis/tests/FunctionalTestsMaptrim.cpp +++ b/isis/tests/FunctionalTestsMaptrim.cpp @@ -19,7 +19,7 @@ using namespace Isis; using testing::HasSubstr; -static QString APP_XML = FileName("$ISISROOT/bin/xml/maptrim.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/maptrim.xml").expanded()); TEST_F(DefaultCube, FunctionalTestMaptrimDefault){ QTemporaryDir prefix; @@ -40,7 +40,7 @@ TEST_F(DefaultCube, FunctionalTestMaptrimDefault){ FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube cube(outCubeFileName); + Cube cube(outCubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions group @@ -156,7 +156,7 @@ TEST_F(DefaultCube, FunctionalTestMaptrimBoth){ FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube cube(outCubeFileName); + Cube cube(outCubeFileName.toStdString()); // Dimensions group EXPECT_EQ(cube.sampleCount(), 3); @@ -191,7 +191,7 @@ TEST_F(DefaultCube, FunctionalTestMaptrimCrop){ FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube cube(outCubeFileName); + Cube cube(outCubeFileName.toStdString()); EXPECT_EQ(cube.sampleCount(), 3); EXPECT_EQ(cube.lineCount(), 3); @@ -220,7 +220,7 @@ TEST_F(DefaultCube, FunctionalTestMaptrimLabelRanges){ FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube cube(outCubeFileName); + Cube cube(outCubeFileName.toStdString()); EXPECT_EQ(cube.sampleCount(), 6); EXPECT_EQ(cube.lineCount(), 6); diff --git a/isis/tests/FunctionalTestsMarci2isis.cpp b/isis/tests/FunctionalTestsMarci2isis.cpp index f586e98faa..781bdeb68f 100644 --- a/isis/tests/FunctionalTestsMarci2isis.cpp +++ b/isis/tests/FunctionalTestsMarci2isis.cpp @@ -9,7 +9,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/marci2isis.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/marci2isis.xml").expanded()); TEST(Marci2Isis, Marci2isisTestDefault) { Pvl appLog; @@ -22,8 +22,8 @@ TEST(Marci2Isis, Marci2isisTestDefault) { QString cubeFileNameEven = prefix.path() + "/marci2isis_out.even.cub"; QString cubeFileNameOdd = prefix.path() + "/marci2isis_out.odd.cub"; - Cube cubeEven(cubeFileNameEven); - Cube cubeOdd(cubeFileNameOdd); + Cube cubeEven(cubeFileNameEven.toStdString()); + Cube cubeOdd(cubeFileNameOdd.toStdString()); Pvl *evenLabel = cubeEven.label(); Pvl *oddLabel = cubeOdd.label(); @@ -153,7 +153,7 @@ TEST(Marci2Isis, Marci2isisTestDefaultUnFlipped) { marci2isis(options, &appLog); QString cubeFileNameEven = prefix.path() + "/marci2isis_out.even.cub"; - Cube cubeEven(cubeFileNameEven); + Cube cubeEven(cubeFileNameEven.toStdString()); Pvl *evenLabel = cubeEven.label(); PvlGroup &evenInst = evenLabel->findGroup("Instrument", Pvl::Traverse); @@ -170,7 +170,7 @@ TEST(Marci2Isis, Marci2isisTestColorOffset) { marci2isis(options, &appLog); QString cubeFileNameEven = prefix.path() + "/marci2isis_out.even.cub"; - Cube cubeEven(cubeFileNameEven); + Cube cubeEven(cubeFileNameEven.toStdString()); Pvl *evenLabel = cubeEven.label(); ASSERT_EQ((int)evenLabel->findKeyword("TileLines", Pvl::Traverse), 86); @@ -204,12 +204,12 @@ TEST(Marci2Isis, Marci2isisTestVarExp) { // get output from each call QString outFileNameFlipped = prefix.path() + "/marci2isis_out.even.cub"; - Cube cubeFlipped(outFileNameFlipped); + Cube cubeFlipped(outFileNameFlipped.toStdString()); Pvl *labelFlipped = cubeFlipped.label(); PvlGroup instFlipped = labelFlipped->findGroup("Instrument", Pvl::Traverse); QString outFileNameUnflipped = prefix.path() + "/marci2isis_out_unflipped.even.cub"; - Cube cubeUnflipped(outFileNameUnflipped); + Cube cubeUnflipped(outFileNameUnflipped.toStdString()); Pvl *labelUnflipped = cubeUnflipped.label(); PvlGroup instUnflipped = labelUnflipped->findGroup("Instrument", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsMarcical.cpp b/isis/tests/FunctionalTestsMarcical.cpp index a19de770b9..a1260d63a1 100644 --- a/isis/tests/FunctionalTestsMarcical.cpp +++ b/isis/tests/FunctionalTestsMarcical.cpp @@ -11,7 +11,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/marcical.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/marcical.xml").expanded()); TEST(Marcical, MarcicalTestDefault) { QTemporaryDir prefix; @@ -20,7 +20,7 @@ TEST(Marcical, MarcicalTestDefault) { UserInterface options(APP_XML, args); marcical(options); - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *label = outCube.label(); PvlGroup &dims = label->findGroup("Dimensions", Pvl::Traverse); @@ -47,7 +47,7 @@ TEST(Marcical, MarcicalTestDefaultNoIof) { UserInterface options(APP_XML, args); marcical(options); - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *label = outCube.label(); PvlGroup &dims = label->findGroup("Dimensions", Pvl::Traverse); @@ -74,7 +74,7 @@ TEST(Marcical, MarcicalTestSingleDuration) { UserInterface options(APP_XML, args); marcical(options); - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *label = outCube.label(); PvlGroup &dims = label->findGroup("Dimensions", Pvl::Traverse); @@ -99,7 +99,7 @@ TEST(Marcical, MarcicalTestSingleDurationNoIof) { UserInterface options(APP_XML, args); marcical(options); - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *label = outCube.label(); PvlGroup &dims = label->findGroup("Dimensions", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsMarciflip.cpp b/isis/tests/FunctionalTestsMarciflip.cpp index 7b523efbea..85e1c205bb 100644 --- a/isis/tests/FunctionalTestsMarciflip.cpp +++ b/isis/tests/FunctionalTestsMarciflip.cpp @@ -12,7 +12,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/marciflip.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/marciflip.xml").expanded()); TEST(Marciflip, MarciflipTestDefault) { QTemporaryDir prefix; @@ -22,8 +22,8 @@ TEST(Marciflip, MarciflipTestDefault) { UserInterface options(APP_XML, args); marciflip(options); - Cube inCube(inCubeFn); - Cube outCube(outCubeFn); + Cube inCube(inCubeFn.toStdString()); + Cube outCube(outCubeFn.toStdString()); Pvl *label = outCube.label(); PvlGroup &dims = label->findGroup("Dimensions", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsMimap2isis.cpp b/isis/tests/FunctionalTestsMimap2isis.cpp index df166870b6..718b22836c 100644 --- a/isis/tests/FunctionalTestsMimap2isis.cpp +++ b/isis/tests/FunctionalTestsMimap2isis.cpp @@ -11,7 +11,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/mimap2isis.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/mimap2isis.xml").expanded()); TEST(FunctionalTestMimap2Isis, Default) { QTemporaryDir prefix; @@ -23,10 +23,10 @@ TEST(FunctionalTestMimap2Isis, Default) { mimap2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest MI MAP image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest MI MAP image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group @@ -326,10 +326,10 @@ TEST(FunctionalTestMimap2Isis, L3C) { mimap2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest MI MAP image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest MI MAP image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Archive Group @@ -554,10 +554,10 @@ TEST(FunctionalTestMimap2Isis, MAPv3) { mimap2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest MI MAP image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest MI MAP image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Archive Group @@ -782,10 +782,10 @@ TEST(FunctionalTestMimap2Isis, SpecialPixels) { mimap2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest MI MAP image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest MI MAP image: " << e.toString().c_str() << std::endl; } - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); std::unique_ptr hist(outCube.histogram()); EXPECT_EQ(hist->LrsPixels(), 2); diff --git a/isis/tests/FunctionalTestsMoccal.cpp b/isis/tests/FunctionalTestsMoccal.cpp index 104b0f0e9f..452e4543ac 100644 --- a/isis/tests/FunctionalTestsMoccal.cpp +++ b/isis/tests/FunctionalTestsMoccal.cpp @@ -10,7 +10,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/moccal.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/moccal.xml").expanded()); TEST_F(MgsMocCube, FunctionalTestMoccalDefault) { QString outCubeFileName = tempDir.path() + "/outTemp.cub"; @@ -25,7 +25,7 @@ TEST_F(MgsMocCube, FunctionalTestMoccalDefault) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); PvlGroup radGroup = oCube.label()->findObject("IsisCube").findGroup("Radiometry"); @@ -61,7 +61,7 @@ TEST_F(MgsMocCube, FunctionalTestMoccalIofFalse) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); PvlGroup radGroup = oCube.label()->findObject("IsisCube").findGroup("Radiometry"); @@ -98,7 +98,7 @@ TEST_F(MgsMocCube, FunctionalTestMoccalNullwagoTrue) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); PvlGroup radGroup = oCube.label()->findObject("IsisCube").findGroup("Radiometry"); @@ -148,8 +148,8 @@ TEST_F(MgsMocCube, FunctionalTestMoccalCameraComparison) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube oNoCamCube(outCubeFileNameCam, "r"); - Cube oCamCube(outCubeFileNameCam, "r"); + Cube oNoCamCube(outCubeFileNameCam.toStdString(), "r"); + Cube oCamCube(outCubeFileNameCam.toStdString(), "r"); PvlGroup noCamLab = oNoCamCube.label()->findObject("IsisCube").findGroup("Radiometry"); PvlGroup camLab = oCamCube.label()->findObject("IsisCube").findGroup("Radiometry"); diff --git a/isis/tests/FunctionalTestsMosrange.cpp b/isis/tests/FunctionalTestsMosrange.cpp index 1d740808d6..d3403eaf60 100644 --- a/isis/tests/FunctionalTestsMosrange.cpp +++ b/isis/tests/FunctionalTestsMosrange.cpp @@ -12,7 +12,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/mosrange.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/mosrange.xml").expanded()); /** * MosrangeDefault @@ -34,7 +34,7 @@ TEST(Mosrange, MosrangeDefault) { results = mosrange(options); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } PvlGroup &mapping = results.findGroup("Mapping", Pvl::Traverse); @@ -81,7 +81,7 @@ TEST(Mosrange, MosrangeOnErrorContinue) { results = mosrange(options); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } PvlGroup &mapping = results.findGroup("Mapping", Pvl::Traverse); @@ -133,8 +133,8 @@ TEST(Mosrange, MosrangeOnErrorFail) { FAIL() << "Expected Exception for a cube that hasn't been spiceinited"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Unable to initialize camera model")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Unable to initialize camera model") != std::string::npos) + << e.toString(); } // try to read back error log pvl output file @@ -158,8 +158,8 @@ TEST(Mosrange, MosrangeOnErrorFail) { ASSERT_EQ(errorFileFullPath.fileName(), "EN0108828337M_noSPICE.cub"); // confirm bad cube needs to be re-spiceinited - std::string errorType = QString::fromStdString(errorFile.findKeyword("Error")); - ASSERT_TRUE(errorType.contains("re-run spiceinit")); + std::string errorType = errorFile.findKeyword("Error"); + ASSERT_TRUE(errorType.find("re-run spiceinit") != std::string::npos); // try to read back errorList output file QFile errorListFile(tempDir.path() + "/errorList.txt"); diff --git a/isis/tests/FunctionalTestsMsi2isis.cpp b/isis/tests/FunctionalTestsMsi2isis.cpp index 799f459c0f..46bf16c7df 100644 --- a/isis/tests/FunctionalTestsMsi2isis.cpp +++ b/isis/tests/FunctionalTestsMsi2isis.cpp @@ -13,7 +13,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/msi2isis.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/msi2isis.xml").expanded()); TEST_F(TempTestingFiles, Msi2isisTestGblIngestDefault) { Pvl appLog; @@ -26,9 +26,9 @@ TEST_F(TempTestingFiles, Msi2isisTestGblIngestDefault) { msi2isis(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to ingest NEAR/MSI GBL file: " << e.toString().toStdString() << std::endl; + FAIL() << "Unable to ingest NEAR/MSI GBL file: " << e.toString() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group @@ -138,9 +138,9 @@ TEST_F(TempTestingFiles, Msi2isisTestGblIngestNoTrim) { msi2isis(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to ingest NEAR/MSI GBL file: " << e.toString().toStdString() << std::endl; + FAIL() << "Unable to ingest NEAR/MSI GBL file: " << e.toString() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); // Dimensions Group ASSERT_EQ(cube.sampleCount(), 537); @@ -215,9 +215,9 @@ TEST_F(TempTestingFiles, Msi2isisTestCubicConvolution) { msi2isis(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to ingest NEAR/MSI file: " << e.toString().toStdString() << std::endl; + FAIL() << "Unable to ingest NEAR/MSI file: " << e.toString() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group @@ -280,9 +280,9 @@ TEST_F(TempTestingFiles, Msi2isisTestNearestNeighbor) { msi2isis(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to ingest NEAR/MSI file: " << e.toString().toStdString() << std::endl; + FAIL() << "Unable to ingest NEAR/MSI file: " << e.toString() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); // Dimensions Group ASSERT_EQ(cube.sampleCount(), 537); @@ -312,9 +312,9 @@ TEST_F(TempTestingFiles, Msi2isisTestBilinear) { msi2isis(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to ingest NEAR/MSI file: " << e.toString().toStdString() << std::endl; + FAIL() << "Unable to ingest NEAR/MSI file: " << e.toString() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); // Dimensions Group ASSERT_EQ(cube.sampleCount(), 537); diff --git a/isis/tests/FunctionalTestsMvic2isis.cpp b/isis/tests/FunctionalTestsMvic2isis.cpp index 2aa10ea460..782933f988 100644 --- a/isis/tests/FunctionalTestsMvic2isis.cpp +++ b/isis/tests/FunctionalTestsMvic2isis.cpp @@ -15,13 +15,13 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/mvic2isis.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/mvic2isis.xml").expanded()); TEST_F(TempTestingFiles, Mvic2IsisTestTdiMode) { Pvl appLog; QString cubeFileName = tempDir.path() + "/mvic2isisTEMP.cub"; QString undistortedCubeName = tempDir.path() + "/mvic2isisUndistorted.cub"; - std::string errorCubeName = tempDir.path() + "/mvic2isisError.cub"; + QString errorCubeName = tempDir.path() + "/mvic2isisError.cub"; QString qualityCubeName = tempDir.path() + "/mvic2isisQuality.cub"; QVector args = {"from=data/mvic2isis/mc3_0034948318_0x536_sci_1_cropped.fits", "to=" + cubeFileName, @@ -34,9 +34,9 @@ TEST_F(TempTestingFiles, Mvic2IsisTestTdiMode) { mvic2isis(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to ingest MVIC image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest MVIC image: " << e.toString().c_str() << std::endl; } - std::unique_ptr cube (new Cube(cubeFileName)); + std::unique_ptr cube (new Cube(cubeFileName.toStdString())); Pvl *isisLabel = cube->label(); // Dimensions Group @@ -118,21 +118,21 @@ TEST_F(TempTestingFiles, Mvic2IsisTestTdiMode) { try { cube->open(undistortedCubeName); } catch(IException &e) { - FAIL() << "Unable to open undistorted output MVIC cube: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to open undistorted output MVIC cube: " << e.toString().c_str() << std::endl; } cube->close(); try { cube->open(errorCubeName); } catch(IException &e) { - FAIL() << "Unable to open error output MVIC cube: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to open error output MVIC cube: " << e.toString().c_str() << std::endl; } cube->close(); try { cube->open(qualityCubeName); } catch(IException &e) { - FAIL() << "Unable to open quality output MVIC cube: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to open quality output MVIC cube: " << e.toString().c_str() << std::endl; } } @@ -146,9 +146,9 @@ TEST_F(TempTestingFiles, Mvic2IsisTestPanMode) { mvic2isis(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to ingest MVIC image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest MVIC image: " << e.toString().c_str() << std::endl; } - std::unique_ptr cube (new Cube(cubeFileName)); + std::unique_ptr cube (new Cube(cubeFileName.toStdString())); Pvl *isisLabel = cube->label(); // Instrument Group @@ -205,9 +205,9 @@ TEST_F(TempTestingFiles, Mvic2IsisTestFrameMode) { mvic2isis(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to ingest MVIC image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest MVIC image: " << e.toString().c_str() << std::endl; } - std::unique_ptr cube (new Cube(cubeFileName)); + std::unique_ptr cube (new Cube(cubeFileName.toStdString())); Pvl *isisLabel = cube->label(); // Instrument Group @@ -265,9 +265,9 @@ TEST_F(TempTestingFiles, Mvic2IsisTestUncalibrated) { mvic2isis(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to ingest MVIC image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest MVIC image: " << e.toString().c_str() << std::endl; } - std::unique_ptr cube (new Cube(cubeFileName)); + std::unique_ptr cube (new Cube(cubeFileName.toStdString())); Pvl *isisLabel = cube->label(); // Instrument Group diff --git a/isis/tests/FunctionalTestsNocam2map.cpp b/isis/tests/FunctionalTestsNocam2map.cpp index 6c6087f403..451712c74d 100644 --- a/isis/tests/FunctionalTestsNocam2map.cpp +++ b/isis/tests/FunctionalTestsNocam2map.cpp @@ -12,7 +12,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/nocam2map.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/nocam2map.xml").expanded()); TEST_F(MroHiriseCube, FunctionalTestNocam2mapDefault) { @@ -60,7 +60,7 @@ TEST_F(MroHiriseCube, FunctionalTestNocam2mapDefault) { FAIL() << "Unable to project image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName); + Cube oCube(outCubeFileName.toStdString()); PvlGroup &mapping = oCube.label()->findObject("IsisCube").findGroup("Mapping"); EXPECT_NEAR((double)mapping.findKeyword("MinimumLatitude"), -60, 0.01); @@ -123,7 +123,7 @@ TEST_F(SmallCube, FunctionalTestNocam2mapSmall) { FAIL() << "Unable to project image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName); + Cube oCube(outCubeFileName.toStdString()); PvlGroup &mapping = oCube.label()->findObject("IsisCube").findGroup("Mapping"); EXPECT_NEAR((double)mapping.findKeyword("MinimumLatitude"), -60, 0.01); diff --git a/isis/tests/FunctionalTestsNoproj.cpp b/isis/tests/FunctionalTestsNoproj.cpp index 752e7b9644..631ed6edb1 100644 --- a/isis/tests/FunctionalTestsNoproj.cpp +++ b/isis/tests/FunctionalTestsNoproj.cpp @@ -12,7 +12,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/noproj.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/noproj.xml").expanded()); TEST_F(DefaultCube, FunctionalTestNoprojDefault) { QString cubeFileName = tempDir.path() + "/output.cub"; @@ -22,7 +22,7 @@ TEST_F(DefaultCube, FunctionalTestNoprojDefault) { // Empty match cube noproj(testCube, NULL, options); - Cube oCube(cubeFileName); + Cube oCube(cubeFileName.toStdString()); Pvl *isisLabel = oCube.label(); PvlGroup instGroup = isisLabel->findGroup("Instrument", Pvl::Traverse); EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("SpacecraftName"), "IdealSpacecraft"); @@ -37,9 +37,9 @@ TEST_F(DefaultCube, FunctionalTestNoprojDefault) { EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("TransX"), 1.0); EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("TransY"), 1.0); - FileName matchedCubeName(QString::fromStdString(instGroup.findKeyword("matchedCube"))); - FileName defaultCubeName(testCube->fileName()); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, matchedCubeName.name(), defaultCubeName.name()); + FileName matchedCubeName(instGroup.findKeyword("matchedCube")); + FileName defaultCubeName(testCube->fileName().toStdString()); + EXPECT_PRED_FORMAT2(AssertStringsEqual, matchedCubeName.name(), defaultCubeName.name()); PvlGroup origInst = isisLabel->findGroup("OriginalInstrument", Pvl::Traverse); PvlGroup testCubeInst = testCube->label()->findGroup("Instrument", Pvl::Traverse); @@ -59,7 +59,7 @@ TEST_F(DefaultCube, FunctionalTestNoprojExpand) { noproj(testCube, NULL, options); - Cube oCube(cubeFileName); + Cube oCube(cubeFileName.toStdString()); Pvl *isisLabel = oCube.label(); PvlGroup instGroup = isisLabel->findGroup("Instrument", Pvl::Traverse); EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("SpacecraftName"), "IdealSpacecraft"); @@ -74,9 +74,9 @@ TEST_F(DefaultCube, FunctionalTestNoprojExpand) { EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("TransX"), 1.0); EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("TransY"), 1.0); - FileName matchedCubeName(QString::fromStdString(instGroup.findKeyword("matchedCube"))); - FileName defaultCubeName(testCube->fileName()); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, matchedCubeName.name(), defaultCubeName.name()); + FileName matchedCubeName(instGroup.findKeyword("matchedCube")); + FileName defaultCubeName(testCube->fileName().toStdString()); + EXPECT_PRED_FORMAT2(AssertStringsEqual, matchedCubeName.name(), defaultCubeName.name()); PvlGroup origInst = isisLabel->findGroup("OriginalInstrument", Pvl::Traverse); PvlGroup testCubeInst = testCube->label()->findGroup("Instrument", Pvl::Traverse); @@ -99,7 +99,7 @@ TEST_F(DefaultCube, FunctionalTestNoprojFromInput) { noproj(testCube, NULL, options); - Cube oCube(cubeFileName); + Cube oCube(cubeFileName.toStdString()); Pvl *isisLabel = oCube.label(); PvlGroup instGroup = isisLabel->findGroup("Instrument", Pvl::Traverse); EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("SpacecraftName"), "IdealSpacecraft"); @@ -114,9 +114,9 @@ TEST_F(DefaultCube, FunctionalTestNoprojFromInput) { EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("TransX"), 1.0); EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("TransY"), 1.0); - FileName matchedCubeName(QString::fromStdString(instGroup.findKeyword("matchedCube"))); - FileName defaultCubeName(testCube->fileName()); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, matchedCubeName.name(), defaultCubeName.name()); + FileName matchedCubeName(instGroup.findKeyword("matchedCube")); + FileName defaultCubeName(testCube->fileName().toStdString()); + EXPECT_PRED_FORMAT2(AssertStringsEqual, matchedCubeName.name(), defaultCubeName.name()); PvlGroup origInst = isisLabel->findGroup("OriginalInstrument", Pvl::Traverse); PvlGroup testCubeInst = testCube->label()->findGroup("Instrument", Pvl::Traverse); @@ -136,7 +136,7 @@ TEST_F(DefaultCube, FunctionalTestNoprojFromUser) { noproj(testCube, NULL, options); - Cube oCube(cubeFileName); + Cube oCube(cubeFileName.toStdString()); Pvl *isisLabel = oCube.label(); PvlGroup instGroup = isisLabel->findGroup("Instrument", Pvl::Traverse); EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("SpacecraftName"), "IdealSpacecraft"); @@ -151,9 +151,9 @@ TEST_F(DefaultCube, FunctionalTestNoprojFromUser) { EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("TransX"), 1.0); EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("TransY"), 1.0); - FileName matchedCubeName(QString::fromStdString(instGroup.findKeyword("matchedCube"))); - FileName defaultCubeName(testCube->fileName()); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, matchedCubeName.name(), defaultCubeName.name()); + FileName matchedCubeName(instGroup.findKeyword("matchedCube")); + FileName defaultCubeName(testCube->fileName().toStdString()); + EXPECT_PRED_FORMAT2(AssertStringsEqual, matchedCubeName.name(), defaultCubeName.name()); PvlGroup origInst = isisLabel->findGroup("OriginalInstrument", Pvl::Traverse); PvlGroup testCubeInst = testCube->label()->findGroup("Instrument", Pvl::Traverse); @@ -321,7 +321,7 @@ TEST_F(DefaultCube, FunctionalTestNoprojSpecs) { noproj(testCube, NULL, options); - Cube oCube(cubeFileName); + Cube oCube(cubeFileName.toStdString()); Pvl *isisLabel = oCube.label(); PvlGroup instGroup = isisLabel->findGroup("Instrument", Pvl::Traverse); EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("SpacecraftName"), "IdealSpacecraft"); @@ -336,9 +336,9 @@ TEST_F(DefaultCube, FunctionalTestNoprojSpecs) { EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("TransX"), 1.0); EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("TransY"), 1.0); - FileName matchedCubeName(QString::fromStdString(instGroup.findKeyword("matchedCube"))); - FileName defaultCubeName(testCube->fileName()); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, matchedCubeName.name(), defaultCubeName.name()); + FileName matchedCubeName(instGroup.findKeyword("matchedCube")); + FileName defaultCubeName(testCube->fileName().toStdString()); + EXPECT_PRED_FORMAT2(AssertStringsEqual, matchedCubeName.name(), defaultCubeName.name()); PvlGroup origInst = isisLabel->findGroup("OriginalInstrument", Pvl::Traverse); PvlGroup testCubeInst = testCube->label()->findGroup("Instrument", Pvl::Traverse); @@ -373,7 +373,7 @@ TEST_F(LineScannerCube, FunctionalTestNoprojLineScanner) { noproj(testCube, NULL, options); - Cube oCube(cubeFileName); + Cube oCube(cubeFileName.toStdString()); Pvl *isisLabel = oCube.label(); PvlGroup instGroup = isisLabel->findGroup("Instrument", Pvl::Traverse); EXPECT_PRED_FORMAT2(AssertStringsEqual, instGroup.findKeyword("SpacecraftName"), "IdealSpacecraft"); @@ -388,9 +388,9 @@ TEST_F(LineScannerCube, FunctionalTestNoprojLineScanner) { EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("TransX"), -1.0); EXPECT_DOUBLE_EQ((double) instGroup.findKeyword("TransY"), -1.0); - FileName matchedCubeName(QString::fromStdString(instGroup.findKeyword("matchedCube"))); - FileName defaultCubeName(testCube->fileName()); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, matchedCubeName.name(), defaultCubeName.name()); + FileName matchedCubeName(instGroup.findKeyword("matchedCube")); + FileName defaultCubeName(testCube->fileName().toStdString()); + EXPECT_PRED_FORMAT2(AssertStringsEqual, matchedCubeName.name(), defaultCubeName.name()); PvlGroup origInst = isisLabel->findGroup("OriginalInstrument", Pvl::Traverse); PvlGroup testCubeInst = testCube->label()->findGroup("Instrument", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsOverlapstats.cpp b/isis/tests/FunctionalTestsOverlapstats.cpp index f35dd0fbeb..5ed2dcf16e 100644 --- a/isis/tests/FunctionalTestsOverlapstats.cpp +++ b/isis/tests/FunctionalTestsOverlapstats.cpp @@ -14,7 +14,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/overlapstats.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/overlapstats.xml").expanded()); TEST_F(ThreeImageNetwork, FunctionalTestOverlapstatsBadCubeList) { QString badCubeList = tempDir.path() + "/badcubes.lis"; @@ -22,13 +22,13 @@ TEST_F(ThreeImageNetwork, FunctionalTestOverlapstatsBadCubeList) { FileList cubes; // badCubeList only contains cube1, overlaps has cube1 and cube2 - cubes.append(FileName(cube1->fileName())); - cubes.write(badCubeList); - cubes.append(FileName(cube2->fileName())); + cubes.append(FileName(cube1->fileName().toStdString())); + cubes.write(badCubeList.toStdString()); + cubes.append(FileName(cube2->fileName().toStdString())); cube1->close(); cube2->close(); - QString FIO_APP_XML = FileName("$ISISROOT/bin/xml/findimageoverlaps.xml").expanded(); + QString FIO_APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/findimageoverlaps.xml").expanded()); QVector fio_args = { "OVERLAPLIST=" + overlapsPath }; UserInterface fioOptions(FIO_APP_XML, fio_args); findimageoverlaps(cubes, fioOptions, false, nullptr); @@ -44,8 +44,8 @@ TEST_F(ThreeImageNetwork, FunctionalTestOverlapstatsBadCubeList) { } catch(IException &e) { std::string errorMsg = "in overlap list that was not in the provided cube list"; - EXPECT_TRUE(e.toString().toLatin1().contains(errorMsg.toLatin1())) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find(errorMsg.c_str()) != std::string::npos) + << e.toString(); } } @@ -63,19 +63,19 @@ TEST_F(ThreeImageNetwork, FunctionalTestOverlapstatsDefault) { cube3->reopen("rw"); FileList cubes; - cubes.append(FileName(cube1->fileName())); - cubes.append(FileName(cube2->fileName())); - cubes.append(FileName(cube3->fileName())); + cubes.append(FileName(cube1->fileName().toStdString())); + cubes.append(FileName(cube2->fileName().toStdString())); + cubes.append(FileName(cube3->fileName().toStdString())); cube1->close(); cube2->close(); cube3->close(); QString cubeListPath = tempDir.path() + "/cubes.lis"; QString overlapsPath = tempDir.path() + "/overlaps.lis"; - cubes.write(cubeListPath); + cubes.write(cubeListPath.toStdString()); // get overlaps from findimageoverlaps - QString FIO_APP_XML = FileName("$ISISROOT/bin/xml/findimageoverlaps.xml").expanded(); + QString FIO_APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/findimageoverlaps.xml").expanded()); QVector fio_args = { "OVERLAPLIST=" + overlapsPath }; UserInterface fioOptions(FIO_APP_XML, fio_args); findimageoverlaps(cubes, fioOptions); @@ -119,17 +119,17 @@ TEST_F(ThreeImageNetwork, FunctionalTestOverlapstatsFull) { cube2->reopen("rw"); FileList cubes; - cubes.append(FileName(cube1->fileName())); - cubes.append(FileName(cube2->fileName())); + cubes.append(FileName(cube1->fileName().toStdString())); + cubes.append(FileName(cube2->fileName().toStdString())); cube1->close(); cube2->close(); QString cubeListPath = tempDir.path() + "/cubes.lis"; QString overlapsPath = tempDir.path() + "/overlaps.lis"; - cubes.write(cubeListPath); + cubes.write(cubeListPath.toStdString()); // get overlaps for overlapstats input - QString FIO_APP_XML = FileName("$ISISROOT/bin/xml/findimageoverlaps.xml").expanded(); + QString FIO_APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/findimageoverlaps.xml").expanded()); QVector fio_args = { "OVERLAPLIST=" + overlapsPath }; UserInterface fioOptions(FIO_APP_XML, fio_args); findimageoverlaps(cubes, fioOptions); @@ -173,19 +173,19 @@ TEST_F(ThreeImageNetwork, FunctionalTestOverlapstatsNoOverlap) { cube3->reopen("rw"); FileList cubes; - cubes.append(FileName(cube1->fileName())); - cubes.append(FileName(cube2->fileName())); - cubes.append(FileName(cube3->fileName())); + cubes.append(FileName(cube1->fileName().toStdString())); + cubes.append(FileName(cube2->fileName().toStdString())); + cubes.append(FileName(cube3->fileName().toStdString())); cube1->close(); cube2->close(); cube3->close(); QString cubeListPath = tempDir.path() + "/cubes.lis"; QString overlapsPath = tempDir.path() + "/overlaps.lis"; - cubes.write(cubeListPath); + cubes.write(cubeListPath.toStdString()); // get overlaps for overlapstats input - QString FIO_APP_XML = FileName("$ISISROOT/bin/xml/findimageoverlaps.xml").expanded(); + QString FIO_APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/findimageoverlaps.xml").expanded()); QVector fio_args = { "OVERLAPLIST=" + overlapsPath }; UserInterface fioOptions(FIO_APP_XML, fio_args); findimageoverlaps(cubes, fioOptions); diff --git a/isis/tests/FunctionalTestsPds2isis.cpp b/isis/tests/FunctionalTestsPds2isis.cpp index c002722d60..09705442a7 100644 --- a/isis/tests/FunctionalTestsPds2isis.cpp +++ b/isis/tests/FunctionalTestsPds2isis.cpp @@ -10,7 +10,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/pds2isis.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/pds2isis.xml").expanded()); TEST(Pds2Isis, Pds2isisTestDefault) { Pvl appLog; @@ -23,10 +23,10 @@ TEST(Pds2Isis, Pds2isisTestDefault) { pds2isis(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to ingest file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest file: " << e.toString().c_str() << std::endl; } - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup dimensions = outLabel->findGroup("Dimensions", Pvl::Traverse); @@ -70,10 +70,10 @@ TEST(Pds2Isis, Pds2isisTestBandBin) { pds2isis(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to ingest file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest file: " << e.toString().c_str() << std::endl; } - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup dimensions = outLabel->findGroup("Dimensions", Pvl::Traverse); @@ -157,10 +157,10 @@ TEST(Pds2Isis, Pds2isisTestOffset) { pds2isis(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to ingest file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest file: " << e.toString().c_str() << std::endl; } - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup mapping = outLabel->findGroup("Mapping", Pvl::Traverse); @@ -200,10 +200,10 @@ TEST(Pds2Isis, Pds2isisTestProjection) { pds2isis(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to ingest file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest file: " << e.toString().c_str() << std::endl; } - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup mapping = outLabel->findGroup("Mapping", Pvl::Traverse); @@ -246,7 +246,7 @@ TEST(Pds2Isis, Pds2isisTestSpecialPixels) { pds2isis(options_nullrange, &appLog); } catch (IException &e) { - FAIL() << "Failed for setnullrange=yes on file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Failed for setnullrange=yes on file: " << e.toString().c_str() << std::endl; } // test sethrsrange @@ -258,7 +258,7 @@ TEST(Pds2Isis, Pds2isisTestSpecialPixels) { pds2isis(options_hrsrange, &appLog); } catch (IException &e) { - FAIL() << "Failed for sethrsrange=yes on file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Failed for sethrsrange=yes on file: " << e.toString().c_str() << std::endl; } // test sethisrange @@ -270,7 +270,7 @@ TEST(Pds2Isis, Pds2isisTestSpecialPixels) { pds2isis(options_hisrange, &appLog); } catch (IException &e) { - FAIL() << "Failed for sethisrange=yes on file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Failed for sethisrange=yes on file: " << e.toString().c_str() << std::endl; } // test setlrsrange @@ -282,7 +282,7 @@ TEST(Pds2Isis, Pds2isisTestSpecialPixels) { pds2isis(options_lrsrange, &appLog); } catch (IException &e) { - FAIL() << "Failed for setlrsrange=yes on file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Failed for setlrsrange=yes on file: " << e.toString().c_str() << std::endl; } // test setlisrange @@ -294,7 +294,7 @@ TEST(Pds2Isis, Pds2isisTestSpecialPixels) { pds2isis(options_lisrange, &appLog); } catch (IException &e) { - FAIL() << "Failed for setlisrange=yes on file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Failed for setlisrange=yes on file: " << e.toString().c_str() << std::endl; } } @@ -311,10 +311,10 @@ TEST(Pds2Isis, Pds2isisTestBIL) { pds2isis(options, &appLog); } catch (IException &e) { - FAIL() << "Failed to ingest file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Failed to ingest file: " << e.toString().c_str() << std::endl; } - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup dimensions = outLabel->findGroup("Dimensions", Pvl::Traverse); @@ -342,10 +342,10 @@ TEST(Pds2Isis, Pds2isisTestBIP) { pds2isis(options, &appLog); } catch (IException &e) { - FAIL() << "Failed to ingest file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Failed to ingest file: " << e.toString().c_str() << std::endl; } - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup dimensions = outLabel->findGroup("Dimensions", Pvl::Traverse); @@ -373,10 +373,10 @@ TEST(Pds2Isis, Pds2isisTestNIMSQub) { pds2isis(options, &appLog); } catch (IException &e) { - FAIL() << "Failed to ingest file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Failed to ingest file: " << e.toString().c_str() << std::endl; } - Cube outCube(cubeFileName); + Cube outCube(cubeFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup dimensions = outLabel->findGroup("Dimensions", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsPhocube.cpp b/isis/tests/FunctionalTestsPhocube.cpp index 872d1c4b41..87dd3d11cc 100644 --- a/isis/tests/FunctionalTestsPhocube.cpp +++ b/isis/tests/FunctionalTestsPhocube.cpp @@ -16,7 +16,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/phocube.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/phocube.xml").expanded()); TEST_F(DefaultCube, FunctionalTestPhocubeDefault) { QString cubeFileName = tempDir.path() + "/phocubeTEMP.cub"; @@ -25,7 +25,7 @@ TEST_F(DefaultCube, FunctionalTestPhocubeDefault) { resizeCube(5, 5, 1); phocube(testCube, options); - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); ASSERT_EQ(cube.sampleCount(), testCube->sampleCount()); @@ -71,7 +71,7 @@ TEST_F(DefaultCube, FunctionalTestPhocubeAllBands) { resizeCube(5, 5, 1); phocube(testCube, options); - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); ASSERT_EQ(cube.sampleCount(), testCube->sampleCount()); @@ -188,7 +188,7 @@ TEST_F(DefaultCube, FunctionalTestPhocubeSpecialPixels) { phocube(testCube, options); - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); ASSERT_EQ(cube.sampleCount(), testCube->sampleCount()); @@ -239,7 +239,7 @@ TEST_F(OffBodyCube, FunctionalTestPhocubeOffBody) { UserInterface options(APP_XML, args); phocube(testCube, options); - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); ASSERT_EQ(cube.sampleCount(), testCube->sampleCount()); @@ -292,7 +292,7 @@ TEST_F(DefaultCube, FunctionalTestPhocubeMosaic) { resizeCube(5, 5, 1); phocube(projTestCube, options); - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); ASSERT_EQ(cube.sampleCount(), testCube->sampleCount()); @@ -324,7 +324,7 @@ TEST_F(MiniRFCube, FunctionalTestPhocubeMiniRF) { UserInterface options(APP_XML, args); phocube(testCube, options); - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); ASSERT_EQ(cube.sampleCount(), testCube->sampleCount()); @@ -369,7 +369,7 @@ TEST_F(DefaultCube, FunctionalTestPhocubeNoBandBin) { phocube(testCube, options); - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); ASSERT_EQ(cube.sampleCount(), testCube->sampleCount()); @@ -401,7 +401,7 @@ TEST_F(DefaultCube, FunctionalTestPhocubeAllDnBands) { phocube(testCube, options); - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); ASSERT_EQ(cube.sampleCount(), testCube->sampleCount()); @@ -478,7 +478,7 @@ TEST(Phocube, FunctionalTestPhocubeSunIlluminationMask) { phocube(&testCube, options); // open output cube and retrieve label - Cube cube(outCubeFileName); + Cube cube(outCubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // verify sample, line, and band counts @@ -535,7 +535,7 @@ TEST(Phocube, FunctionalTestPhocubeSurfaceObliqueDetectorResolution) { phocube(&testCube, options); // open output cube and retrieve label - Cube cube(outCubeFileName); + Cube cube(outCubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // verify sample, line, and band counts diff --git a/isis/tests/FunctionalTestsPhotrim.cpp b/isis/tests/FunctionalTestsPhotrim.cpp index 57fa2d58ad..f9d2a1fabc 100644 --- a/isis/tests/FunctionalTestsPhotrim.cpp +++ b/isis/tests/FunctionalTestsPhotrim.cpp @@ -11,7 +11,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/photrim.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/photrim.xml").expanded()); /** * FunctionalTestsPhotrimBase @@ -54,11 +54,11 @@ static QString APP_XML = FileName("$ISISROOT/bin/xml/photrim.xml").expanded(); photrim(testCube, ui); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // validate output cube - Cube outCube(tempDir.path() + "/PhotrimBase.cub"); + Cube outCube(tempDir.path().toStdString() + "/PhotrimBase.cub"); // validate histogram statistics for output cube std::unique_ptr hist (outCube.histogram(1)); @@ -115,11 +115,11 @@ TEST_F(DefaultCube, FunctionalTestsPhotrimEmission) { photrim(testCube, ui); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // validate output cube - Cube outCube(tempDir.path() + "/photrimEmission.cub"); + Cube outCube(tempDir.path().toStdString() + "/photrimEmission.cub"); // validate histogram statistics for output cube std::unique_ptr hist (outCube.histogram(1)); @@ -176,11 +176,11 @@ TEST_F(DefaultCube, FunctionalTestsPhotrimPhase) { photrim(testCube, ui); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // validate output cube - Cube outCube(tempDir.path() + "/photrimPhase.cub"); + Cube outCube(tempDir.path().toStdString() + "/photrimPhase.cub"); // validate histogram statistics for output cube std::unique_ptr hist (outCube.histogram(1)); @@ -237,11 +237,11 @@ TEST_F(DefaultCube, FunctionalTestsPhotrimIncidence) { photrim(testCube, ui); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // validate output cube - Cube outCube(tempDir.path() + "/photrimIncidence.cub"); + Cube outCube(tempDir.path().toStdString() + "/photrimIncidence.cub"); // validate histogram statistics for output cube std::unique_ptr hist (outCube.histogram(1)); @@ -298,11 +298,11 @@ TEST_F(DefaultCube, FunctionalTestsPhotrimUseDEM) { photrim(testCube, ui); } catch(IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // validate output cube - Cube outCube(tempDir.path() + "/photrimUseDEM.cub"); + Cube outCube(tempDir.path().toStdString() + "/photrimUseDEM.cub"); // validate histogram statistics for output cube std::unique_ptr hist (outCube.histogram(1)); diff --git a/isis/tests/FunctionalTestsPointreg.cpp b/isis/tests/FunctionalTestsPointreg.cpp index 331c533bba..b7ed3e5171 100644 --- a/isis/tests/FunctionalTestsPointreg.cpp +++ b/isis/tests/FunctionalTestsPointreg.cpp @@ -10,7 +10,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/pointreg.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/pointreg.xml").expanded()); TEST_F(ThreeImageNetwork, FunctionalTestPointregDefault) { Pvl log; @@ -28,7 +28,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestPointregDefault) { pointreg(options, &log); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // Check app log @@ -67,7 +67,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestPointregFailOptions) { pointreg(options, &log); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // Check app log @@ -105,7 +105,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestPointregOutputOptionsA) { pointreg(options, &log); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // Check app log @@ -145,7 +145,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestPointregOutputOptionsB) { pointreg(options, &log); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // Check app log @@ -185,7 +185,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestPointregOutputOptionsC) { pointreg(options, &log); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // Check app log @@ -225,7 +225,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestPointregRegisterOptionsIgnored) { pointreg(options, &log); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // Check app log @@ -254,7 +254,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestPointregRegisterOptionsValid) { pointreg(options, &log); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // Check app log @@ -288,7 +288,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestPointregValidation) { pointreg(options, &log); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // Check app log @@ -328,7 +328,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestPointregValidationRevert) { pointreg(options, &log); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // Check app log @@ -369,7 +369,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestPointregValidationSkipped) { pointreg(options, &log); } catch (IException &e) { - FAIL() << e.toString().toStdString().c_str() << std::endl; + FAIL() << e.toString().c_str() << std::endl; } // Check app log diff --git a/isis/tests/FunctionalTestsReduce.cpp b/isis/tests/FunctionalTestsReduce.cpp index 695112530d..eae07dcef9 100644 --- a/isis/tests/FunctionalTestsReduce.cpp +++ b/isis/tests/FunctionalTestsReduce.cpp @@ -12,7 +12,7 @@ using namespace Isis; using ::testing::HasSubstr; -static QString APP_XML = FileName("$ISISROOT/bin/xml/reduce.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/reduce.xml").expanded()); TEST_F(LargeCube, FunctionalTestReduceDefault) { QTemporaryDir prefix; @@ -33,7 +33,7 @@ TEST_F(LargeCube, FunctionalTestReduceDefault) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube ocube(outCubeFileName); + Cube ocube(outCubeFileName.toStdString()); ASSERT_EQ(ocube.sampleCount(), 100); ASSERT_EQ(ocube.lineCount(), 100); @@ -66,7 +66,7 @@ TEST_F(LargeCube, FunctionalTestReduceAverageScale1) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube ocube(outCubeFileName); + Cube ocube(outCubeFileName.toStdString()); ASSERT_EQ(ocube.sampleCount(), 1000); ASSERT_EQ(ocube.lineCount(), 1000); @@ -99,7 +99,7 @@ TEST_F(LargeCube, FunctionalTestReduceAverageScale2) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube ocube(outCubeFileName); + Cube ocube(outCubeFileName.toStdString()); ASSERT_EQ(ocube.sampleCount(), 100); ASSERT_EQ(ocube.lineCount(), 100); @@ -132,7 +132,7 @@ TEST_F(LargeCube, FunctionalTestReduceNearestNeighbor) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube ocube(outCubeFileName); + Cube ocube(outCubeFileName.toStdString()); ASSERT_EQ(ocube.sampleCount(), 100); ASSERT_EQ(ocube.lineCount(), 100); @@ -173,7 +173,7 @@ TEST_F(LargeCube, FunctionalTestReduceRoundOff) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube ocube(outCubeFileName); + Cube ocube(outCubeFileName.toStdString()); ASSERT_EQ(ocube.sampleCount(), 80); ASSERT_EQ(ocube.lineCount(), 483); diff --git a/isis/tests/FunctionalTestsRingsautomos.cpp b/isis/tests/FunctionalTestsRingsautomos.cpp index 0df95e9eef..4f307bdaf7 100644 --- a/isis/tests/FunctionalTestsRingsautomos.cpp +++ b/isis/tests/FunctionalTestsRingsautomos.cpp @@ -9,7 +9,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/ringsautomos.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/ringsautomos.xml").expanded()); TEST_F(RingsCube, FunctionalTestRingsautomos) { QString outPath = tempDir.path() + "/mosaic.cub"; @@ -20,7 +20,7 @@ TEST_F(RingsCube, FunctionalTestRingsautomos) { ringsautomos(options, &appLog); - Cube mos(outPath); + Cube mos(outPath.toStdString()); Pvl label = *mos.label(); PvlGroup mapping = label.findObject("IsisCube").findGroup("Mapping"); @@ -62,7 +62,7 @@ TEST_F(RingsCube, FunctionalTestRingsautomosSetRanges) { ringsautomos(options, &appLog); - Cube mos(outPath); + Cube mos(outPath.toStdString()); Pvl label = *mos.label(); PvlGroup mapping = label.findObject("IsisCube").findGroup("Mapping"); @@ -89,11 +89,11 @@ TEST_F(RingsCube, FunctionalTestRingsautomosSetRanges) { EXPECT_NEAR(oCubeStats->StandardDeviation(), 753.01066871414162, 0.001); FileList lout; - lout.read(oFileListPath); + lout.read(oFileListPath.toStdString()); EXPECT_EQ(lout.size(), cubeFileList.size()); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, lout.at(0).expanded(), cubeFileList.at(0).expanded()); - EXPECT_PRED_FORMAT2(AssertQStringsEqual, lout.at(1).expanded(), cubeFileList.at(1).expanded()); + EXPECT_PRED_FORMAT2(AssertStringsEqual, lout.at(0).expanded(), cubeFileList.at(0).expanded()); + EXPECT_PRED_FORMAT2(AssertStringsEqual, lout.at(1).expanded(), cubeFileList.at(1).expanded()); } @@ -108,7 +108,7 @@ TEST_F(RingsCube, FunctionalTestRingsautomosPriority) { ringsautomos(options, &appLog); - Cube mos(outPath); + Cube mos(outPath.toStdString()); Pvl label = *mos.label(); PvlGroup mapping = label.findObject("IsisCube").findGroup("Mapping"); @@ -147,7 +147,7 @@ TEST_F(RingsCube, FunctionalTestRingsautomosBandSelect) { ringsautomos(options, &appLog); - Cube mos(outPath); + Cube mos(outPath.toStdString()); Pvl label = *mos.label(); PvlGroup bandBin = label.findObject("IsisCube").findGroup("BandBin"); diff --git a/isis/tests/FunctionalTestsSegment.cpp b/isis/tests/FunctionalTestsSegment.cpp index 86a42c6024..92b82d6ae9 100644 --- a/isis/tests/FunctionalTestsSegment.cpp +++ b/isis/tests/FunctionalTestsSegment.cpp @@ -11,7 +11,7 @@ using namespace Isis; using ::testing::HasSubstr; -static QString APP_XML = FileName("$ISISROOT/bin/xml/segment.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/segment.xml").expanded()); TEST_F(LargeCube, FunctionalTestSegmentDefault) { @@ -28,7 +28,7 @@ TEST_F(LargeCube, FunctionalTestSegmentDefault) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube segOne(tempDir.path() + "/large." + "segment1.cub"); + Cube segOne(tempDir.path().toStdString() + "/large." + "segment1.cub"); EXPECT_EQ(segOne.sampleCount(), 1000); EXPECT_EQ(segOne.lineCount(), 250); @@ -41,7 +41,7 @@ TEST_F(LargeCube, FunctionalTestSegmentDefault) { EXPECT_EQ(histSegOne->ValidPixels(), 250000); EXPECT_NEAR(histSegOne->StandardDeviation(), 72.16835, 0.00001); - Cube segTwo(tempDir.path() + "/large." + "segment2.cub"); + Cube segTwo(tempDir.path().toStdString() + "/large." + "segment2.cub"); EXPECT_EQ(segTwo.sampleCount(), 1000); EXPECT_EQ(segTwo.lineCount(), 250); @@ -54,7 +54,7 @@ TEST_F(LargeCube, FunctionalTestSegmentDefault) { EXPECT_EQ(histSegTwo->ValidPixels(), 250000); EXPECT_NEAR(histSegTwo->StandardDeviation(), 72.1683506, 0.00001); - Cube segThree(tempDir.path() + "/large." + "segment3.cub"); + Cube segThree(tempDir.path().toStdString() + "/large." + "segment3.cub"); EXPECT_EQ(segThree.sampleCount(), 1000); EXPECT_EQ(segThree.lineCount(), 250); @@ -67,7 +67,7 @@ TEST_F(LargeCube, FunctionalTestSegmentDefault) { EXPECT_EQ(histSegThree->ValidPixels(), 250000); EXPECT_NEAR(histSegThree->StandardDeviation(), 72.16835, 0.00001); - Cube segFour(tempDir.path() + "/large." + "segment4.cub"); + Cube segFour(tempDir.path().toStdString() + "/large." + "segment4.cub"); EXPECT_EQ(segFour.sampleCount(), 1000); EXPECT_EQ(segFour.lineCount(), 250); @@ -80,7 +80,7 @@ TEST_F(LargeCube, FunctionalTestSegmentDefault) { EXPECT_EQ(histSegFour->ValidPixels(), 250000); EXPECT_NEAR(histSegFour->StandardDeviation(), 72.168350, 0.00001); - Cube segFive(tempDir.path() + "/large." + "segment5.cub"); + Cube segFive(tempDir.path().toStdString() + "/large." + "segment5.cub"); EXPECT_EQ(segFive.sampleCount(), 1000); EXPECT_EQ(segFive.lineCount(), 250); @@ -109,7 +109,7 @@ TEST_F(LargeCube, FunctionalTestSegmentBoundary) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube segOne(tempDir.path() + "/large." + "segment1.cub"); + Cube segOne(tempDir.path().toStdString() + "/large." + "segment1.cub"); EXPECT_EQ(segOne.sampleCount(), 1000); EXPECT_EQ(segOne.lineCount(), 500); @@ -122,7 +122,7 @@ TEST_F(LargeCube, FunctionalTestSegmentBoundary) { EXPECT_EQ(histSegOne->ValidPixels(), 500000); EXPECT_NEAR(histSegOne->StandardDeviation(), 144.3374229, 0.00001); - Cube segTwo(tempDir.path() + "/large." + "segment2.cub"); + Cube segTwo(tempDir.path().toStdString() + "/large." + "segment2.cub"); EXPECT_EQ(segTwo.sampleCount(), 1000); EXPECT_EQ(segTwo.lineCount(), 500); @@ -135,7 +135,7 @@ TEST_F(LargeCube, FunctionalTestSegmentBoundary) { EXPECT_EQ(histSegTwo->ValidPixels(), 500000); EXPECT_NEAR(histSegTwo->StandardDeviation(), 144.33742295, 0.00001); - Cube segThree(tempDir.path() + "/large." + "segment3.cub"); + Cube segThree(tempDir.path().toStdString() + "/large." + "segment3.cub"); EXPECT_EQ(segThree.sampleCount(), 1000); EXPECT_EQ(segThree.lineCount(), 176); diff --git a/isis/tests/FunctionalTestsShadow.cpp b/isis/tests/FunctionalTestsShadow.cpp index 1f157ab6fe..ca141a7226 100644 --- a/isis/tests/FunctionalTestsShadow.cpp +++ b/isis/tests/FunctionalTestsShadow.cpp @@ -18,7 +18,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/shadow.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/shadow.xml").expanded()); TEST_F(DemCube, FunctionalTestShadowMatch) { QVector shadowArgs = {"to=" + tempDir.path() + "/shadow.cub", @@ -45,7 +45,7 @@ TEST_F(DemCube, FunctionalTestShadowMatch) { EXPECT_EQ(int(shadowStats["NumSpecialPixels"]), 2800); EXPECT_EQ(int(shadowStats["NumPixelsShadowedByRays"]), 0); - Cube shadowCube(shadowUi.GetCubeName("TO")); + Cube shadowCube(shadowUi.GetCubeName("TO").toStdString()); std::unique_ptr hist (shadowCube.histogram()); @@ -84,7 +84,7 @@ TEST_F(DemCube, FunctionalTestShadowTime) { EXPECT_EQ(int(shadowStats["NumSpecialPixels"]), 2800); EXPECT_EQ(int(shadowStats["NumPixelsShadowedByRays"]), 104); - Cube shadowCube(shadowUi.GetCubeName("TO")); + Cube shadowCube(shadowUi.GetCubeName("TO").toStdString()); std::unique_ptr hist (shadowCube.histogram()); @@ -121,7 +121,7 @@ TEST_F(DemCube, FunctionalTestShadowNoShadow) { EXPECT_EQ(int(shadowStats["NumSpecialPixels"]), 2800); EXPECT_EQ(int(shadowStats["NumPixelsShadowedByRays"]), 0); - Cube shadowCube(shadowUi.GetCubeName("TO")); + Cube shadowCube(shadowUi.GetCubeName("TO").toStdString()); std::unique_ptr hist (shadowCube.histogram()); @@ -157,7 +157,7 @@ TEST_F(DemCube, FunctionalTestShadowAccurate) { EXPECT_EQ(int(shadowStats["NumSpecialPixels"]), 2800); EXPECT_EQ(int(shadowStats["NumPixelsShadowedByRays"]), 0); - Cube shadowCube(shadowUi.GetCubeName("TO")); + Cube shadowCube(shadowUi.GetCubeName("TO").toStdString()); std::unique_ptr hist (shadowCube.histogram()); @@ -193,7 +193,7 @@ TEST_F(DemCube, FunctionalTestShadowCustom) { EXPECT_EQ(int(shadowStats["NumSpecialPixels"]), 2800); EXPECT_EQ(int(shadowStats["NumPixelsShadowedByRays"]), 0); - Cube shadowCube(shadowUi.GetCubeName("TO")); + Cube shadowCube(shadowUi.GetCubeName("TO").toStdString()); std::unique_ptr hist (shadowCube.histogram()); diff --git a/isis/tests/FunctionalTestsSkypt.cpp b/isis/tests/FunctionalTestsSkypt.cpp index 9762616667..434c017dd6 100644 --- a/isis/tests/FunctionalTestsSkypt.cpp +++ b/isis/tests/FunctionalTestsSkypt.cpp @@ -14,7 +14,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/skypt.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/skypt.xml").expanded()); /** * FunctionalTestSkyptDefault @@ -235,8 +235,8 @@ TEST_F(DefaultCube, FunctionalTestSkyptFlatFileError) { FAIL() << "Expected an exception to be thrown"; } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Flat file must have a name.")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Flat file must have a name.") != std::string::npos) + << e.toString(); } catch(...) { FAIL() << "Expected an IException with message: \"Flat file must have a name.\""; diff --git a/isis/tests/FunctionalTestsSocetlinescankeywords.cpp b/isis/tests/FunctionalTestsSocetlinescankeywords.cpp index 0caa2c81bc..40b26a5c4d 100644 --- a/isis/tests/FunctionalTestsSocetlinescankeywords.cpp +++ b/isis/tests/FunctionalTestsSocetlinescankeywords.cpp @@ -13,7 +13,7 @@ using namespace Isis; using namespace testing; -static QString APP_XML = FileName("$ISISROOT/bin/xml/socetlinescankeywords.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/socetlinescankeywords.xml").expanded()); TEST_F(MroHiriseCube, FunctionalTestSocetlinescankeywordsHirise) { testCube->reopen("rw"); diff --git a/isis/tests/FunctionalTestsSpiceinit.cpp b/isis/tests/FunctionalTestsSpiceinit.cpp index 8b2169c202..4af09f7bcc 100644 --- a/isis/tests/FunctionalTestsSpiceinit.cpp +++ b/isis/tests/FunctionalTestsSpiceinit.cpp @@ -27,7 +27,7 @@ using json = nlohmann::json; using namespace Isis; using ::testing::HasSubstr; -static QString APP_XML = FileName("$ISISROOT/bin/xml/spiceinit.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/spiceinit.xml").expanded()); TEST(Spiceinit, TestSpiceinitPredictAndReconCk) { @@ -93,7 +93,7 @@ TEST(Spiceinit, TestSpiceinitPredictAndReconCk) { tempFile.open(); Cube testCube; - testCube.fromLabel(tempFile.fileName() + ".cub", label, "rw"); + testCube.fromLabel(tempFile.fileName().toStdString() + ".cub", label, "rw"); QVector args = {"ckrecon=True", "cksmithed=True", "attach=false"}; UserInterface options(APP_XML, args); @@ -184,7 +184,7 @@ TEST(Spiceinit, TestSpiceinitCkConfigFile) { tempFile.open(); Cube testCube; - testCube.fromLabel(tempFile.fileName() + ".cub", label, "rw"); + testCube.fromLabel(tempFile.fileName().toStdString() + ".cub", label, "rw"); QVector args(0); UserInterface options(APP_XML, args); @@ -302,7 +302,7 @@ TEST(Spiceinit, TestSpiceinitDefault) { tempFile.open(); Cube testCube; - testCube.fromLabel(tempFile.fileName() + ".cub", label, "rw"); + testCube.fromLabel(tempFile.fileName().toStdString() + ".cub", label, "rw"); QVector args(0); UserInterface options(APP_XML, args); @@ -408,7 +408,7 @@ TEST(Spiceinit, TestSpiceinitNadir) { tempFile.open(); Cube testCube; - testCube.fromLabel(tempFile.fileName() + ".cub", label, "rw"); + testCube.fromLabel(tempFile.fileName().toStdString() + ".cub", label, "rw"); QVector args = {"ckrecon=False", "cknadir=True", "tspk=$base/kernels/spk/de405.bsp", "attach=false"}; UserInterface options(APP_XML, args); @@ -507,7 +507,7 @@ TEST(Spiceinit, TestSpiceinitPadding) { tempFile.open(); Cube testCube; - testCube.fromLabel(tempFile.fileName() + ".cub", label, "rw"); + testCube.fromLabel(tempFile.fileName().toStdString() + ".cub", label, "rw"); QVector args = {"startpad=1.1", "endpad=0.5", "fk=$cassini/kernels/fk/cas_v40_usgs.tf", "attach=false"}; UserInterface options(APP_XML, args); @@ -654,7 +654,7 @@ TEST_F(DemCube, FunctionalTestSpiceinitWebAndShapeModel) { tempFile.open(); Cube testCube; - testCube.fromLabel(tempFile.fileName() + ".cub", label, "rw"); + testCube.fromLabel(tempFile.fileName().toStdString() + ".cub", label, "rw"); QVector args = {"web=true", "shape=user", "model=" + demCube->fileName()}; UserInterface options(APP_XML, args); @@ -688,7 +688,7 @@ TEST_F(SmallCube, FunctionalTestSpiceinitCsminitRestorationOnFail) { "from="+cubeFile, "isd="+isdPath}; - QString CSMINIT_APP_XML = FileName("$ISISROOT/bin/xml/csminit.xml").expanded(); + QString CSMINIT_APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/csminit.xml").expanded()); UserInterface csmOptions(CSMINIT_APP_XML, csmArgs); testCube->close(); @@ -703,7 +703,7 @@ TEST_F(SmallCube, FunctionalTestSpiceinitCsminitRestorationOnFail) { UserInterface spiceinitOptions(APP_XML, spiceinitArgs); ASSERT_ANY_THROW(spiceinit(spiceinitOptions)); - Cube outputCube(cubeFile); + Cube outputCube(cubeFile.toStdString()); ASSERT_NO_THROW(outputCube.camera()); EXPECT_TRUE(outputCube.hasBlob("CSMState", "String")); @@ -778,7 +778,7 @@ TEST(Spiceinit, TestSpiceinitHrscWebError) { tempFile.open(); Cube testCube; - testCube.fromLabel(tempFile.fileName() + ".cub", label, "rw"); + testCube.fromLabel(tempFile.fileName().toStdString() + ".cub", label, "rw"); QVector args = {"web=true"}; UserInterface options(APP_XML, args); diff --git a/isis/tests/FunctionalTestsSpiceserver.cpp b/isis/tests/FunctionalTestsSpiceserver.cpp index cc627e1b0d..c63290527b 100644 --- a/isis/tests/FunctionalTestsSpiceserver.cpp +++ b/isis/tests/FunctionalTestsSpiceserver.cpp @@ -18,7 +18,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/spiceserver.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/spiceserver.xml").expanded()); class TestPayload : public DefaultCube { protected: @@ -92,7 +92,7 @@ TEST_F(TestPayload, FunctionalTestSpiceserverDefaultParameters) { QString xml( QByteArray::fromHex( QByteArray( hexCode.toLatin1() ) ).constData() ); QDomDocument document; - std::string error; + QString error; Pvl kernelsLabel; Pvl instrumentPositionTable; @@ -107,7 +107,7 @@ TEST_F(TestPayload, FunctionalTestSpiceserverDefaultParameters) { if (element.tagName() == "kernels_label") { QString encoded = element.firstChild().toText().data(); std::stringstream labStream; - labStream << QString( QByteArray::fromHex( encoded.toLatin1() ).constData() ); + labStream << QString( QByteArray::fromHex( encoded.toLatin1() ).constData() ).toStdString(); labStream >> kernelsLabel; } else if (element.tagName() == "tables") { @@ -117,7 +117,7 @@ TEST_F(TestPayload, FunctionalTestSpiceserverDefaultParameters) { if (table.tagName() == "instrument_position") { QString encoded = table.firstChild().toText().data(); std::stringstream labStream; - labStream << QString( QByteArray::fromHex( encoded.toLatin1() ).constData() ); + labStream << QString( QByteArray::fromHex( encoded.toLatin1() ).constData() ).toStdString(); labStream >> instrumentPositionTable; } } diff --git a/isis/tests/FunctionalTestsSpkwriter.cpp b/isis/tests/FunctionalTestsSpkwriter.cpp index 36583761c5..4284e0ac16 100644 --- a/isis/tests/FunctionalTestsSpkwriter.cpp +++ b/isis/tests/FunctionalTestsSpkwriter.cpp @@ -17,7 +17,7 @@ using namespace Isis; using namespace testing; -static QString APP_XML = FileName("$ISISROOT/bin/xml/spkwriter.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/spkwriter.xml").expanded()); TEST_F(DefaultCube, FunctionalTestSpkwriterDefault) { Pvl appLog; @@ -29,11 +29,11 @@ TEST_F(DefaultCube, FunctionalTestSpkwriterDefault) { spkwriter(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to write kernel file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to write kernel file: " << e.toString().c_str() << std::endl; } Cube newKernelCube; - newKernelCube.fromLabel(tempDir.path() + "/newKernelCube.cub", label, "rw"); + newKernelCube.fromLabel(tempDir.path().toStdString() + "/newKernelCube.cub", label, "rw"); PvlGroup &kernels = newKernelCube.label()->findObject("IsisCube").findGroup("Kernels"); PvlKeyword targetPosition("TargetPosition"); @@ -55,7 +55,7 @@ TEST_F(DefaultCube, FunctionalTestSpkwriterDefault) { try { newKernelCube.camera(); } catch(IException &e) { - FAIL() << "Unable to generate camera with new spk kernel: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to generate camera with new spk kernel: " << e.toString().c_str() << std::endl; } Table oldInstPositionTable = testCube->readTable("InstrumentPosition"); @@ -74,10 +74,10 @@ TEST_F(DefaultCube, FunctionalTestSpkwriterDefault) { TEST_F(DefaultCube, FunctionalTestSpkwriterFromlist) { Pvl appLog; FileList cubeList; - cubeList.append(testCube->fileName()); + cubeList.append(testCube->fileName().toStdString()); QString cubeListFile = tempDir.path() + "/cubes.lis"; - cubeList.write(cubeListFile); + cubeList.write(cubeListFile.toStdString()); QVector args = {"fromlist=" + cubeListFile, "to=" + tempDir.path() + "/newKernel.bsp"}; @@ -86,11 +86,11 @@ TEST_F(DefaultCube, FunctionalTestSpkwriterFromlist) { spkwriter(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to write kernel file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to write kernel file: " << e.toString().c_str() << std::endl; } Cube newKernelCube; - newKernelCube.fromLabel(tempDir.path() + "/newKernelCube.cub", label, "rw"); + newKernelCube.fromLabel(tempDir.path().toStdString() + "/newKernelCube.cub", label, "rw"); PvlGroup &kernels = newKernelCube.label()->findObject("IsisCube").findGroup("Kernels"); PvlKeyword targetPosition("TargetPosition"); @@ -112,7 +112,7 @@ TEST_F(DefaultCube, FunctionalTestSpkwriterFromlist) { try { newKernelCube.camera(); } catch(IException &e) { - FAIL() << "Unable to generate camera with new spk kernel: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to generate camera with new spk kernel: " << e.toString().c_str() << std::endl; } Table oldInstPositionTable = testCube->readTable("InstrumentPosition"); @@ -156,7 +156,7 @@ TEST_F(ObservationPair, FunctionalTestSpkwriterWarnValidate) { spkwriter(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to write kernel file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to write kernel file: " << e.toString().c_str() << std::endl; } EXPECT_TRUE(appLog.hasGroup("Overlaps")); @@ -180,7 +180,7 @@ TEST_F(DefaultCube, FunctionalTestSpkwriterComSum) { spkwriter(options, &appLog); } catch (IException &e) { - FAIL() << "Unable to write kernel file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to write kernel file: " << e.toString().c_str() << std::endl; } TextFile kernelFile(options.GetFileName("summary")); @@ -207,7 +207,7 @@ TEST(Spkwriter, FunctionalTestSpkwriterOffsets) { spkwriter(options); } catch (IException &e) { - FAIL() << "Unable to write kernel file: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to write kernel file: " << e.toString().c_str() << std::endl; } QString tmp = options.GetFileName("TO"); furnsh_c(tmp.toLatin1().data()); diff --git a/isis/tests/FunctionalTestsStd2isis.cpp b/isis/tests/FunctionalTestsStd2isis.cpp index 19ab844afb..fcec4a2436 100644 --- a/isis/tests/FunctionalTestsStd2isis.cpp +++ b/isis/tests/FunctionalTestsStd2isis.cpp @@ -19,7 +19,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/std2isis.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/std2isis.xml").expanded()); TEST_F(TempTestingFiles, FunctionalTestStd2isisDefault) { QString outCubeFileName = tempDir.path() + "/outTemp.cub"; @@ -34,7 +34,7 @@ TEST_F(TempTestingFiles, FunctionalTestStd2isisDefault) { FAIL() << "Unable to translate image: " << e.what() << std::endl; } - Cube outCube(outCubeFileName); + Cube outCube(outCubeFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup dimensions = outLabel->findGroup("Dimensions", Pvl::Traverse); @@ -74,7 +74,7 @@ TEST_F(TempTestingFiles, FunctionalTestStd2isisArgb) { FAIL() << "Unable to translate image: " << e.what() << std::endl; } - Cube outCube(outCubeFileName); + Cube outCube(outCubeFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup dimensions = outLabel->findGroup("Dimensions", Pvl::Traverse); @@ -115,7 +115,7 @@ TEST_F(TempTestingFiles, FunctionalTestStd2isisTiffGrayscale) { FAIL() << "Unable to translate image: " << e.what() << std::endl; } - Cube outCube(outCubeFileName); + Cube outCube(outCubeFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup dimensions = outLabel->findGroup("Dimensions", Pvl::Traverse); @@ -156,7 +156,7 @@ TEST_F(TempTestingFiles, FunctionalTestStd2isisSpecial) { FAIL() << "Unable to translate image: " << e.what() << std::endl; } - Cube outCube(outCubeFileName); + Cube outCube(outCubeFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup dimensions = outLabel->findGroup("Dimensions", Pvl::Traverse); @@ -198,7 +198,7 @@ TEST_F(TempTestingFiles, FunctionalTestStd2isisJp2) { FAIL() << "Unable to translate image: " << e.what() << std::endl; } - Cube outCube(outCubeFileName); + Cube outCube(outCubeFileName.toStdString()); Pvl *outLabel = outCube.label(); PvlGroup dimensions = outLabel->findGroup("Dimensions", Pvl::Traverse); diff --git a/isis/tests/FunctionalTestsStretch.cpp b/isis/tests/FunctionalTestsStretch.cpp index fabdd10147..1be04bffaf 100644 --- a/isis/tests/FunctionalTestsStretch.cpp +++ b/isis/tests/FunctionalTestsStretch.cpp @@ -11,7 +11,7 @@ using namespace Isis; -static QString STRETCH_XML = FileName("$ISISROOT/bin/xml/stretch.xml").expanded(); +static QString STRETCH_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/stretch.xml").expanded()); // case 1 TEST_F(SpecialSmallCube, FunctionalTestStretchDefault) { @@ -29,7 +29,7 @@ TEST_F(SpecialSmallCube, FunctionalTestStretchDefault) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); Histogram *oCubeStats = oCube.histogram(); @@ -55,7 +55,7 @@ TEST_F(SpecialSmallCube, FunctionalTestStretchSwitchSpecial) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); Histogram *oCubeStats = oCube.histogram(); diff --git a/isis/tests/FunctionalTestsSumspice.cpp b/isis/tests/FunctionalTestsSumspice.cpp index fe6242178b..b7efc3974f 100644 --- a/isis/tests/FunctionalTestsSumspice.cpp +++ b/isis/tests/FunctionalTestsSumspice.cpp @@ -13,7 +13,7 @@ using namespace Isis; using ::testing::HasSubstr; -static QString APP_XML = FileName("$ISISROOT/bin/xml/sumspice.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/sumspice.xml").expanded()); TEST(Sumspice, FunctionalTestSumspiceTimeUpdate) { QTemporaryDir prefix; @@ -29,7 +29,7 @@ TEST(Sumspice, FunctionalTestSumspiceTimeUpdate) { UserInterface options(APP_XML, args); sumspice(options); - Cube cube(tempDest); + Cube cube(tempDest.toStdString()); Pvl *isisLabel = cube.label(); // Instrument Group @@ -71,7 +71,7 @@ TEST(Sumspice, FunctionalTestSumspicePointingUpdate) { UserInterface options(APP_XML, args); sumspice(options); - Cube cube(tempDest); + Cube cube(tempDest.toStdString()); // InstrumentPointing Table Table ptTable = cube.readTable("InstrumentPointing"); @@ -110,7 +110,7 @@ TEST(Sumspice, FunctionalTestSumspicePositionUpdate) { UserInterface options(APP_XML, args); sumspice(options); - Cube cube(tempDest); + Cube cube(tempDest.toStdString()); // InstrumentPointing Table Table ptTable = cube.readTable("InstrumentPointing"); @@ -149,7 +149,7 @@ TEST(Sumspice, FunctionalTestSumspiceSpiceUpdate) { UserInterface options(APP_XML, args); sumspice(options); - Cube cube(tempDest); + Cube cube(tempDest.toStdString()); // InstrumentPointing Table Table ptTable = cube.readTable("InstrumentPointing"); diff --git a/isis/tests/FunctionalTestsTagcams2isis.cpp b/isis/tests/FunctionalTestsTagcams2isis.cpp index b045444fce..d716ee9273 100644 --- a/isis/tests/FunctionalTestsTagcams2isis.cpp +++ b/isis/tests/FunctionalTestsTagcams2isis.cpp @@ -12,7 +12,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/tagcams2isis.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/tagcams2isis.xml").expanded()); /** * FunctionalTestTagcams2IsisNavCam @@ -37,12 +37,12 @@ TEST_F(TempTestingFiles, FunctionalTestTagcams2IsisNavCam) { } catch (IException &e) { FAIL() << "Unable to ingest OSIRIS-REx NAVCam image: " - << e.toString().toStdString().c_str() + << e.toString().c_str() << std::endl; } // open cube and read label - std::unique_ptr cube (new Cube(cubeFileName)); + std::unique_ptr cube (new Cube(cubeFileName.toStdString())); Pvl *isisLabel = cube->label(); // Core object @@ -149,12 +149,12 @@ TEST_F(TempTestingFiles, FunctionalTestTagcams2IsisNavCamRemCalPixOff) { } catch (IException &e) { FAIL() << "Unable to ingest OSIRIS-REx NAVCam image: " - << e.toString().toStdString().c_str() + << e.toString().c_str() << std::endl; } // open cube and read label - std::unique_ptr cube (new Cube(cubeFileName)); + std::unique_ptr cube (new Cube(cubeFileName.toStdString())); Pvl *isisLabel = cube->label(); // Core object @@ -259,12 +259,12 @@ TEST_F(TempTestingFiles, FunctionalTestTagcams2IsisNftCam) { } catch (IException &e) { FAIL() << "Unable to ingest OSIRIS-REx NFTCam image: " - << e.toString().toStdString().c_str() + << e.toString().c_str() << std::endl; } // open cube and read label - std::unique_ptr cube (new Cube(cubeFileName)); + std::unique_ptr cube (new Cube(cubeFileName.toStdString())); Pvl *isisLabel = cube->label(); // Core object @@ -369,12 +369,12 @@ TEST_F(TempTestingFiles, FunctionalTestTagcams2IsisStowCam) { } catch (IException &e) { FAIL() << "Unable to ingest OSIRIS-REx StowCam image: " - << e.toString().toStdString().c_str() + << e.toString().c_str() << std::endl; } // open cube and read label - std::unique_ptr cube (new Cube(cubeFileName)); + std::unique_ptr cube (new Cube(cubeFileName.toStdString())); Pvl *isisLabel = cube->label(); // Core object diff --git a/isis/tests/FunctionalTestsTgocassis2isis.cpp b/isis/tests/FunctionalTestsTgocassis2isis.cpp index 170e5b3cd0..f78cc53cf9 100644 --- a/isis/tests/FunctionalTestsTgocassis2isis.cpp +++ b/isis/tests/FunctionalTestsTgocassis2isis.cpp @@ -11,7 +11,7 @@ using namespace Isis; using ::testing::HasSubstr; -static QString APP_XML = FileName("$ISISROOT/bin/xml/tgocassis2isis.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/tgocassis2isis.xml").expanded()); TEST(TgoCassis2Isis, TgoCassis2IsisTestBlu) { QTemporaryDir prefix; @@ -24,9 +24,9 @@ TEST(TgoCassis2Isis, TgoCassis2IsisTestBlu) { tgocassis2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group @@ -133,9 +133,9 @@ TEST(TgoCassis2Isis, TgoCassis2IsisTestRed) { tgocassis2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group @@ -207,9 +207,9 @@ TEST(TgoCassis2Isis, TgoCassis2IsisTestNir) { tgocassis2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group @@ -281,9 +281,9 @@ TEST(TgoCassis2Isis, TgoCassis2IsisTestPan) { tgocassis2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group @@ -403,9 +403,9 @@ TEST(TgoCassis2Isis, TgoCassis2IsisTestReingestedUnproj) { tgocassis2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group @@ -460,9 +460,9 @@ TEST(TgoCassis2Isis, TgoCassis2IsisTestReingestedProj) { tgocassis2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group @@ -518,9 +518,9 @@ TEST(TgoCassis2Isis, TgoCassis2IsisTestPSALabel) { tgocassis2isis(options); } catch (IException &e) { - FAIL() << "Unable to ingest image: " << e.toString().toStdString().c_str() << std::endl; + FAIL() << "Unable to ingest image: " << e.toString().c_str() << std::endl; } - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); // Dimensions Group diff --git a/isis/tests/FunctionalTestsTgocassisstitch.cpp b/isis/tests/FunctionalTestsTgocassisstitch.cpp index 267905d86e..965ffccd36 100644 --- a/isis/tests/FunctionalTestsTgocassisstitch.cpp +++ b/isis/tests/FunctionalTestsTgocassisstitch.cpp @@ -12,7 +12,7 @@ using namespace Isis; using ::testing::HasSubstr; -static QString APP_XML = FileName("$ISISROOT/bin/xml/tgocassisstitch.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/tgocassisstitch.xml").expanded()); TEST(TgoCassisstitch, TgoCassisstitchMultiframeTest) { QTemporaryDir prefix; @@ -24,7 +24,7 @@ TEST(TgoCassisstitch, TgoCassisstitchMultiframeTest) { cubeList->append("data/tgoCassis/tgocassisstitch/CAS-MCO-2016-11-22T16.16.16.833-PAN-00006-B1_crop.cub"); QString cubeListFile = prefix.path() + "/cubelist.lis"; - cubeList->write(cubeListFile); + cubeList->write(cubeListFile.toStdString()); QString cubeName = "default"; @@ -39,7 +39,7 @@ TEST(TgoCassisstitch, TgoCassisstitchMultiframeTest) { FAIL() << "Unable to run tgocassisstitch with cube list: " << e.what() << std::endl; } - Cube cube(prefix.path() + "/CAS-MCO-2016-11-22T16:16:16.833.cub"); + Cube cube(prefix.path().toStdString() + "/CAS-MCO-2016-11-22T16:16:16.833.cub"); Pvl *isisLabel = cube.label(); // Dimensions Group @@ -220,7 +220,7 @@ TEST(TgoCassisstitch, TgoCassisstitchSingleframeTest) { cubeList->append("data/tgoCassis/tgocassisstitch/CAS-MCO-2016-11-22T16.16.10.833-RED-01000-B1_crop.cub"); QString cubeListFile = prefix.path() + "/cubelist.lis"; - cubeList->write(cubeListFile); + cubeList->write(cubeListFile.toStdString()); QString cubeName = "default"; @@ -236,7 +236,7 @@ TEST(TgoCassisstitch, TgoCassisstitchSingleframeTest) { FAIL() << "Unable to run tgocassisstitch with cube list: " << e.what() << std::endl; } - Cube cube(prefix.path() + "/CAS-MCO-default.cub"); + Cube cube(prefix.path().toStdString() + "/CAS-MCO-default.cub"); Pvl *isisLabel = cube.label(); // Dimensions Group diff --git a/isis/tests/FunctionalTestsTgocassisunstitch.cpp b/isis/tests/FunctionalTestsTgocassisunstitch.cpp index 5bd354e397..60692a8dfd 100644 --- a/isis/tests/FunctionalTestsTgocassisunstitch.cpp +++ b/isis/tests/FunctionalTestsTgocassisunstitch.cpp @@ -11,7 +11,7 @@ using namespace Isis; using ::testing::HasSubstr; -static QString APP_XML = FileName("$ISISROOT/bin/xml/tgocassisunstitch.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/tgocassisunstitch.xml").expanded()); TEST(TgoCassisunstitch, TgoCassisunstitchDefaultTest) { QTemporaryDir prefix; @@ -29,7 +29,7 @@ TEST(TgoCassisunstitch, TgoCassisunstitchDefaultTest) { // Unstitched Pan Cube QString panFile = prefix.path() + "/unstitched_PAN.cub"; - Cube panCube(panFile); + Cube panCube(panFile.toStdString()); Pvl *panLabel = panCube.label(); // Dimensions group @@ -118,7 +118,7 @@ TEST(TgoCassisunstitch, TgoCassisunstitchDefaultTest) { // Unstitched Red Cube QString redFile = prefix.path() + "/unstitched_RED.cub"; - Cube redCube(redFile); + Cube redCube(redFile.toStdString()); Pvl *redLabel = redCube.label(); // Dimensions group @@ -208,7 +208,7 @@ TEST(TgoCassisunstitch, TgoCassisunstitchDefaultTest) { // Unstitched Blu Cube QString bluFile = prefix.path() + "/unstitched_BLU.cub"; - Cube bluCube(bluFile); + Cube bluCube(bluFile.toStdString()); Pvl *bluLabel = bluCube.label(); // Dimensions group @@ -298,7 +298,7 @@ TEST(TgoCassisunstitch, TgoCassisunstitchDefaultTest) { // Unstitched Nir Cube QString nirFile = prefix.path() + "/unstitched_NIR.cub"; - Cube nirCube(nirFile); + Cube nirCube(nirFile.toStdString()); Pvl *nirLabel = nirCube.label(); // Dimensions group @@ -403,7 +403,7 @@ TEST(TgoCassisunstitch, TgoCassisunstitchSpiceTest) { // Unstitched Pan Cube QString panFile = prefix.path() + "/unstitched_PAN.cub"; - Cube panCube(panFile); + Cube panCube(panFile.toStdString()); Pvl *panLabel = panCube.label(); // Dimensions group @@ -501,7 +501,7 @@ TEST(TgoCassisunstitch, TgoCassisunstitchSpiceTest) { // Unstitched Red Cube QString redFile = prefix.path() + "/unstitched_RED.cub"; - Cube redCube(redFile); + Cube redCube(redFile.toStdString()); Pvl *redLabel = redCube.label(); // Dimensions group @@ -600,7 +600,7 @@ TEST(TgoCassisunstitch, TgoCassisunstitchSpiceTest) { // Unstitched Blu Cube QString bluFile = prefix.path() + "/unstitched_BLU.cub"; - Cube bluCube(bluFile); + Cube bluCube(bluFile.toStdString()); Pvl *bluLabel = bluCube.label(); // Dimensions group @@ -699,7 +699,7 @@ TEST(TgoCassisunstitch, TgoCassisunstitchSpiceTest) { // Unstitched Nir Cube QString nirFile = prefix.path() + "/unstitched_NIR.cub"; - Cube nirCube(nirFile); + Cube nirCube(nirFile.toStdString()); Pvl *nirLabel = nirCube.label(); // Dimensions group diff --git a/isis/tests/FunctionalTestsThm2isis.cpp b/isis/tests/FunctionalTestsThm2isis.cpp index f8dbde7c3f..078956f6dd 100644 --- a/isis/tests/FunctionalTestsThm2isis.cpp +++ b/isis/tests/FunctionalTestsThm2isis.cpp @@ -10,7 +10,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/thm2isis.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/thm2isis.xml").expanded()); TEST_F(TempTestingFiles, FunctionalTestThm2isisVis) { // tempDir exists if the fixture subclasses TempTestingFiles, which most do @@ -26,7 +26,7 @@ TEST_F(TempTestingFiles, FunctionalTestThm2isisVis) { } // open even cube - Cube evenCube( tempDir.path() + "/test.even.cub"); + Cube evenCube( tempDir.path().toStdString() + "/test.even.cub"); Pvl *isisLabel = evenCube.label(); // Dimensions Group @@ -79,7 +79,7 @@ TEST_F(TempTestingFiles, FunctionalTestThm2isisVis) { EXPECT_NEAR(hist->StandardDeviation(), 2.241887e-05, .00001); // open odd cube - Cube oddCube( tempDir.path() + "/test.odd.cub"); + Cube oddCube( tempDir.path().toStdString() + "/test.odd.cub"); isisLabel = oddCube.label(); // Dimensions Group @@ -148,7 +148,7 @@ TEST_F(TempTestingFiles, FunctionalTestThm2isisIr) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName); + Cube oCube(outCubeFileName.toStdString()); Pvl *isisLabel = oCube.label(); // Dimensions Group @@ -212,7 +212,7 @@ TEST_F(TempTestingFiles, FunctionalTestThm2isisOutAttributes) { } // open even cube - Cube evenCube( tempDir.path() + "/test.even.cub"); + Cube evenCube( tempDir.path().toStdString() + "/test.even.cub"); // Pixels Group EXPECT_EQ(PixelTypeName(evenCube.pixelType()), "UnsignedByte"); diff --git a/isis/tests/FunctionalTestsVikcal.cpp b/isis/tests/FunctionalTestsVikcal.cpp index 076f17bd94..a05e37c6ff 100644 --- a/isis/tests/FunctionalTestsVikcal.cpp +++ b/isis/tests/FunctionalTestsVikcal.cpp @@ -10,7 +10,7 @@ using namespace Isis; -static QString APP_XML = FileName("$ISISROOT/bin/xml/vikcal.xml").expanded(); +static QString APP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/vikcal.xml").expanded()); TEST_F(DefaultCube, FunctionalTestVikcalDefault) { // Note: DefaultCube is a viking image @@ -26,7 +26,7 @@ TEST_F(DefaultCube, FunctionalTestVikcalDefault) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube oCube(outCubeFileName, "r"); + Cube oCube(outCubeFileName.toStdString(), "r"); PvlGroup radGroup = oCube.label()->findObject("IsisCube").findGroup("Radiometry"); @@ -77,8 +77,8 @@ TEST_F(DefaultCube, FunctionalTestCtxcalCameraComparison) { FAIL() << "Unable to open image: " << e.what() << std::endl; } - Cube oNoCamCube(outCubeFileNameCam, "r"); - Cube oCamCube(outCubeFileNameCam, "r"); + Cube oNoCamCube(outCubeFileNameCam.toStdString(), "r"); + Cube oCamCube(outCubeFileNameCam.toStdString(), "r"); Pvl *noCamLab = oNoCamCube.label(); Pvl *camLab = oCamCube.label(); diff --git a/isis/tests/GaussianDistributionTests.cpp b/isis/tests/GaussianDistributionTests.cpp index 3d0b5b0821..4a7ea78dee 100644 --- a/isis/tests/GaussianDistributionTests.cpp +++ b/isis/tests/GaussianDistributionTests.cpp @@ -27,7 +27,7 @@ TEST(GaussianDistribution, Constructor) { TEST(GaussianDistribution, InvalidPercentage) { Isis::GaussianDistribution dist; - std::string message = "Argument percent outside of the range 0 to 100"; + QString message = "Argument percent outside of the range 0 to 100"; try { dist.InverseCumulativeDistribution(110); } diff --git a/isis/tests/IDTests.cpp b/isis/tests/IDTests.cpp index 9878ebdca8..bf630b0a19 100644 --- a/isis/tests/IDTests.cpp +++ b/isis/tests/IDTests.cpp @@ -20,7 +20,7 @@ TEST(ID, ConstructorSetBaseNum) { TEST(ID, ConstructorNoReplacement) { - std::string message = "No replacement set in string"; + QString message = "No replacement set in string"; try { Isis::ID pid("ABC"); FAIL() << "Expected an IException"; @@ -35,7 +35,7 @@ TEST(ID, ConstructorNoReplacement) { TEST(ID, ConstructorMultipleReplacements) { - std::string message = "contains more than one replacement set"; + QString message = "contains more than one replacement set"; try { Isis::ID pid("A?B?C"); FAIL() << "Expected an IException"; @@ -65,7 +65,7 @@ TEST(ID, Next) { } TEST(ID, NextMaximumReached) { - std::string message = "Maximum number reached for string"; + QString message = "Maximum number reached for string"; try { Isis::ID pid("ABC?"); for (int i = 0; i < 11; i++) { diff --git a/isis/tests/ImageImporterTests.cpp b/isis/tests/ImageImporterTests.cpp index 8fd17e2f36..45b535458b 100644 --- a/isis/tests/ImageImporterTests.cpp +++ b/isis/tests/ImageImporterTests.cpp @@ -17,7 +17,7 @@ TEST_F(TempTestingFiles, DISABLED_UnitTestImageImporterTestJpeg) { FileName inputName("data/stdFormatImages/rgb.jpg"); ImageImporter *importer = ImageImporter::fromFileName(inputName); - FileName outputName(tempDir.path() + "/out.cub"); + FileName outputName(tempDir.path().toStdString() + "/out.cub"); importer->import(outputName); delete importer; @@ -52,7 +52,7 @@ TEST_F(TempTestingFiles, UnitTestImageImporterStd2IsisTiffRgb) { FileName inputName("data/stdFormatImages/rgb.tif"); ImageImporter *importer = ImageImporter::fromFileName(inputName); - FileName outputName(tempDir.path() + "/out.cub"); + FileName outputName(tempDir.path().toStdString() + "/out.cub"); importer->import(outputName); delete importer; @@ -87,7 +87,7 @@ TEST_F(TempTestingFiles, UnitTestImageImporterStd2IsisJp2) { FileName inputName("data/stdFormatImages/rgb.jp2"); ImageImporter *importer = ImageImporter::fromFileName(inputName); - FileName outputName(tempDir.path() + "/out.cub"); + FileName outputName(tempDir.path().toStdString() + "/out.cub"); importer->import(outputName); delete importer; diff --git a/isis/tests/IsisDataFixtures.cpp b/isis/tests/IsisDataFixtures.cpp index b98afa49c1..9f5580bf2b 100644 --- a/isis/tests/IsisDataFixtures.cpp +++ b/isis/tests/IsisDataFixtures.cpp @@ -14,11 +14,11 @@ namespace Isis { QString IsisDataInventory::system_isisdata() const { - return ( m_system_isisdata.expanded() ); + return ( QString::fromStdString(m_system_isisdata.expanded()) ); } QString IsisDataInventory::isisdatadir() const { - return ( m_isisdatadir.expanded() ); + return ( QString::fromStdString(m_isisdatadir.expanded()) ); } QString IsisDataInventory::isisdata_path() const { @@ -40,7 +40,7 @@ namespace Isis { json_t IsisDataInventory::get_real_file_info( const QString &fname ) const { - FileName v_fname = FileName( fname ); + FileName v_fname = FileName( fname.toStdString() ); QFileInfo qinfo( fname ); json_t file_json; try { diff --git a/isis/tests/LatitudeTests.cpp b/isis/tests/LatitudeTests.cpp index 0675f03e05..75d9a19b83 100644 --- a/isis/tests/LatitudeTests.cpp +++ b/isis/tests/LatitudeTests.cpp @@ -99,7 +99,7 @@ TEST_F(Latitude_MappingGroupTest, DegreePlanetocentricConstructor) { TEST_F(Latitude_MappingGroupTest, AngleIncorrectLatitudeType) { - std::string message = "is not recognized"; + QString message = "is not recognized"; try { mappingGroup["LatitudeType"][0] = "InvalidValue"; Isis::Angle angle(45.0, Isis::Angle::Degrees); @@ -116,7 +116,7 @@ TEST_F(Latitude_MappingGroupTest, AngleIncorrectLatitudeType) { TEST_F(Latitude_MappingGroupTest, DegreeIncorrectLatitudeType) { - std::string message = "is not recognized"; + QString message = "is not recognized"; try { mappingGroup["LatitudeType"][0] = "InvalidValue"; Isis::Latitude latitude(45.0, mappingGroup, Isis::Angle::Degrees); @@ -132,7 +132,7 @@ TEST_F(Latitude_MappingGroupTest, DegreeIncorrectLatitudeType) { TEST_F(Latitude_MappingGroupTest, AngleMissingRadii) { - std::string message = "Unable to create Latitude object from given mapping group"; + QString message = "Unable to create Latitude object from given mapping group"; try { mappingGroup.deleteKeyword("EquatorialRadius"); Isis::Angle angle(45.0, Isis::Angle::Degrees); @@ -149,7 +149,7 @@ TEST_F(Latitude_MappingGroupTest, AngleMissingRadii) { TEST_F(Latitude_MappingGroupTest, DegreeMissingRadii) { - std::string message = "Unable to create Latitude object from given mapping group"; + QString message = "Unable to create Latitude object from given mapping group"; try { mappingGroup.deleteKeyword("EquatorialRadius"); Isis::Latitude latitude(45.0, mappingGroup, Isis::Angle::Degrees); @@ -247,7 +247,7 @@ TEST(Latitude, SetPlanetocentricPastPole) { TEST(Latitude, SetPlanetocentricOutOfRange) { - std::string message = "Latitudes outside of the -90/90 range cannot be converted"; + QString message = "Latitudes outside of the -90/90 range cannot be converted"; try { Isis::Latitude latitude(30.0, Isis::Distance(1.0, Isis::Distance::Units::Meters), @@ -278,7 +278,7 @@ TEST(Latitude, SetPlanetographic) { TEST(Latitude, SetPlanetographicRadiiNotSet) { - std::string message = "cannot be converted to Planetocentic without the planetary radii"; + QString message = "cannot be converted to Planetocentic without the planetary radii"; try { Isis::Latitude latitude(30.0, Isis::Angle::Degrees); latitude.setPlanetographic(45.0, Isis::Angle::Degrees); @@ -294,7 +294,7 @@ TEST(Latitude, SetPlanetographicRadiiNotSet) { TEST(Latitude, SetPlanetographicOutOfRange) { - std::string message = "Latitudes outside of the -90/90 range cannot be converted"; + QString message = "Latitudes outside of the -90/90 range cannot be converted"; try { Isis::Latitude latitude(30.0, Isis::Distance(1.0, Isis::Distance::Units::Meters), @@ -339,7 +339,7 @@ TEST(Latitude, OutOfRange) { TEST(Latitude, MinGreaterThanMax) { - std::string message = "is greater than maximum latitude"; + QString message = "is greater than maximum latitude"; try{ Isis::Latitude latitudeMin(3.0, Isis::Angle::Degrees); Isis::Latitude latitudeMax(1.0, Isis::Angle::Degrees); @@ -383,7 +383,7 @@ TEST_F(Latitude_MappingGroupTest, AddPlanetographic) { TEST_F(Latitude_MappingGroupTest, AddIncorrectLatitudeType) { - std::string message = "is not recognized"; + QString message = "is not recognized"; try { mappingGroup["LatitudeType"][0] = "Planetographic"; Isis::Angle angle(1.0, Isis::Angle::Degrees); diff --git a/isis/tests/LineEquationTests.cpp b/isis/tests/LineEquationTests.cpp index 549c0da07a..a0bf222420 100644 --- a/isis/tests/LineEquationTests.cpp +++ b/isis/tests/LineEquationTests.cpp @@ -55,8 +55,8 @@ TEST(LineEquation, AddingPoints) } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Line equation is already defined")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Line equation is already defined")) + << e.toString(); } catch(...) { @@ -83,8 +83,8 @@ TEST(LineEquation, UndefinedSlope) } catch(Isis::IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Line equation undefined")) - < args = {"from="+projTestCube->fileName(), "match="+testCube->fileName(), "to="+tempDir.path()+"/level1.cub"}; UserInterface ui(APP_XML, args); map2cam_f(ui); - Cube ocube(tempDir.path()+"/level1.cub"); + Cube ocube(tempDir.path().toStdString()+"/level1.cub"); ASSERT_TRUE(ocube.label()->findObject("IsisCube").hasGroup("Kernels")); ASSERT_FALSE(ocube.label()->findObject("IsisCube").hasGroup("Mapping")); diff --git a/isis/tests/MatrixTests.cpp b/isis/tests/MatrixTests.cpp index 9e9c35c880..5374e46750 100644 --- a/isis/tests/MatrixTests.cpp +++ b/isis/tests/MatrixTests.cpp @@ -151,8 +151,8 @@ namespace Isis { FAIL() << "Expected an IException"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Invalid matrix dimensions")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Invalid matrix dimensions") != std::string::npos) + << e.toString(); } catch(...) { FAIL() << "Expected error message: Invalid matrix dimensions"; @@ -163,8 +163,8 @@ namespace Isis { FAIL() << "Expected an IException"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Invalid matrix dimensions")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Invalid matrix dimensions") != std::string::npos) + << e.toString(); } catch(...) { FAIL() << "Expected error message: Invalid matrix dimensions"; @@ -178,8 +178,8 @@ namespace Isis { FAIL() << "Expected an IException"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Invalid matrix dimensions")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Invalid matrix dimensions") != std::string::npos) + << e.toString(); } catch(...) { FAIL() << "Expected error message: Invalid matrix dimensions"; @@ -190,8 +190,8 @@ namespace Isis { FAIL() << "Expected an IException"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Invalid matrix dimensions")) - << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Invalid matrix dimensions") != std::string::npos) + << e.toString(); } catch(...) { FAIL() << "Expected error message: Invalid matrix dimensions"; @@ -207,8 +207,8 @@ namespace Isis { FAIL() << "Expected an IException"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Unable to calculate the determinant, the " - "matrix is not square")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Unable to calculate the determinant, the " + "matrix is not square") != std::string::npos) << e.toString(); } catch(...) { FAIL() << "Expected error message: Unable to calculate the determinant, the matrix is not square."; @@ -224,8 +224,8 @@ namespace Isis { FAIL() << "Expected an IException"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Unable to calculate the trace, the matrix is " - "not square")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Unable to calculate the trace, the matrix is " + "not square") != std::string::npos) << e.toString(); } catch(...) { FAIL() << "Expected error message: Unable to calculate the trace, the matrix is not square."; @@ -243,8 +243,8 @@ namespace Isis { FAIL() << "Expected an IException"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Incompatible matrix dimensions, cannot add " - "the matrices")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Incompatible matrix dimensions, cannot add " + "the matrices") != std::string::npos) << e.toString(); } catch(...) { FAIL() << "Expected error message: Incompatible matrix dimensions, cannot add the matrices."; @@ -255,8 +255,8 @@ namespace Isis { FAIL() << "Expected an IException"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Incompatible matrix dimensions, cannot add " - "the matrices")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Incompatible matrix dimensions, cannot add " + "the matrices") != std::string::npos) << e.toString(); } catch(...) { FAIL() << "Expected error message: Incompatible matrix dimensions, cannot add the matrices."; @@ -274,8 +274,8 @@ namespace Isis { FAIL() << "Expected an IException"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Incompatible matrix dimensions, cannot " - "subtract the matrices")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Incompatible matrix dimensions, cannot " + "subtract the matrices") != std::string::npos) << e.toString(); } catch(...) { FAIL() << "Expected error message: Incompatible matrix dimensions, cannot subtract the matrices."; @@ -286,8 +286,8 @@ namespace Isis { FAIL() << "Expected an IException"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Incompatible matrix dimensions, cannot " - "subtract the matrices")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Incompatible matrix dimensions, cannot " + "subtract the matrices") != std::string::npos) << e.toString(); } catch(...) { FAIL() << "Expected error message: Incompatible matrix dimensions, cannot subtract the matrices."; @@ -304,8 +304,8 @@ namespace Isis { FAIL() << "Expected an IException"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Incompatible matrix dimensions, cannot " - "multiply the matrices")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Incompatible matrix dimensions, cannot " + "multiply the matrices") != std::string::npos) << e.toString(); } catch(...) { FAIL() << "Expected error message: Incompatible matrix dimensions, cannot multiply the matrices."; @@ -323,8 +323,8 @@ namespace Isis { FAIL() << "Expected an IException"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Incompatible matrix dimensions, cannot " - "multiply the matrices")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Incompatible matrix dimensions, cannot " + "multiply the matrices") != std::string::npos) << e.toString(); } catch(...) { FAIL() << "Expected error message: Incompatible matrix dimensions, cannot multiply the matrices."; @@ -335,8 +335,8 @@ namespace Isis { FAIL() << "Expected an IException"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Incompatible matrix dimensions, cannot " - "multiply the matrices")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Incompatible matrix dimensions, cannot " + "multiply the matrices") != std::string::npos) << e.toString(); } catch(...) { FAIL() << "Expected error message: Incompatible matrix dimensions, cannot multiply the matrices."; @@ -352,8 +352,8 @@ namespace Isis { FAIL() << "Expected an IException"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Unable to calculate the inverse, the matrix " - "is not square")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Unable to calculate the inverse, the matrix " + "is not square") != std::string::npos) << e.toString(); } catch(...) { FAIL() << "Expected error message: Unable to calculate the inverse, the matrix is not square."; @@ -369,8 +369,8 @@ namespace Isis { FAIL() << "Expected an IException"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Unable to calculate eigenvalues, the matrix " - "is not square")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Unable to calculate eigenvalues, the matrix " + "is not square") != std::string::npos) << e.toString(); } catch(...) { FAIL() << "Expected error message: Unable to calculate eigenvalues, the matrix is not square."; @@ -386,8 +386,8 @@ namespace Isis { FAIL() << "Expected an IException"; } catch(IException &e) { - EXPECT_TRUE(e.toString().toLatin1().contains("Unable to calculate eigenvectors, the matrix " - "is not square")) << e.toString().toStdString(); + EXPECT_TRUE(e.toString().find("Unable to calculate eigenvectors, the matrix " + "is not square") != std::string::npos) << e.toString(); } catch(...) { FAIL() << "Expected error message: Unable to calculate eigenvectors, the matrix is not square."; diff --git a/isis/tests/NetworkFixtures.cpp b/isis/tests/NetworkFixtures.cpp index baa206a714..552c15d9cc 100644 --- a/isis/tests/NetworkFixtures.cpp +++ b/isis/tests/NetworkFixtures.cpp @@ -25,7 +25,7 @@ namespace Isis { twoImageOverlapFile = new FileName("data/threeImageNetwork/twoImageOverlaps.lis"); cube1 = new Cube(); - cube1->fromIsd(tempDir.path() + "/cube1.cub", labelPath1, *isdPath1, "rw"); + cube1->fromIsd(tempDir.path().toStdString() + "/cube1.cub", labelPath1, *isdPath1, "rw"); ImagePolygon poly; coords = {{30, 0}, @@ -37,7 +37,7 @@ namespace Isis { cube1->write(poly); cube2 = new Cube(); - cube2->fromIsd(tempDir.path() + "/cube2.cub", labelPath2, *isdPath2, "rw"); + cube2->fromIsd(tempDir.path().toStdString() + "/cube2.cub", labelPath2, *isdPath2, "rw"); coords = {{31, 1}, {31, 11}, @@ -48,7 +48,7 @@ namespace Isis { cube2->write(poly); cube3 = new Cube(); - cube3->fromIsd(tempDir.path() + "/cube3.cub", labelPath3, *isdPath3, "rw"); + cube3->fromIsd(tempDir.path().toStdString() + "/cube3.cub", labelPath3, *isdPath3, "rw"); LineManager line(*cube1); LineManager line2(*cube2); @@ -83,15 +83,15 @@ namespace Isis { cube3->reopen("rw"); cubeList = new FileList(); - cubeList->append(cube1->fileName()); - cubeList->append(cube2->fileName()); + cubeList->append(cube1->fileName().toStdString()); + cubeList->append(cube2->fileName().toStdString() ); twoCubeListFile = tempDir.path() + "/2cubes.lis"; - cubeList->write(twoCubeListFile); - cubeList->append(cube3->fileName()); + cubeList->write(twoCubeListFile.toStdString()); + cubeList->append(cube3->fileName().toStdString()); cubeListFile = tempDir.path() + "/cubes.lis"; - cubeList->write(cubeListFile); + cubeList->write(cubeListFile.toStdString()); networkFile = "data/threeImageNetwork/controlnetwork.net"; @@ -101,9 +101,9 @@ namespace Isis { cube1map = new Cube(); cube2map = new Cube(); cube3map = new Cube(); - cube1map->fromIsd(tempDir.path() + "/cube1map.cub", mappedLabelPath1, *isdPath1, "rw"); - cube2map->fromIsd(tempDir.path() + "/cube2map.cub", mappedLabelPath2, *isdPath2, "rw"); - cube3map->fromIsd(tempDir.path() + "/cube3map.cub", mappedLabelPath3, *isdPath3, "rw"); + cube1map->fromIsd(tempDir.path().toStdString() + "/cube1map.cub", mappedLabelPath1, *isdPath1, "rw"); + cube2map->fromIsd(tempDir.path().toStdString() + "/cube2map.cub", mappedLabelPath2, *isdPath2, "rw"); + cube3map->fromIsd(tempDir.path().toStdString() + "/cube3map.cub", mappedLabelPath3, *isdPath3, "rw"); grid_fastgeom_config = "data/threeImageNetwork/grid_fastgeom_algorithm.pvl"; radial_fastgeom_config = "data/threeImageNetwork/radial_fastgeom_algorithm.pvl"; @@ -140,15 +140,15 @@ namespace Isis { for(int i = 0; i < cubes.size(); i++) { int n = i+1; // filenames use 1 based indexing - isdFiles.push_back(FileName("data/apolloNetwork/apolloImage"+QString::number(n)+".isd")); - labelFiles.push_back(FileName("data/apolloNetwork/apolloImage"+QString::number(n)+".pvl")); + isdFiles.push_back(FileName("data/apolloNetwork/apolloImage"+toString(n)+".isd")); + labelFiles.push_back(FileName("data/apolloNetwork/apolloImage"+toString(n)+".pvl")); cubes[i] = new Cube(); - cubes[i]->fromIsd(tempDir.path() + "/cube"+QString::number(n)+".cub", labelFiles[i], isdFiles[i], "rw"); - cubeList->append(cubes[i]->fileName()); + cubes[i]->fromIsd(tempDir.path().toStdString() + "/cube"+toString(n)+".cub", labelFiles[i], isdFiles[i], "rw"); + cubeList->append(cubes[i]->fileName().toStdString()); } cubeListFile = tempDir.path() + "/cubes.lis"; - cubeList->write(cubeListFile); + cubeList->write(cubeListFile.toStdString()); network = new ControlNet("data/apolloNetwork/apolloNet.pvl"); controlNetPath = tempDir.path() + "/apolloNet.net"; @@ -182,20 +182,20 @@ namespace Isis { cubeLPath = tempDir.path() + "/observationPairL.cub"; cubeRPath = tempDir.path() + "/observationPairR.cub"; - cubeL->fromIsd(cubeLPath, labelPathL, *isdPathL, "rw"); + cubeL->fromIsd(cubeLPath.toStdString(), labelPathL, *isdPathL, "rw"); Pvl originalPdsLabL("data/observationPair/observationImageLOriginalLabel.pvl"); OriginalLabel origLabel(originalPdsLabL); cubeL->write(origLabel); cubeL->reopen("rw"); - cubeR->fromIsd(cubeRPath, labelPathR, *isdPathR, "rw"); + cubeR->fromIsd(cubeRPath.toStdString(), labelPathR, *isdPathR, "rw"); cubeList = new FileList(); - cubeList->append(cubeL->fileName()); - cubeList->append(cubeR->fileName()); + cubeList->append(cubeL->fileName().toStdString()); + cubeList->append(cubeR->fileName().toStdString()); cubeListFile = tempDir.path() + "/cubes.lis"; - cubeList->write(cubeListFile); + cubeList->write(cubeListFile.toStdString()); cnetPath = "data/observationPair/observationPair.net"; network = new ControlNet(); @@ -229,13 +229,13 @@ namespace Isis { cubeList = new FileList(); - cubeList->append(testCube1->fileName()); - cubeList->append(testCube2->fileName()); - cubeList->append(testCube3->fileName()); + cubeList->append(testCube1->fileName().toStdString()); + cubeList->append(testCube2->fileName().toStdString()); + cubeList->append(testCube3->fileName().toStdString()); cubeListFile = tempDir.path() + "/cubes.lis"; - cubeList->write(cubeListFile); + cubeList->write(cubeListFile.toStdString()); network = new ControlNet("data/miniRFImage/Cabeus_Orbit400_withSS_AprioriPts.net"); controlNetPath = tempDir.path() + "/miniRFNet.net"; @@ -273,14 +273,14 @@ namespace Isis { cubeList = new FileList(); - cubeList->append(testCube1->fileName()); - cubeList->append(testCube2->fileName()); - cubeList->append(testCube3->fileName()); - cubeList->append(testCube4->fileName()); + cubeList->append(testCube1->fileName().toStdString()); + cubeList->append(testCube2->fileName().toStdString()); + cubeList->append(testCube3->fileName().toStdString()); + cubeList->append(testCube4->fileName().toStdString()); cubeListFile = tempDir.path() + "/cubes.lis"; - cubeList->write(cubeListFile); + cubeList->write(cubeListFile.toStdString()); network = new ControlNet("data/vikingThemisNetwork/themis_dayir_VO_arcadia_extract_hand.net"); controlNetPath = tempDir.path() + "/vikThmNet.net"; @@ -327,20 +327,20 @@ namespace Isis { cube1Path = tempDir.path() + "/lidarObservationPair1.cub"; cube2Path = tempDir.path() + "/lidarObservationPair2.cub"; - cube1->fromIsd(cube1Path, labelPath1, *isdPath1, "rw"); + cube1->fromIsd(cube1Path.toStdString(), labelPath1, *isdPath1, "rw"); Pvl originalPdsLab1("data/lidarObservationPair/lidarObservationImage1OriginalLabel.pvl"); OriginalLabel origLabel(originalPdsLab1); cube1->write(origLabel); cube1->reopen("rw"); - cube2->fromIsd(cube2Path, labelPath2, *isdPath2, "rw"); + cube2->fromIsd(cube2Path.toStdString(), labelPath2, *isdPath2, "rw"); cubeList = new FileList(); - cubeList->append(cube1->fileName()); - cubeList->append(cube2->fileName()); + cubeList->append(cube1->fileName().toStdString()); + cubeList->append(cube2->fileName().toStdString()); cubeListFile = tempDir.path() + "/cubes.lis"; - cubeList->write(cubeListFile); + cubeList->write(cubeListFile.toStdString()); csvPath = "data/lidarObservationPair/lidarPoints.csv"; } @@ -367,7 +367,7 @@ namespace Isis { // lrolola2isis from=../isis/tests/data/lidarObservationPair/lidarPoints.csv cubes=cubes.lis point_range_sigma=10 point_lat=10 point_rad=10 point_lon=10 pointid="Lidar????" outputtype=JSON to=lidarData.json // Additionally the point Lidar0068 may need to be removed from a newly generated data file lidarDataPath = "data/LidarNetwork/lidarData.json"; - rangeData.read(lidarDataPath); + rangeData.read(lidarDataPath.toStdString()); controlNetPath = "data/LidarNetwork/network.pvl"; network = new ControlNet(controlNetPath); diff --git a/isis/tests/PvlObjectTests.cpp b/isis/tests/PvlObjectTests.cpp index c730b3ff35..92c30c13c8 100644 --- a/isis/tests/PvlObjectTests.cpp +++ b/isis/tests/PvlObjectTests.cpp @@ -48,7 +48,7 @@ TEST(PvlObject, KeywordError) { o.findKeyword("CAT", PvlObject::Traverse); } catch (IException &e) { - EXPECT_TRUE(e.toString().contains("Unable to find PVL keyword")); + EXPECT_TRUE(e.toString().find("Unable to find PVL keyword") != std::string::npos); return; } @@ -73,7 +73,7 @@ TEST(PvlObject, invalidStream) { os >> o; } catch(IException &e) { - EXPECT_TRUE(e.toString().contains("Unexpected [EndGroup] in PVL Object")); + EXPECT_TRUE(e.toString().find("Unexpected [EndGroup] in PVL Object") != std::string::npos); return; } diff --git a/isis/tests/SensorUtilWrappersTests.cpp b/isis/tests/SensorUtilWrappersTests.cpp index 85e1a96a6c..2698f4a08a 100644 --- a/isis/tests/SensorUtilWrappersTests.cpp +++ b/isis/tests/SensorUtilWrappersTests.cpp @@ -31,7 +31,7 @@ class SpiceKernels : public ::testing::Test { frameCode = -94031; targetCode = 499; - QString dir = FileName("$ISISTESTDATA/isis/src/base/unitTestData/kernels").expanded() + "/"; + QString dir = QString::fromStdString(FileName("$ISISTESTDATA/isis/src/base/unitTestData/kernels").expanded() + "/"); kernels.clear(); kernels.push_back(dir + "naif0007.tls"); kernels.push_back(dir + "MGS_SCLKSCET.00045.tsc"); diff --git a/isis/tests/SpiceRotationTests.cpp b/isis/tests/SpiceRotationTests.cpp index 75ca7fe019..4933388c5e 100644 --- a/isis/tests/SpiceRotationTests.cpp +++ b/isis/tests/SpiceRotationTests.cpp @@ -49,7 +49,7 @@ class SpiceRotationKernels : public ::testing::Test { frameCode = -94031; targetCode = 499; - QString dir = FileName("$ISISTESTDATA/isis/src/base/unitTestData/kernels").expanded() + "/"; + QString dir = QString::fromStdString(FileName("$ISISTESTDATA/isis/src/base/unitTestData/kernels").expanded() + "/"); kernels.clear(); kernels.push_back(dir + "naif0007.tls"); kernels.push_back(dir + "MGS_SCLKSCET.00045.tsc"); diff --git a/isis/tests/TestUtilities.cpp b/isis/tests/TestUtilities.cpp index 9a192c3466..e67ded6259 100644 --- a/isis/tests/TestUtilities.cpp +++ b/isis/tests/TestUtilities.cpp @@ -14,10 +14,10 @@ namespace Isis { const char* contents_expr, IException &e, QString contents) { - if (e.toString().contains(contents)) return ::testing::AssertionSuccess(); + if (e.toString().find(contents.toStdString()) != std::string::npos) return ::testing::AssertionSuccess(); return ::testing::AssertionFailure() << "IExeption "<< e_expr << "\'s error message (\"" - << e.toString().toStdString() << "\") does not contain " << contents_expr << " (\"" + << e.toString() << "\") does not contain " << contents_expr << " (\"" << contents.toStdString() << "\")."; } @@ -400,18 +400,18 @@ namespace Isis { QVector binaryKernelList; for (QString kernel : kernelList) { - FileName file(kernel); - QString pathToBinaryKernel = file.path() + "/" + file.baseName() + "." + file.extension().replace('x', 'b'); - FileName binaryFile(pathToBinaryKernel); + FileName file(kernel.toStdString()); + QString pathToBinaryKernel = QString::fromStdString(file.path() + "/" + file.baseName()) + "." + QString::fromStdString(file.extension()).replace('x', 'b'); + FileName binaryFile(pathToBinaryKernel.toStdString()); - if (file.extension().contains("x") && !binaryFile.fileExists()) { - QString path = file.expanded(); + if (file.extension().find("x") != std::string::npos && !binaryFile.fileExists()) { + QString path = QString::fromStdString(file.expanded()); QString command = "tobin " + path; - command += " >nul 2>nul"; + command += " >nul 2>nul"; int status = system(command.toLatin1().data()); if (status != 0) { - std::string msg = "Executing command [" + command + + std::string msg = "Executing command [" + command.toStdString() + "] failed with return status [" + toString(status) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } @@ -422,10 +422,10 @@ namespace Isis { } QString fileListToString(QVector fileList) { - QString filesAsString("("); + std::string filesAsString("("); for (int i = 0; i < fileList.size(); i++) { - FileName file(fileList[i]); + FileName file(fileList[i].toStdString()); filesAsString += file.expanded(); if (i != fileList.size() - 1) { @@ -433,7 +433,7 @@ namespace Isis { } } filesAsString += ")"; - return filesAsString; + return QString::fromStdString(filesAsString); } } diff --git a/isis/tests/TgoCassisModuleTests.cpp b/isis/tests/TgoCassisModuleTests.cpp index 4c10c89f3d..4c8975ef6f 100644 --- a/isis/tests/TgoCassisModuleTests.cpp +++ b/isis/tests/TgoCassisModuleTests.cpp @@ -20,15 +20,15 @@ using namespace Isis; -static QString TGOCASSIS2ISIS_XML = FileName("$ISISROOT/bin/xml/tgocassis2isis.xml").expanded(); -static QString RDRGEN_XML = FileName("$ISISROOT/bin/xml/tgocassisrdrgen.xml").expanded(); -static QString MOS_XML = FileName("$ISISROOT/bin/xml/tgocassismos.xml").expanded(); -static QString SPICEINIT_XML = FileName("$ISISROOT/bin/xml/spiceinit.xml").expanded(); -static QString STITCH_XML = FileName("$ISISROOT/bin/xml/tgocassisstitch.xml").expanded(); -static QString UNSTITCH_XML = FileName("$ISISROOT/bin/xml/tgocassisunstitch.xml").expanded(); -static QString MOSRANGE_XML = FileName("$ISISROOT/bin/xml/mosrange.xml").expanded(); -static QString CAM2MAP_XML = FileName("$ISISROOT/bin/xml/cam2map.xml").expanded(); -static QString CUBEIT_XML = FileName("$ISISROOT/bin/xml/cubeit.xml").expanded(); +static QString TGOCASSIS2ISIS_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/tgocassis2isis.xml").expanded()); +static QString RDRGEN_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/tgocassisrdrgen.xml").expanded()); +static QString MOS_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/tgocassismos.xml").expanded()); +static QString SPICEINIT_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/spiceinit.xml").expanded()); +static QString STITCH_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/tgocassisstitch.xml").expanded()); +static QString UNSTITCH_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/tgocassisunstitch.xml").expanded()); +static QString MOSRANGE_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/mosrange.xml").expanded()); +static QString CAM2MAP_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/cam2map.xml").expanded()); +static QString CUBEIT_XML = QString::fromStdString(FileName("$ISISROOT/bin/xml/cubeit.xml").expanded()); TEST_F(TgoCassisModuleKernels, TgoCassisStitchUnstitch) { @@ -129,13 +129,13 @@ TEST_F(TgoCassisModuleKernels, TgoCassisStitchUnstitch) { // run stitch and unstitch on cube list FileList *cubeList = new FileList(); - cubeList->append(panFileName); - cubeList->append(redFileName); - cubeList->append(bluFileName); - cubeList->append(nirFileName); + cubeList->append(panFileName.toStdString()); + cubeList->append(redFileName.toStdString()); + cubeList->append(bluFileName.toStdString()); + cubeList->append(nirFileName.toStdString()); QString cubeListFile = prefix.path() + "/cubelist.lis"; - cubeList->write(cubeListFile); + cubeList->write(cubeListFile.toStdString()); QVector stitchArgs = {"fromlist=" + cubeListFile, "outputprefix=" + prefix.path() + "/stitched"}; @@ -161,10 +161,10 @@ TEST_F(TgoCassisModuleKernels, TgoCassisStitchUnstitch) { // Compare Pan unstitched cube to original cube QString panUnstitchFile = prefix.path() + "/unstitched_PAN.cub"; - Cube panUnstitchCube(panUnstitchFile); + Cube panUnstitchCube(panUnstitchFile.toStdString()); Pvl *panUnstitchLabel = panUnstitchCube.label(); - Cube panOrigCube(panFileName); + Cube panOrigCube(panFileName.toStdString()); Pvl *panOrigLabel = panOrigCube.label(); // Dimensions group @@ -260,10 +260,10 @@ TEST_F(TgoCassisModuleKernels, TgoCassisStitchUnstitch) { // Compare Red unstitched cube to original cube QString redUnstitchFile = prefix.path() + "/unstitched_RED.cub"; - Cube redUnstitchCube(redUnstitchFile); + Cube redUnstitchCube(redUnstitchFile.toStdString()); Pvl *redUnstitchLabel = redUnstitchCube.label(); - Cube redOrigCube(redFileName); + Cube redOrigCube(redFileName.toStdString()); Pvl *redOrigLabel = redOrigCube.label(); // Dimensions group @@ -360,10 +360,10 @@ TEST_F(TgoCassisModuleKernels, TgoCassisStitchUnstitch) { // compare Blu unstitched cube to original cube QString bluUnstitchFile = prefix.path() + "/unstitched_BLU.cub"; - Cube bluUnstitchCube(bluUnstitchFile); + Cube bluUnstitchCube(bluUnstitchFile.toStdString()); Pvl *bluUnstitchLabel = bluUnstitchCube.label(); - Cube bluOrigCube(bluFileName); + Cube bluOrigCube(bluFileName.toStdString()); Pvl *bluOrigLabel = bluOrigCube.label(); // Dimensions group @@ -460,10 +460,10 @@ TEST_F(TgoCassisModuleKernels, TgoCassisStitchUnstitch) { // compare Nir unstitched cube to original cube QString nirUnstitchFile = prefix.path() + "/unstitched_NIR.cub"; - Cube nirUnstitchCube(nirUnstitchFile); + Cube nirUnstitchCube(nirUnstitchFile.toStdString()); Pvl *nirUnstitchLabel = nirUnstitchCube.label(); - Cube nirOrigCube(nirFileName); + Cube nirOrigCube(nirFileName.toStdString()); Pvl *nirOrigLabel = nirOrigCube.label(); // Dimensions group @@ -657,13 +657,13 @@ TEST_F(TgoCassisModuleKernels, TgoCassisSingleFrameletProjection) { // run mosrange on cube list FileList *cubeList = new FileList(); - cubeList->append(panFileName); - cubeList->append(redFileName); - cubeList->append(bluFileName); - cubeList->append(nirFileName); + cubeList->append(panFileName.toStdString()); + cubeList->append(redFileName.toStdString()); + cubeList->append(bluFileName.toStdString()); + cubeList->append(nirFileName.toStdString()); QString cubeListFile = prefix.path() + "/cubelist.lis"; - cubeList->write(cubeListFile); + cubeList->write(cubeListFile.toStdString()); QString mapFile = prefix.path() + "/equi.map"; QVector mosrangeArgs = {"fromlist=" + cubeListFile, "to=" + mapFile}; @@ -723,7 +723,7 @@ TEST_F(TgoCassisModuleKernels, TgoCassisSingleFrameletProjection) { } // PAN Cube - Cube panCube(panEquiFile); + Cube panCube(panEquiFile.toStdString()); Pvl *panLabel = panCube.label(); // Instrument Group @@ -814,7 +814,7 @@ TEST_F(TgoCassisModuleKernels, TgoCassisSingleFrameletProjection) { EXPECT_NEAR(hist->StandardDeviation(), 0.0010547865346787659, 0.0001); // NIR Cube - Cube nirCube(nirEquiFile); + Cube nirCube(nirEquiFile.toStdString()); Pvl *nirLabel = nirCube.label(); // Instrument Group @@ -905,7 +905,7 @@ TEST_F(TgoCassisModuleKernels, TgoCassisSingleFrameletProjection) { EXPECT_NEAR(hist->StandardDeviation(), 0.0015024999314775509, 0.0001); // RED Cube - Cube redCube(redEquiFile); + Cube redCube(redEquiFile.toStdString()); Pvl *redLabel = redCube.label(); // Instrument Group @@ -997,7 +997,7 @@ TEST_F(TgoCassisModuleKernels, TgoCassisSingleFrameletProjection) { // BLU Cube - Cube bluCube(bluEquiFile); + Cube bluCube(bluEquiFile.toStdString()); Pvl *bluLabel = bluCube.label(); // Instrument Group @@ -1129,7 +1129,7 @@ TEST(TgoCassisModuleTests, TgoCassisIngestReingest) { } // RED Cube - Cube redCube(reingestedFile); + Cube redCube(reingestedFile.toStdString()); Pvl *redLabel = redCube.label(); // Instrument Group @@ -1267,13 +1267,13 @@ TEST_F(TgoCassisModuleKernels, TgoCassisTestColorMosaic) { // run mosrange on cube list FileList *cubeList = new FileList(); - cubeList->append(panFileName); - cubeList->append(redFileName); - cubeList->append(bluFileName); - cubeList->append(nirFileName); + cubeList->append(panFileName.toStdString()); + cubeList->append(redFileName.toStdString()); + cubeList->append(bluFileName.toStdString()); + cubeList->append(nirFileName.toStdString()); QString cubeListFile = prefix.path() + "/cubelist.lis"; - cubeList->write(cubeListFile); + cubeList->write(cubeListFile.toStdString()); QString mapFile = prefix.path() + "/equi.map"; QVector mosrangeArgs = {"fromlist=" + cubeListFile, "to=" + mapFile}; @@ -1303,9 +1303,9 @@ TEST_F(TgoCassisModuleKernels, TgoCassisTestColorMosaic) { } FileList *panMosaicList = new FileList(); - panMosaicList->append(panEquiFile); + panMosaicList->append(panEquiFile.toStdString()); QString panListFile = prefix.path() + "/panMosaic.lis"; - panMosaicList->write(panListFile); + panMosaicList->write(panListFile.toStdString()); QString panCassisMosaic = prefix.path() + "/panCassisMosaic.cub"; QVector cassismosArgs = {"fromlist=" + panListFile, "to=" + panCassisMosaic}; @@ -1334,9 +1334,9 @@ TEST_F(TgoCassisModuleKernels, TgoCassisTestColorMosaic) { } FileList *nirMosaicList = new FileList(); - nirMosaicList->append(nirEquiFile); + nirMosaicList->append(nirEquiFile.toStdString()); QString nirListFile = prefix.path() + "/nirMosaic.lis"; - nirMosaicList->write(nirListFile); + nirMosaicList->write(nirListFile.toStdString()); QString nirCassisMosaic = prefix.path() + "/nirCassisMosaic.cub"; cassismosArgs = {"fromlist=" + nirListFile, "to=" + nirCassisMosaic}; @@ -1365,9 +1365,9 @@ TEST_F(TgoCassisModuleKernels, TgoCassisTestColorMosaic) { } FileList *bluMosaicList = new FileList(); - bluMosaicList->append(bluEquiFile); + bluMosaicList->append(bluEquiFile.toStdString()); QString bluListFile = prefix.path() + "/bluMosaic.lis"; - bluMosaicList->write(bluListFile); + bluMosaicList->write(bluListFile.toStdString()); QString bluCassisMosaic = prefix.path() + "/bluCassisMosaic.cub"; cassismosArgs = {"fromlist=" + bluListFile, "to=" + bluCassisMosaic}; @@ -1396,9 +1396,9 @@ TEST_F(TgoCassisModuleKernels, TgoCassisTestColorMosaic) { } FileList *redMosaicList = new FileList(); - redMosaicList->append(redEquiFile); + redMosaicList->append(redEquiFile.toStdString()); QString redListFile = prefix.path() + "/redMosaic.lis"; - redMosaicList->write(redListFile); + redMosaicList->write(redListFile.toStdString()); QString redCassisMosaic = prefix.path() + "/redCassisMosaic.cub"; cassismosArgs = {"fromlist=" + redListFile, "to=" + redCassisMosaic}; @@ -1413,12 +1413,12 @@ TEST_F(TgoCassisModuleKernels, TgoCassisTestColorMosaic) { // run cubeit FileList *MosaicList = new FileList(); - MosaicList->append(redCassisMosaic); - MosaicList->append(bluCassisMosaic); - MosaicList->append(nirCassisMosaic); - MosaicList->append(panCassisMosaic); + MosaicList->append(redCassisMosaic.toStdString()); + MosaicList->append(bluCassisMosaic.toStdString()); + MosaicList->append(nirCassisMosaic.toStdString()); + MosaicList->append(panCassisMosaic.toStdString()); QString mosListFile = prefix.path() + "/mosaicList.lis"; - MosaicList->write(mosListFile); + MosaicList->write(mosListFile.toStdString()); QString coloredMosaic = prefix.path() + "/coloredMosaic.cub"; QVector cubeitArgs = {"fromlist=" + mosListFile, "to=" + coloredMosaic}; @@ -1431,7 +1431,7 @@ TEST_F(TgoCassisModuleKernels, TgoCassisTestColorMosaic) { } // Mosaic Cube - Cube mosCube(coloredMosaic); + Cube mosCube(coloredMosaic.toStdString()); Pvl *outLabel = mosCube.label(); std::istringstream mos(R"( @@ -1667,7 +1667,7 @@ TEST_F(TgoCassisModuleKernels, TgoCassisMapProjectedReingested) { } // RED Cube - Cube reingestCube(reingestedFile); + Cube reingestCube(reingestedFile.toStdString()); Pvl *reingestLabel = reingestCube.label(); // Instrument Group @@ -1769,10 +1769,10 @@ TEST_F(TgoCassisModuleKernels, TgoCassisSingleColorMosaicReingest) { // run mosrange on cube list FileList *cubeList = new FileList(); - cubeList->append(panFileName); + cubeList->append(panFileName.toStdString()); QString cubeListFile = prefix.path() + "/cubelist.lis"; - cubeList->write(cubeListFile); + cubeList->write(cubeListFile.toStdString()); QString mapFile = prefix.path() + "/equi.map"; QVector mosrangeArgs = {"fromlist=" + cubeListFile, "to=" + mapFile}; @@ -1802,9 +1802,9 @@ TEST_F(TgoCassisModuleKernels, TgoCassisSingleColorMosaicReingest) { } FileList *mosaicList = new FileList(); - mosaicList->append(panEquiFile); + mosaicList->append(panEquiFile.toStdString()); QString listFile = prefix.path() + "/cubelist.lis"; - mosaicList->write(listFile); + mosaicList->write(listFile.toStdString()); QString mosaicCubeFile = prefix.path() + "/mosaic.cub"; QVector cassismosArgs = {"fromlist=" + listFile, "to=" + mosaicCubeFile}; @@ -1840,7 +1840,7 @@ TEST_F(TgoCassisModuleKernels, TgoCassisSingleColorMosaicReingest) { } // Mosaic Cube - Cube mosCube(reingestedFile); + Cube mosCube(reingestedFile.toStdString()); Pvl *outLabel = mosCube.label(); std::istringstream inst(R"( @@ -1961,10 +1961,10 @@ TEST(TgoCassisModuleTests, TgoCassisUncontrolledSingleColorMosaic) { // run mosrange on cube list FileList *cubeList = new FileList(); - cubeList->append(panFileName); + cubeList->append(panFileName.toStdString()); QString cubeListFile = prefix.path() + "/cubelist.lis"; - cubeList->write(cubeListFile); + cubeList->write(cubeListFile.toStdString()); QString mapFile = prefix.path() + "/equi.map"; QVector mosrangeArgs = {"fromlist=" + cubeListFile, "to=" + mapFile}; @@ -1994,9 +1994,9 @@ TEST(TgoCassisModuleTests, TgoCassisUncontrolledSingleColorMosaic) { } FileList *mosaicList = new FileList(); - mosaicList->append(panEquiFile); + mosaicList->append(panEquiFile.toStdString()); QString listFile = prefix.path() + "/cubelist.lis"; - mosaicList->write(listFile); + mosaicList->write(listFile.toStdString()); QString mosaicCubeFile = prefix.path() + "/mosaic.cub"; QVector cassismosArgs = {"fromlist=" + listFile, "to=" + mosaicCubeFile}; @@ -2009,7 +2009,7 @@ TEST(TgoCassisModuleTests, TgoCassisUncontrolledSingleColorMosaic) { } // Mosaic Cube - Cube mosCube(mosaicCubeFile); + Cube mosCube(mosaicCubeFile.toStdString()); Pvl *outLabel = mosCube.label(); std::istringstream arss(R"( @@ -2279,13 +2279,13 @@ TEST_F(TgoCassisModuleKernels, TgoCassisTestProjSingleStitchedFrame) { // run stitch on cube list FileList *cubeList = new FileList(); - cubeList->append(panFileName); - cubeList->append(bluFileName); - cubeList->append(redFileName); - cubeList->append(nirFileName); + cubeList->append(panFileName.toStdString()); + cubeList->append(bluFileName.toStdString()); + cubeList->append(redFileName.toStdString()); + cubeList->append(nirFileName.toStdString()); QString cubeListFile = prefix.path() + "/cubelist.lis"; - cubeList->write(cubeListFile); + cubeList->write(cubeListFile.toStdString()); QVector stitchArgs = {"fromlist=" + cubeListFile, "outputprefix=" + prefix.path() + "/stitched"}; @@ -2301,10 +2301,10 @@ TEST_F(TgoCassisModuleKernels, TgoCassisTestProjSingleStitchedFrame) { // run mosrange on cube list QString tgocassisstitchOutput = prefix.path() + "/stitched-2016-11-26T22:50:27.381.cub"; FileList *mosrangeCubeList = new FileList(); - mosrangeCubeList->append(tgocassisstitchOutput); + mosrangeCubeList->append(tgocassisstitchOutput.toStdString()); QString mosrangeCubeListFile = prefix.path() + "/cubelist.lis"; - mosrangeCubeList->write(mosrangeCubeListFile); + mosrangeCubeList->write(mosrangeCubeListFile.toStdString()); QString mapFile = prefix.path() + "/stitched.map"; QVector mosrangeArgs = {"fromlist=" + mosrangeCubeListFile, "to=" + mapFile}; @@ -2343,7 +2343,7 @@ TEST_F(TgoCassisModuleKernels, TgoCassisTestProjSingleStitchedFrame) { } // Mosaic Cube - Cube exportCube(projectedFile); + Cube exportCube(projectedFile.toStdString()); Pvl *outLabel = exportCube.label(); std::istringstream arnirss(R"( diff --git a/isis/tests/UnitTestImagePolygon.cpp b/isis/tests/UnitTestImagePolygon.cpp index 850c8e15f6..6aeb0b9440 100644 --- a/isis/tests/UnitTestImagePolygon.cpp +++ b/isis/tests/UnitTestImagePolygon.cpp @@ -21,7 +21,7 @@ TEST_F(DefaultCube, UnitTestImagePolygonDefaultParams) { poly.Create(*testCube); } catch(IException &e) { - std::string msg = "Cannot create polygon for [" + testCube->fileName() + "]"; + std::string msg = "Cannot create polygon for [" + testCube->fileName().toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } ASSERT_EQ(4517, poly.numVertices()); @@ -48,7 +48,7 @@ TEST_F(DefaultCube, UnitTestImagePolygonSubPoly) { poly.Create(*testCube, 100, 100, 384, 640, 385); } catch(IException &e) { - std::string msg = "Cannot create polygon for [" + testCube->fileName() + "]"; + std::string msg = "Cannot create polygon for [" + testCube->fileName().toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } ASSERT_EQ(19, poly.numVertices()); @@ -74,14 +74,14 @@ TEST_F(TempTestingFiles, UnitTestImagePolygonCross) { FileName labelFile("$ISISROOT/../isis/tests/data/footprintinit/cross.pvl"); Cube crossCube; - crossCube.fromIsd(tempDir.path() + "/footprintCube.cub", labelFile, isdFile, "rw"); + crossCube.fromIsd(tempDir.path().toStdString() + "/footprintCube.cub", labelFile, isdFile, "rw"); ImagePolygon poly; try { poly.Create(crossCube, 100, 100); } catch(IException &e) { - std::string msg = "Cannot create polygon for [" + crossCube.fileName() + "]"; + std::string msg = "Cannot create polygon for [" + crossCube.fileName().toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } ASSERT_EQ(40, poly.numVertices()); @@ -130,14 +130,14 @@ TEST_F(DefaultCube, UnitTestImagePolygonBoundary) { kernels["ShapeModel"] = "$base/dems/MSGR_DEM_USG_EQ_I_V02_prep.cub"; Cube footprintCube; - footprintCube.fromIsd(tempDir.path() + "/footprintCube.cub", label, isd, "rw"); + footprintCube.fromIsd(tempDir.path().toStdString() + "/footprintCube.cub", label, isd, "rw"); ImagePolygon poly; try { poly.Create(footprintCube, 3000, 3000); } catch(IException &e) { - std::string msg = "Cannot create polygon for [" + footprintCube.fileName() + "]"; + std::string msg = "Cannot create polygon for [" + footprintCube.fileName().toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } footprintCube.close(); @@ -167,7 +167,7 @@ TEST_F(TempTestingFiles, UnitTestImagePolygonMosaic) { cubeLabel >> footprintLabel; Cube footprintCube; - FileName footprintFile(tempDir.path() + "/footprintCube.cub"); + FileName footprintFile(tempDir.path().toStdString() + "/footprintCube.cub"); footprintCube.fromLabel(footprintFile, footprintLabel, "rw"); LineManager line(footprintCube); @@ -184,7 +184,7 @@ TEST_F(TempTestingFiles, UnitTestImagePolygonMosaic) { poly.Create(footprintCube); } catch(IException &e) { - std::string msg = "Cannot create polygon for [" + footprintCube.fileName() + "]"; + std::string msg = "Cannot create polygon for [" + footprintCube.fileName().toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } footprintCube.close(); @@ -237,7 +237,7 @@ TEST_F(DefaultCube, UnitTestImagePolygonOutlier) { kernels["ShapeModel"] = "Null"; Cube footprintCube; - footprintCube.fromIsd(tempDir.path() + "/footprintCube.cub", label, isd, "rw"); + footprintCube.fromIsd(tempDir.path().toStdString() + "/footprintCube.cub", label, isd, "rw"); ImagePolygon poly; poly.Emission(89); @@ -246,7 +246,7 @@ TEST_F(DefaultCube, UnitTestImagePolygonOutlier) { poly.Create(footprintCube, 10, 10); } catch(IException &e) { - std::string msg = "Cannot create polygon for [" + footprintCube.fileName() + "]"; + std::string msg = "Cannot create polygon for [" + footprintCube.fileName().toStdString() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } footprintCube.close(); diff --git a/isis/tests/UnitTestMarciCam.cpp b/isis/tests/UnitTestMarciCam.cpp index 811a470c2a..5dec4b9390 100644 --- a/isis/tests/UnitTestMarciCam.cpp +++ b/isis/tests/UnitTestMarciCam.cpp @@ -25,7 +25,7 @@ TEST_F(TempTestingFiles, UnitTestMarciCameraPhocubeBandChange) { PvlGroup newbbin; bbin_stream >> newbbin; - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); Pvl *isisLabel = cube.label(); PvlGroup &ogbbin = isisLabel->findGroup("BandBin", Pvl::Traverse); ogbbin = newbbin; diff --git a/isis/tests/UnitTestOsirisRexTagCams.cpp b/isis/tests/UnitTestOsirisRexTagCams.cpp index a622cb3bfa..f75ec2518d 100644 --- a/isis/tests/UnitTestOsirisRexTagCams.cpp +++ b/isis/tests/UnitTestOsirisRexTagCams.cpp @@ -19,7 +19,7 @@ using namespace std; TEST_F(TempTestingFiles, UnitTestOsirisRexTagCamsNAVCam) { QString cubeFileName = "data/osirisRexImages/20200303T213031S138_ncm_L0-reduced.cub"; - Cube navCube(cubeFileName); + Cube navCube(cubeFileName.toStdString()); OsirisRexTagcamsCamera *cam = (OsirisRexTagcamsCamera *)navCube.camera(); @@ -103,7 +103,7 @@ TEST_F(TempTestingFiles, UnitTestOsirisRexTagCamsNAVCam) { TEST_F(TempTestingFiles, UnitTestOsirisRexTagCamsNFTCam) { QString cubeFileName = "data/osirisRexImages/20201020T214241S004_nft_L0-reduced.cub"; - Cube cube(cubeFileName); + Cube cube(cubeFileName.toStdString()); OsirisRexTagcamsCamera *cam = (OsirisRexTagcamsCamera *)cube.camera(); diff --git a/isis/tests/iTimeTests.cpp b/isis/tests/iTimeTests.cpp index aa59dd2c42..e23b235191 100644 --- a/isis/tests/iTimeTests.cpp +++ b/isis/tests/iTimeTests.cpp @@ -58,14 +58,14 @@ TEST(iTimeTests, StringTimes) { QString timeString("2003-01-02T12:15:01.1234"); iTime testTime(timeString); - EXPECT_EQ(toString(testTime.Year()).toStdString(), testTime.YearString().toStdString()); - EXPECT_EQ(toString(testTime.Month()).toStdString(), testTime.MonthString().toStdString()); - EXPECT_EQ(toString(testTime.Day()).toStdString(), testTime.DayString().toStdString()); - EXPECT_EQ(toString(testTime.Hour()).toStdString(), testTime.HourString().toStdString()); - EXPECT_EQ(toString(testTime.Minute()).toStdString(), testTime.MinuteString().toStdString()); - EXPECT_EQ(toString(testTime.Second(), 8).toStdString(), testTime.SecondString(8).toStdString()); - EXPECT_EQ(toString(testTime.DayOfYear()).toStdString(), testTime.DayOfYearString().toStdString()); - EXPECT_EQ(toString(testTime.Et()).toStdString(), testTime.EtString().toStdString()); + EXPECT_EQ(toString(testTime.Year()), testTime.YearString().toStdString()); + EXPECT_EQ(toString(testTime.Month()), testTime.MonthString().toStdString()); + EXPECT_EQ(toString(testTime.Day()), testTime.DayString().toStdString()); + EXPECT_EQ(toString(testTime.Hour()), testTime.HourString().toStdString()); + EXPECT_EQ(toString(testTime.Minute()), testTime.MinuteString().toStdString()); + EXPECT_EQ(toString(testTime.Second(), 8), testTime.SecondString(8).toStdString()); + EXPECT_EQ(toString(testTime.DayOfYear()), testTime.DayOfYearString().toStdString()); + EXPECT_EQ(toString(testTime.Et()), testTime.EtString().toStdString()); EXPECT_EQ(timeString.toStdString(), testTime.UTC().toStdString()); }