Skip to content
Permalink
Browse files

Better fix for QgsVectorFileWriter segfault and test

- Revert test to 735c255 commit, excepting 'assert myResult==QgsVectorFileWriter.NoError' edit
  • Loading branch information
dakcarto committed Nov 22, 2012
1 parent 89eb054 commit 6b3aed014fc2ae665b6f7f1c85f8261789e12513
Showing with 5 additions and 4 deletions.
  1. +4 −1 src/core/qgsvectorfilewriter.cpp
  2. +1 −3 tests/src/python/test_qgsvectorfilewriter.py
@@ -647,7 +647,10 @@ QgsVectorFileWriter::writeAsVectorFormat( QgsVectorLayer* layer,
QgsVectorFileWriter* writer =
new QgsVectorFileWriter( fileName, fileEncoding, skipAttributeCreation ? QgsFieldMap() : layer->pendingFields(), layer->wkbType(), outputCRS, driverName, datasourceOptions, layerOptions, newFilename );

QgsDebugMsg( "newFilename = " + *newFilename );
if ( newFilename )
{
QgsDebugMsg( "newFilename = " + *newFilename );
}

// check whether file creation was successful
WriterError err = writer->hasError();
@@ -67,7 +67,6 @@ def testWrite(self):
myLayerOptions = QStringList()
mySelectedOnlyFlag = False
mySkipAttributesFlag = False
myNewFileName = QString()
myGeoCrs = QgsCoordinateReferenceSystem()
myGeoCrs.createFromId(4326, QgsCoordinateReferenceSystem.EpsgCrsId)
myResult = QgsVectorFileWriter.writeAsVectorFormat(
@@ -80,8 +79,7 @@ def testWrite(self):
myErrorMessage,
myOptions,
myLayerOptions,
mySkipAttributesFlag,
myNewFileName)
mySkipAttributesFlag)
assert myResult==QgsVectorFileWriter.NoError

if __name__ == '__main__':

0 comments on commit 6b3aed0

Please sign in to comment.
You can’t perform that action at this time.