Skip to content

Commit 4e7124e

Browse files
author
roman_yakovenko
committed
updating type_traits functionality
1 parent ed3952b commit 4e7124e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

unittests/type_traits_tester.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,16 @@ def __test_type_category( self, ns_name, controller ):
4242
self.failUnless( controller( decl.type )
4343
, 'for type "%s" the answer to the question "%s" should be True'
4444
% ( decl.type.decl_string, ns_name ) )
45+
elif isinstance( decl, declarations.calldef_t ) and decl.name.startswith( 'test_' ):
46+
continue
4547
else:
4648
self.failUnless( controller( decl )
4749
, 'for type "%s" the answer to the question "%s" should be True'
4850
% ( decl.decl_string, ns_name ) )
4951
for decl in ns_no.declarations:
52+
if isinstance( decl, declarations.calldef_t ) and decl.name.startswith( 'test_' ):
53+
continue
54+
5055
self.failIf( controller( decl )
5156
, 'for type "%s" the answer to the question "%s" should be False'
5257
% ( decl.decl_string, ns_name ) )
@@ -234,9 +239,21 @@ def test_is_convertible( self ):
234239
for tester in filter( lambda decl: decl.name.startswith( 'x' ), ns_is_convertible.declarations ):
235240
self.__is_convertible_impl( tester )
236241

242+
class missing_decls_tester_t(unittest.TestCase):
243+
def __init__(self, *args ):
244+
unittest.TestCase.__init__(self, *args)
245+
def test( self ):
246+
config = autoconfig.cxx_parsers_cfg.gccxml
247+
code = "struct const_item{ const int values[10]; };"
248+
global_ns = parser.parse_string( code , config )[0]
249+
ci = global_ns.class_( 'const_item' )
250+
self.failUnless( len( ci.declarations ) == 5 )
251+
#constructor, copy constructor, destructor, operator=, variable
252+
237253
def create_suite():
238254
suite = unittest.TestSuite()
239255
suite.addTest( unittest.makeSuite(tester_t))
256+
suite.addTest( unittest.makeSuite(missing_decls_tester_t))
240257
return suite
241258

242259
def run_suite():

0 commit comments

Comments
 (0)