Commit 45baf6a0 authored by Summer Stapleton's avatar Summer Stapleton
Browse files

Modified error message for PvlGroup [BandBin] mismatch Fixes #4638

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@7798 41f8697f-d340-4b68-9986-7bafba869bb8
parent a234da04
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1199,8 +1199,14 @@ namespace Isis {
            }
          }
          else if (outKey[j] != inKey[k]) {
            QString msg = "Pvl Group [BandBin] in Key[" + outKey.name() + "] In value" + inKey[k] +
                         "and Out value=" + outKey[j] + " do not match";
            QString msg = "The input cube [" + inLab->fileName() + "] and the base mosaic values "
                           "of the Pvl Group [BandBin] for Keyword [" + outKey.name() + "] do not "
                           "match. Base mosaic value at index [" + QString::number(j) + "] = " + 
                           outKey[j] + ". Input cube value at index [" + QString::number(k) + "] = "
                           + inKey[k] + ". **Note: use mapmos/automos MatchBandBin = false to "
                           "override this check**";
            //QString msg = "Pvl Group [BandBin] in Key[" + outKey.name() + "] In value" + inKey[k] +
                         //"and Out value=" + outKey[j] + " do not match";
            throw IException(IException::User, msg, _FILEINFO_);
          }
        }
+9 −0
Original line number Diff line number Diff line
@@ -1251,3 +1251,12 @@ unittest: Working
unittest: Working
0% Processed
**USER ERROR** Invalid Band / Key Name, Value.

***********************************************************************************
Test Pvl Group [BandBin] for mismatch between input cube and established mosaic
    Create output mosaic
    Modify Group [BandBin] so it will differ
    Mosaic the same cube to verify proper error is thrown
unittest: Working
0% Processed
10% Processed
20% Processed
30% Processed
40% Processed
50% Processed
unittest: Working
0% Processed
**USER ERROR** The input cube [/usgs/cpkgs/isis3/data/base/testData/isisTruth2.cub] and the base mosaic values of the Pvl Group [BandBin] for Keyword [OriginalBand] do not match. Base mosaic value at index [0] = 3. Input cube value at index [0] = 1. **Note: use mapmos/automos MatchBandBin = false to override this check**.
+35 −0
Original line number Diff line number Diff line
@@ -467,6 +467,41 @@ void IsisMain() {
    qDebug() << "";
  }
  remove("isisMosaic_01.cub");
  
  
  // ***********************************************************
  // Testing errors that can occur
  qDebug() << "***********************************************************************************";
  qDebug() << "Test Pvl Group [BandBin] for mismatch between input cube and established mosaic";
  qDebug() << "    Create output mosaic";
  qDebug() << "    Modify Group [BandBin] so it will differ";
  qDebug() << "    Mosaic the same cube to verify proper error is thrown";

  p.SetOutputCube("TO", 5, 5, 2);
  p.EndProcess();
  
  ProcessMosaic m13;
  m13.SetInputCube("FROM", 1, 1, 1, -1, -1, -1); 
  Cube *c = m13.SetOutputCube("TO");
  m13.StartProcess(1, 1, 1);
  Pvl *pvl = c->label();
  PvlKeyword &key = pvl->findKeyword("OriginalBand", Pvl::Traverse);
  key[0] = "3";
  m13.EndProcess();
  
  try {
    ProcessMosaic m;
    m.SetOutputCube("TO");
    m.SetInputCube("FROM", 1, 1, 1, -1, -1, -1);
    m.StartProcess(1, 1, 1);
    m.EndProcess();
  }
  catch (IException &e) {
    e.print();
    p.EndProcess();
    qDebug() << "";
  }
  remove("isisMosaic_01.cub");
}