Skip to content

Commit

Permalink
Add a test to check if an assertion is correctly raised when using ca…
Browse files Browse the repository at this point in the history
…stxml and asking for the demangled name
  • Loading branch information
iMichka committed Jun 19, 2015
1 parent f4d6d2d commit 1fac084
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions unittests/core_tester.py
Expand Up @@ -167,6 +167,7 @@ def test_mangled_name_namespace(self):
std.mangled,
"Mangled name of std namespace should be different from None")
elif "CastXML" in std.compiler:
# Check if an assertion is correctly raised when using castxml.
# Call the getter by using lambda, else assertRaises does not
# work as expected.
self.assertRaises(Exception, lambda: std.mangled)
Expand All @@ -188,6 +189,20 @@ def test_mangled_name_variable(self):
"Mangled name of array255 variable should be different +"
"from None")

def test_demangled_name_variable(self):
# This works with gccxml only. Check if an assertion is correctly
# raised when using castxml.
var_inst = self.global_ns.variable('array255')
if "GCC" in var_inst.compiler:
self.failUnless(
var_inst.demangled,
"Demangled name of array255 variable should be different +"
"from None")
elif "CastXML" in var_inst.compiler:
# Call the getter by using lambda, else assertRaises does not
# work as expected.
self.assertRaises(Exception, lambda: var_inst.demangled)

def _test_is_based_and_derived(self, base, derived, access):
dhi_v = declarations.hierarchy_info_t(derived, access, True)
dhi_not_v = declarations.hierarchy_info_t(derived, access, False)
Expand Down

0 comments on commit 1fac084

Please sign in to comment.