File tree Expand file tree Collapse file tree 2 files changed +40
-2
lines changed Expand file tree Collapse file tree 2 files changed +40
-2
lines changed Original file line number Diff line number Diff line change @@ -331,7 +331,6 @@ def get_declaration( self, type_ ):
331
331
332
332
Precondition: self.is_my_case( type ) == True
333
333
"""
334
- assert self .is_my_case ( type_ )
335
334
return self .__apply_sequence ( type_ )
336
335
337
336
enum_traits = declaration_xxx_traits ( enumeration .enumeration_t )
Original file line number Diff line number Diff line change @@ -271,9 +271,48 @@ def test( self ):
271
271
#~ declarations.print_declarations( [declarations.class_traits.get_declaration( x )] )
272
272
273
273
274
+ class class_traits_tester_t (unittest .TestCase ):
275
+ def __init__ (self , * args ):
276
+ unittest .TestCase .__init__ (self , * args )
277
+
278
+ def test (self ):
279
+ code = """
280
+ namespace A{
281
+ struct B{
282
+ int c;
283
+ };
284
+
285
+ template <class T>
286
+ struct C: public T{
287
+ int d;
288
+ };
289
+
290
+ template <class T>
291
+ struct D{
292
+ int dD;
293
+ };
294
+
295
+ typedef C<B> easy;
296
+ typedef D<easy> Deasy;
297
+
298
+ inline void instantiate(){
299
+ sizeof(easy);
300
+ }
301
+
302
+ }
303
+ """
304
+
305
+ global_ns = parser .parse_string ( code , autoconfig .cxx_parsers_cfg .gccxml )
306
+ global_ns = declarations .get_global_namespace ( global_ns )
307
+ easy = global_ns .typedef ( 'easy' )
308
+ c_a = declarations .class_traits .get_declaration ( easy ) #this works very well
309
+ deasy = global_ns .typedef ( 'Deasy' )
310
+ d_a = declarations .class_traits .get_declaration ( deasy )
311
+ self .failUnless ( isinstance ( d_a , declarations .class_types ) )
312
+
274
313
def create_suite ():
275
314
suite = unittest .TestSuite ()
276
- #~ suite.addTest( unittest.makeSuite(tester_diff_t ))
315
+ suite .addTest ( unittest .makeSuite (class_traits_tester_t ))
277
316
suite .addTest ( unittest .makeSuite (tester_t ))
278
317
suite .addTest ( unittest .makeSuite (missing_decls_tester_t ))
279
318
return suite
You can’t perform that action at this time.
0 commit comments