Commit 218a8fe5 authored by Ian Humphrey's avatar Ian Humphrey
Browse files

Updated unitTests and truth files to reflect changes to qDebug (Qt5)

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/v006LibrariesV2@6709 41f8697f-d340-4b68-9986-7bafba869bb8
parent 2b82145c
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ using namespace std;
int main() {
  try {
    Preference::Preferences(true);
    qDebug();
    qDebug() << "";
    qDebug() << "Testing GisBlob's constructor from cube...";
    QString inputFile = "$messenger/testData/EW0211286081G.lev1.cub";
    Cube cube;
@@ -33,12 +33,12 @@ int main() {
    GisBlob cubeBlob(cube);
    qDebug() << "    Polygon = " << cubeBlob.polygon();

    qDebug();
    qDebug() << "";
    qDebug() << "Testing GisBlob's default constructor...";
    GisBlob blob;
    qDebug() << "    Polygon = " << blob.polygon();
    
    qDebug();
    qDebug() << "";
    qDebug() << "Adding WKT polygon to GisBlob...";
    /*
    QFile file("unitTest.wkt");
@@ -54,8 +54,8 @@ int main() {
    qDebug() << "    Polygon = " << blob.polygon();
  }
  catch (IException &e) {
    qDebug();
    qDebug();
    qDebug() << "";
    qDebug() << "";
    QString msg = "**************** UNIT TEST FAILED! **************** ";
    IException(e, IException::Unknown, msg, _FILEINFO_).print();
  }
+8 −8
Original line number Diff line number Diff line
@@ -53,11 +53,11 @@ void printTypes();
int main() {
  try {
    Preference::Preferences(true);
    qDebug();
    qDebug() << "";
    qDebug() << "Testing GisGeometry...";
    qDebug();
    qDebug() << "";
    printTypes();
    qDebug();
    qDebug() << "";
    GisTopology *topo = GisTopology::instance();

    double xlongitude = 0;
@@ -232,8 +232,8 @@ int main() {

  }
  catch (IException &e) {
    qDebug();
    qDebug();
    qDebug() << "";
    qDebug() << "";
    QString msg = "**************** UNIT TEST FAILED! **************** ";
    IException(e, IException::Unknown, msg, _FILEINFO_).print();
  }
@@ -253,7 +253,7 @@ void printBasicInfo(GisGeometry geom, QString description) {
  qDebug() << "    area?            " << geom.area();
  qDebug() << "    length?          " << geom.length();
  qDebug() << "    points?          " << geom.points();
  qDebug();
  qDebug() << "";
}


@@ -269,7 +269,7 @@ void printTargetInfo(GisGeometry geom, GisGeometry target, QString description)
  qDebug() << "    overlaps?        " << toString(geom.overlaps(target));
  qDebug() << "    equals?          " << toString(geom.equals(target));
  qDebug() << "    intersect ratio? " << toString(geom.intersectRatio(target));
  qDebug();                            
  qDebug() << "";                            
}


@@ -287,7 +287,7 @@ void printTypes() {
  qDebug() << "    gis      = " << GisGeometry::typeToString(GisGeometry::type("gis"));
  qDebug() << "    geos     = " << GisGeometry::typeToString(GisGeometry::type("geos"));
  qDebug() << "    other    = " << GisGeometry::typeToString(GisGeometry::type("other"));
  qDebug();
  qDebug() << "";

}
+16 −16
Original line number Diff line number Diff line
@@ -29,9 +29,9 @@ using namespace std;
int main() {
  try {
    Preference::Preferences(true);
    qDebug();
    qDebug() << "";
    qDebug() << "Testing GisTopology...";
    qDebug();
    qDebug() << "";

    GisTopology *topo = GisTopology::instance();

@@ -51,9 +51,9 @@ int main() {
    // since we passed GisTopology::PreserveGeometry, check that GEOSGeometry * is still valid
    if (fromWKT)
      qDebug() << "GEOSGeometry from cube is preserved.";
    qDebug();
    qDebug() << "";
    qDebug() << "==============================================================================";
    qDebug();
    qDebug() << "";

    // get wkb string from previous geometry and use it to create a new geometry from wkb 
    QString wkbFromGeom = topo->wkb(fromWKT, GisTopology::PreserveGeometry);
@@ -64,9 +64,9 @@ int main() {
    QString wkbFromNewGeom = topo->wkb(fromWKB, GisTopology::PreserveGeometry);
    qDebug() << "wkb from original geometry == wkb from new geometry? "
             << (wkbFromGeom == wkbFromNewGeom);
    qDebug();
    qDebug() << "";
    qDebug() << "==============================================================================";
    qDebug();
    qDebug() << "";

    // create GEOSGeometry clone from GisGeometry (same blob)
    // and compare wkb/wkt to previous results
@@ -78,9 +78,9 @@ int main() {
    QString wkbFromClone = topo->wkb(clone, GisTopology::PreserveGeometry);
    qDebug() << "wkb from clone == wkb from original geometry? "
             << (wkbFromClone == wkbFromGeom);
    qDebug();
    qDebug() << "";
    qDebug() << "==============================================================================";
    qDebug();
    qDebug() << "";

    // grab the wkt and destroy the geometry using fromWKT pointer
    QString wktFromGeomToDestroy = topo->wkt(fromWKT, GisTopology::DestroyGeometry);
@@ -97,15 +97,15 @@ int main() {
    // QString crash = topo->wkb(fromWKB, GisTopology::PreserveGeometry);

    qDebug() << "==============================================================================";
    qDebug();
    qDebug() << "";
   
    // create a "clone" using NULL
    GEOSGeometry *nullClone = topo->clone(NULL);
    if (!nullClone)
      qDebug() << "clone(NULL) gave us a null pointer...";
    qDebug();
    qDebug() << "";
    qDebug() << "==============================================================================";
    qDebug();
    qDebug() << "";

    // Verify we can create prepared geometry
    qDebug() << "Prepared geometry created...";
@@ -115,11 +115,11 @@ int main() {
    topo->preparedGeometry(g);
    //QString wktFromPrep = topo->wkt(prep, GisTopology::PreserveGeometry);
    //QString wkbFromPrep = topo->wkb(prep, GisTopology::PreserveGeometry);
    qDebug();
    qDebug() << "";
    qDebug() << "==============================================================================";
// Once test coverage tool works again, we can see if we need this test for full coverage.
#if 0
    qDebug();
    qDebug() << "";
    //inputFile = "/work/users/kbecker/EW0213634118G.lev1.cub";
    QFile file("unitTest.wkb");
    if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
@@ -132,7 +132,7 @@ int main() {
    QString wkb = topo->wkb(fromWKBFile, GisTopology::PreserveGeometry);
    qDebug() << "wkb from file == wkb from geometry? "
             << (wkbFromFile.trimmed() == wkb.trimmed());
    qDebug();
    qDebug() << "";
    qDebug() << "==============================================================================";
#endif
    /* These tests produce ParseExceptions (from libgeos)...
@@ -160,8 +160,8 @@ int main() {
  
  }
  catch (IException &e) {
    qDebug();
    qDebug();
    qDebug() << "";
    qDebug() << "";
    QString msg = "**************** UNIT TEST FAILED! **************** ";
    IException(e, IException::Unknown, msg, _FILEINFO_).print();
  }
+2 −2
Original line number Diff line number Diff line
@@ -10,5 +10,5 @@ Valid input equation strings should have some output:
"2 - 7"
"2 a 7"
Invalid input strings should throw an exception: 
"**USER ERROR** The token '' is not recognized as an operator, function or variable.
**USER ERROR** The operator '' is not recognized." 
**USER ERROR** The token '' is not recognized as an operator, function or variable.
**USER ERROR** The operator '' is not recognized.
+1 −1
Original line number Diff line number Diff line
@@ -51,6 +51,6 @@ int main(int argc, char *argv[]) {
    qDebug() << test.findOperatorWrap("")->inputString(); 
  } 
  catch (Isis::IException &e) {
    qDebug() << e.toString(); 
    e.print();
  }
}
Loading