mirror of
https://github.com/thp/pyotherside.git
synced 2025-01-17 23:22:53 +08:00
Test for >32 bit integer conversion
This commit is contained in:
parent
fdb5950acd
commit
9f34fea606
@ -334,3 +334,15 @@ TestPyOtherSide::testSetToList()
|
||||
QVERIFY(l.contains(321));
|
||||
QVERIFY(l.contains(444));
|
||||
}
|
||||
|
||||
void
|
||||
TestPyOtherSide::testIntMoreThan32Bits()
|
||||
{
|
||||
// See https://github.com/thp/pyotherside/issues/86
|
||||
// Affected: Devices and OSes where long is 32 bits, but long long is 64 bits
|
||||
long long two_fortytwo = 4398046511104LL;
|
||||
PyObject *o = PyLong_FromLongLong(two_fortytwo);
|
||||
QVERIFY(o);
|
||||
QVariant v = convertPyObjectToQVariant(o);
|
||||
QVERIFY(v.toLongLong() == two_fortytwo);
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ class TestPyOtherSide : public QObject {
|
||||
void testQObjectRef();
|
||||
void testConvertToPythonAndBack();
|
||||
void testSetToList();
|
||||
void testIntMoreThan32Bits();
|
||||
};
|
||||
|
||||
#endif /* PYOTHERSIDE_TESTS_H */
|
||||
|
Loading…
x
Reference in New Issue
Block a user