@@ -42,11 +42,16 @@ def __test_type_category( self, ns_name, controller ):
42
42
self .failUnless ( controller ( decl .type )
43
43
, 'for type "%s" the answer to the question "%s" should be True'
44
44
% ( decl .type .decl_string , ns_name ) )
45
+ elif isinstance ( decl , declarations .calldef_t ) and decl .name .startswith ( 'test_' ):
46
+ continue
45
47
else :
46
48
self .failUnless ( controller ( decl )
47
49
, 'for type "%s" the answer to the question "%s" should be True'
48
50
% ( decl .decl_string , ns_name ) )
49
51
for decl in ns_no .declarations :
52
+ if isinstance ( decl , declarations .calldef_t ) and decl .name .startswith ( 'test_' ):
53
+ continue
54
+
50
55
self .failIf ( controller ( decl )
51
56
, 'for type "%s" the answer to the question "%s" should be False'
52
57
% ( decl .decl_string , ns_name ) )
@@ -234,9 +239,21 @@ def test_is_convertible( self ):
234
239
for tester in filter ( lambda decl : decl .name .startswith ( 'x' ), ns_is_convertible .declarations ):
235
240
self .__is_convertible_impl ( tester )
236
241
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
+
237
253
def create_suite ():
238
254
suite = unittest .TestSuite ()
239
255
suite .addTest ( unittest .makeSuite (tester_t ))
256
+ suite .addTest ( unittest .makeSuite (missing_decls_tester_t ))
240
257
return suite
241
258
242
259
def run_suite ():
0 commit comments