diff --git a/tests/tests.cpp b/tests/tests.cpp index 0dd8fb8..3fae3c3 100644 --- a/tests/tests.cpp +++ b/tests/tests.cpp @@ -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); +} diff --git a/tests/tests.h b/tests/tests.h index dcd7efa..0ae751a 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -39,6 +39,7 @@ class TestPyOtherSide : public QObject { void testQObjectRef(); void testConvertToPythonAndBack(); void testSetToList(); + void testIntMoreThan32Bits(); }; #endif /* PYOTHERSIDE_TESTS_H */