Skip to content
Permalink
Browse files

Fix to handling of double precision values, and improved test cases f…

…or this
  • Loading branch information
ccrook committed May 26, 2013
1 parent 8cbf901 commit 7a47be23a72c25dff7f1c3d1159a8cd5a083975b
@@ -1212,7 +1212,7 @@ void QgsDelimitedTextProvider::fetchAttribute( QgsFeature& feature, int fieldIdx
}
case QVariant::Double:
{
int dvalue;
double dvalue;
bool ok = false;
if ( ! value.isEmpty() )
{
@@ -1222,7 +1222,7 @@ void QgsDelimitedTextProvider::fetchAttribute( QgsFeature& feature, int fieldIdx
}
else
{
dvalue = QVariant( QString( value ).replace( mDecimalPoint, "." ) ).toDouble( &ok );
dvalue = QString(value).replace( mDecimalPoint, "." ).toDouble( &ok );
}
}
if ( ok )
@@ -392,10 +392,10 @@ def test_010_read_coordinates():
2L: {
'id': u'1',
'description': u'Basic point',
'geom_x': u'10',
'geom_y': u'20',
'geom_x': u'10.5',
'geom_y': u'20.82',
'#fid': 2L,
'#geometry': 'POINT(10.0 20.0)',
'#geometry': 'POINT(10.5 20.82)',
},
3L: {
'id': u'2',
@@ -779,8 +779,8 @@ def test_016_decimal_point():
'id': u'2',
'description': u'Comma as decimal point 2',
'geom_x': u'12',
'geom_y': u'25',
'other': u'-38',
'geom_y': u'25.003',
'other': u'-38.55',
'text field': u'Plain text field',
'#fid': 3L,
'#geometry': 'POINT(12.0 25.003)',
@@ -2071,7 +2071,7 @@ def test_034_csvt_file():
'id': u'1',
'description': u'Test csvt 1',
'f1': u'1',
'f2': u'1',
'f2': u'1.2',
'f3': u'01',
'f4': u'text',
'f5': u'times',
@@ -2082,7 +2082,7 @@ def test_034_csvt_file():
'id': u'2',
'description': u'Test csvt 2',
'f1': u'3',
'f2': u'1',
'f2': u'1.5',
'f3': u'99',
'f4': u'23.5',
'f5': u'80',
@@ -2104,7 +2104,7 @@ def test_035_csvt_file2():
'id': u'1',
'description': u'Test csvt 1',
'f1': u'1',
'f2': u'1',
'f2': u'1.2',
'f3': u'1',
'f4': u'text',
'f5': u'0',
@@ -2115,7 +2115,7 @@ def test_035_csvt_file2():
'id': u'2',
'description': u'Test csvt 2',
'f1': u'3',
'f2': u'1',
'f2': u'1.5',
'f3': u'99',
'f4': u'23.5',
'f5': u'80',
@@ -2137,7 +2137,7 @@ def test_036_csvt_file_invalid_types():
'id': u'1',
'description': u'Test csvt 1',
'f1': u'1',
'f2': u'1',
'f2': u'1.2',
'f3': u'1',
'f4': u'text',
'f5': u'times',
@@ -2148,7 +2148,7 @@ def test_036_csvt_file_invalid_types():
'id': u'2',
'description': u'Test csvt 2',
'f1': u'3',
'f2': u'1',
'f2': u'1.5',
'f3': u'99',
'f4': u'23.5',
'f5': u'80',
@@ -2172,7 +2172,7 @@ def test_037_csvt_file_invalid_file():
'id': u'1',
'description': u'Test csvt 1',
'f1': u'1',
'f2': u'1',
'f2': u'1.2',
'f3': u'1',
'f4': u'text',
'f5': u'times',
@@ -2183,7 +2183,7 @@ def test_037_csvt_file_invalid_file():
'id': u'2',
'description': u'Test csvt 2',
'f1': u'3',
'f2': u'1',
'f2': u'1.5',
'f3': u'99',
'f4': u'23.5',
'f5': u'80',
@@ -1,5 +1,5 @@
id,description,geom_x,geom_y
1,Basic point,10.0,20.0
1,Basic point,10.5,20.82
2,Integer point,11,22
3,Invalid coordinate format,ten,20.0
4,Final point,13.0,23.0

0 comments on commit 7a47be2

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