Skip to content

Commit

Permalink
Merge pull request #3072 from rouault/qt5_fix_testqgsfield
Browse files Browse the repository at this point in the history
Make qgis_fieldtest all Qt 5.X compatible
  • Loading branch information
nyalldawson committed May 15, 2016
2 parents c4819ad + 202420c commit 5c7f4c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion ci/travis/linux/qt5/blacklist.txt
Expand Up @@ -19,4 +19,3 @@ qgis_composermapgridtest
qgis_composertabletest
qgis_composertablev2test
qgis_composerutils
qgis_fieldtest
9 changes: 4 additions & 5 deletions tests/src/core/testqgsfield.cpp
Expand Up @@ -217,11 +217,10 @@ void TestQgsField::convertCompatible()
QVERIFY( stringField.convertCompatible( nullInt ) );
QCOMPARE( nullInt.type(), QVariant::String );
QVERIFY( nullInt.isNull() );
QVariant doubleVar( 9.7 );
QVariant doubleVar( 1.25 );
QVERIFY( stringField.convertCompatible( doubleVar ) );
QCOMPARE( doubleVar.type(), QVariant::String );
// Should be fixed in Qt 5.7: https://bugreports.qt.io/browse/QTBUG-47192
QCOMPARE( doubleVar, QVariant( "9.7" ) );
QCOMPARE( doubleVar, QVariant( "1.25" ) );
QVariant nullDouble = QVariant( QVariant::Double );
QVERIFY( stringField.convertCompatible( nullDouble ) );
QCOMPARE( nullDouble.type(), QVariant::String );
Expand All @@ -246,10 +245,10 @@ void TestQgsField::convertCompatible()
QVERIFY( doubleField.convertCompatible( nullInt ) );
QCOMPARE( nullInt.type(), QVariant::Double );
QVERIFY( nullInt.isNull() );
doubleVar = QVariant( 9.7 );
doubleVar = QVariant( 1.25 );
QVERIFY( doubleField.convertCompatible( doubleVar ) );
QCOMPARE( doubleVar.type(), QVariant::Double );
QCOMPARE( doubleVar, QVariant( 9.7 ) );
QCOMPARE( doubleVar, QVariant( 1.25 ) );
nullDouble = QVariant( QVariant::Double );
QVERIFY( doubleField.convertCompatible( nullDouble ) );
QCOMPARE( nullDouble.type(), QVariant::Double );
Expand Down

0 comments on commit 5c7f4c7

Please sign in to comment.