diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2011-08-06 17:28:00 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:17:09 -0300 |
commit | 714ddb6c74b4db4853ca2e34bb50f2888e75ec8d (patch) | |
tree | 7d04cd087ad99fef6442f6be4fbe0342eb722682 /tests/samplebinding | |
parent | 8794f303c16f67812093d0311530b4447ff5c94c (diff) |
The type checking now pays attention to the <no-null-pointer/> tag.
An unit test was also added for it.
Diffstat (limited to 'tests/samplebinding')
-rw-r--r-- | tests/samplebinding/modifications_test.py | 5 | ||||
-rw-r--r-- | tests/samplebinding/typesystem_sample.xml | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/samplebinding/modifications_test.py b/tests/samplebinding/modifications_test.py index b37d74635..344801015 100644 --- a/tests/samplebinding/modifications_test.py +++ b/tests/samplebinding/modifications_test.py @@ -143,5 +143,10 @@ class ModificationsTest(unittest.TestCase): self.assertEqual(self.mods.getSize(ba), len(ba)) self.assertEqual(self.mods.getSize(ba, 20), 20) + def testNoNulPointerTag(self): + point = Point(12, 34) + self.assertEqual(self.mods.sumPointCoordinates(point), 12 + 34) + self.assertRaises(TypeError, self.mods.sumPointCoordinates, None) + if __name__ == '__main__': unittest.main() diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml index add18c289..3e910ccc6 100644 --- a/tests/samplebinding/typesystem_sample.xml +++ b/tests/samplebinding/typesystem_sample.xml @@ -714,6 +714,11 @@ %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0); </inject-code> </modify-function> + <modify-function signature="sumPointCoordinates(const Point*)"> + <modify-argument index="1"> + <no-null-pointer/> + </modify-argument> + </modify-function> </object-type> <object-type name="AbstractModifications"> |