diff options
author | Hugo Lima <hugo.lima@openbossa.org> | 2010-03-17 16:34:07 -0300 |
---|---|---|
committer | Hugo Lima <hugo.lima@openbossa.org> | 2010-03-18 19:45:08 -0300 |
commit | b1eee94589cc0337ea8a26fee0c523582a0419e3 (patch) | |
tree | 83cb2c0372aef4c79bf7f4276d549d5e2e57e340 /tests | |
parent | 75ce5d993f212581ba2fb1e623fed2c585f1c216 (diff) |
Write enum checks before int, long and bool checks.
Enums are implicitly converted to these types in C++, if we dont do that
the enum version of some functions can never be called, because the int one
will be if the int check was written before the enum check.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/samplebinding/overload_sorting_test.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/samplebinding/overload_sorting_test.py b/tests/samplebinding/overload_sorting_test.py index 03e018aa2..9d4b1cbeb 100755 --- a/tests/samplebinding/overload_sorting_test.py +++ b/tests/samplebinding/overload_sorting_test.py @@ -26,10 +26,9 @@ '''Test cases for overload sorting''' -import sys import unittest -from sample import SortedOverload, ImplicitBase, ImplicitTarget +from sample import * class Dummy(object): pass @@ -75,6 +74,10 @@ class DeepOverloadSorting(unittest.TestCase): '''Deep Overload - (int, ImplicitBase *)''' self.assertEqual(self.obj.overloadDeep(1, ImplicitBase()), "ImplicitBase") +class EnumOverIntSorting(unittest.TestCase): + def testEnumOverInt(self): + ic = ImplicitConv(ImplicitConv.CtorTwo) + self.assertEquals(ic.ctorEnum(), ImplicitConv.CtorTwo) if __name__ == '__main__': unittest.main() |