diff options
author | Hugo Lima <hugo.lima@openbossa.org> | 2010-01-22 01:00:32 -0300 |
---|---|---|
committer | Hugo Lima <hugo.lima@openbossa.org> | 2010-01-22 02:17:03 -0300 |
commit | c6898072bfb72d76d5e15e8fd59b5e86752006e3 (patch) | |
tree | eae8ff7f44da14929ec9453ca7143a7763fac4ce /tests/samplebinding/overflow_test.py | |
parent | 62bd3820c222cfb6af57c2ff4b23b8b819743bbf (diff) |
Fix bug on overflow check routines under 32 bits platforms.
Diffstat (limited to 'tests/samplebinding/overflow_test.py')
-rwxr-xr-x | tests/samplebinding/overflow_test.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/samplebinding/overflow_test.py b/tests/samplebinding/overflow_test.py index b53e4f3b5..67b7ca5fe 100755 --- a/tests/samplebinding/overflow_test.py +++ b/tests/samplebinding/overflow_test.py @@ -29,7 +29,7 @@ import sys import unittest -from sample import doubleUnsignedInt +from sample import * class OverflowTest(unittest.TestCase): '''Test case for overflowing C++ numeric types.''' @@ -44,6 +44,13 @@ class OverflowTest(unittest.TestCase): def testOverflow(self): '''Calls function with unsigned int parameter using an overflowing value.''' self.assertRaises(OverflowError, doubleUnsignedInt, 42415335332353253) + doubleUnsignedInt(0xdeadbeef) + + def testShortOverflow(self): + doubleShort(-3) + '''Calls function with unsigned int parameter using an overflowing value.''' + self.assertRaises(OverflowError, doubleShort, 0xFFFF*-1) + self.assertRaises(OverflowError, doubleShort, 0xFFFF + 1) if __name__ == '__main__': unittest.main() |