File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -550,6 +550,16 @@ void TestQgsField::convertCompatible()
550
550
QVERIFY ( intField.convertCompatible ( smallLonglong ) );
551
551
QCOMPARE ( smallLonglong.type (), QVariant::Int );
552
552
QCOMPARE ( smallLonglong, QVariant ( 99 ) );
553
+ // negative longlong to int
554
+ QVariant negativeLonglong ( -99999999999999999LL );
555
+ QVERIFY ( !intField.convertCompatible ( negativeLonglong ) );
556
+ QCOMPARE ( negativeLonglong.type (), QVariant::Int );
557
+ QVERIFY ( negativeLonglong.isNull () );
558
+ // small negative longlong to int
559
+ QVariant smallNegativeLonglong ( -99LL );
560
+ QVERIFY ( intField.convertCompatible ( smallNegativeLonglong ) );
561
+ QCOMPARE ( smallNegativeLonglong.type (), QVariant::Int );
562
+ QCOMPARE ( smallNegativeLonglong, QVariant ( -99 ) );
553
563
554
564
// string representation of an int
555
565
QVariant stringInt ( " 123456" );
You can’t perform that action at this time.
0 commit comments