Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added some more helpful stdout stuff
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@7193 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Sep 12, 2007
1 parent 9472254 commit c926fbf
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions tests/src/core/testqgsvectorfilewriter.cpp
Expand Up @@ -71,17 +71,27 @@ class TestQgsVectorFileWriter: public QObject
QgsGeometry * mypGeometry = QgsGeometry::fromPoint(myPoint);
QgsFeature myFeature;
myFeature.setGeometry(mypGeometry);
myFeature.addAttribute(0,"HelloWorld");
myFeature.addAttribute(1,"HelloWorld");
//
// Write the featyre to the filewriter
//
myWriter.addFeature(myFeature);
myError = myWriter.hasError();
Q_ASSERT(myError==QgsVectorFileWriter::NoError);
if(myError==QgsVectorFileWriter::ErrDriverNotFound)
{
std::cout << "Driver not found error" << std::endl;
}

if (myError==QgsVectorFileWriter::ErrCreateDataSource)
{
std::cout << "Create data source error" << std::endl;
}
if (myError==QgsVectorFileWriter::ErrCreateLayer)
{
std::cout << "Create layer error" << std::endl;
}
QVERIFY(myError==QgsVectorFileWriter::NoError);
// other possible outcomes...
//QgsVectorFileWriter::ErrDriverNotFound:
//QgsVectorFileWriter::ErrCreateDataSource:
//QgsVectorFileWriter::ErrCreateLayer:
delete mypGeometry;
}
};
Expand Down

0 comments on commit c926fbf

Please sign in to comment.