mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-03 00:02:25 -05:00
Add unit test for conversion from small negative longlong.
This commit is contained in:
parent
23562ab8b8
commit
aacb31f66b
@ -550,6 +550,16 @@ void TestQgsField::convertCompatible()
|
|||||||
QVERIFY( intField.convertCompatible( smallLonglong ) );
|
QVERIFY( intField.convertCompatible( smallLonglong ) );
|
||||||
QCOMPARE( smallLonglong.type(), QVariant::Int );
|
QCOMPARE( smallLonglong.type(), QVariant::Int );
|
||||||
QCOMPARE( smallLonglong, QVariant( 99 ) );
|
QCOMPARE( smallLonglong, QVariant( 99 ) );
|
||||||
|
// negative longlong to int
|
||||||
|
QVariant negativeLonglong( -99999999999999999LL );
|
||||||
|
QVERIFY( !intField.convertCompatible( negativeLonglong ) );
|
||||||
|
QCOMPARE( negativeLonglong.type(), QVariant::Int );
|
||||||
|
QVERIFY( negativeLonglong.isNull() );
|
||||||
|
// small negative longlong to int
|
||||||
|
QVariant smallNegativeLonglong( -99LL );
|
||||||
|
QVERIFY( intField.convertCompatible( smallNegativeLonglong ) );
|
||||||
|
QCOMPARE( smallNegativeLonglong.type(), QVariant::Int );
|
||||||
|
QCOMPARE( smallNegativeLonglong, QVariant( -99 ) );
|
||||||
|
|
||||||
//string representation of an int
|
//string representation of an int
|
||||||
QVariant stringInt( "123456" );
|
QVariant stringInt( "123456" );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user