From 5d23ed3a8801b7152e2c3a601e3bb64595d79046 Mon Sep 17 00:00:00 2001 From: Renato Filho Date: Fri, 3 Sep 2010 16:16:26 -0300 Subject: Avoid call functions when an error occurs on argument conversion. Reviewer: Luciano Wolf Hugo Parente Lima --- tests/samplebinding/point_test.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/samplebinding/point_test.py') diff --git a/tests/samplebinding/point_test.py b/tests/samplebinding/point_test.py index d1ae3eed9..752302c74 100644 --- a/tests/samplebinding/point_test.py +++ b/tests/samplebinding/point_test.py @@ -78,6 +78,11 @@ class PointTest(unittest.TestCase): self.assertEqual(sys.getrefcount(pt1), refcount1 + 1) self.assertEqual(sys.getrefcount(pt1), sys.getrefcount(pt2)) + def testUintOverflow(self): + pt1 = Point(0.0, 0.0) + self.assertRaises(OverflowError, pt1.setXAsUint, 840835495615213080) + self.assertEqual(pt1.x(), 0.0) + if __name__ == '__main__': unittest.main() -- cgit v1.2.3