aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtCore/qsrand_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/QtCore/qsrand_test.py')
-rw-r--r--tests/QtCore/qsrand_test.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/QtCore/qsrand_test.py b/tests/QtCore/qsrand_test.py
new file mode 100644
index 000000000..97d0a3b0b
--- /dev/null
+++ b/tests/QtCore/qsrand_test.py
@@ -0,0 +1,16 @@
+import gc
+import unittest
+
+from PySide.QtCore import qsrand
+
+class OverflowExceptionCollect(unittest.TestCase):
+ '''Test case for OverflowError exception during garbage collection. See bug #147'''
+
+ def testOverflow(self):
+ # NOTE: PyQt4 raises TypeError, but boost.python raises OverflowError
+ self.assertRaises(OverflowError, qsrand, 42415335332353253)
+ # should not abort if bug #147 is fixed
+ gc.collect()
+
+if __name__ == '__main__':
+ unittest.main()