aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2010-01-29 11:30:29 -0200
committerHugo Lima <hugo.lima@openbossa.org>2010-01-29 11:30:29 -0200
commit5655af724889ce5d6be3baecdcee8740310447fb (patch)
treef62b34757528216730b110dbbb036f63f9e9491b /tests
parent6798b116c9a651a7ce7b73d13b5481a509dd3158 (diff)
Add check of conversions errors on constructors.
Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/samplebinding/overflow_test.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/samplebinding/overflow_test.py b/tests/samplebinding/overflow_test.py
index 67b7ca5fe..4529fe201 100755
--- a/tests/samplebinding/overflow_test.py
+++ b/tests/samplebinding/overflow_test.py
@@ -47,11 +47,15 @@ class OverflowTest(unittest.TestCase):
doubleUnsignedInt(0xdeadbeef)
def testShortOverflow(self):
+ '''Calls function with short parameter using an overflowing value.'''
doubleShort(-3)
- '''Calls function with unsigned int parameter using an overflowing value.'''
self.assertRaises(OverflowError, doubleShort, 0xFFFF*-1)
self.assertRaises(OverflowError, doubleShort, 0xFFFF + 1)
+ def testOverflowOnCtor(self):
+ '''Calls object ctor with int parameter using overflowing values.'''
+ self.assertRaises(OverflowError, Point, 42415335332353253, 42415335332353253)
+
if __name__ == '__main__':
unittest.main()