File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 77
88from pygccxml import parser
99from pygccxml import declarations
10+ from pygccxml import utils
1011
1112
1213class tester_t (parser_test_case .parser_test_case_t ):
@@ -46,10 +47,18 @@ def test(self):
4647 if isinstance (decl , declarations .calldef .constructor_t ):
4748 ctors .append (decl )
4849
50+ # GCCXML and CastXML return the constructors in a different order.
51+ # I hope this index inversion will cover the two cases. If different
52+ # compilers give other orders, we will need to find a nicer solution.
53+ if "CastXML" in utils .xml_generator :
54+ positions = [0 , 1 ]
55+ elif "GCC" in utils .xml_generator :
56+ positions = [1 , 0 ]
57+
4958 # test2::test2() [constructor]
50- self .assertFalse (ctors [0 ].is_copy_constructor )
59+ self .assertFalse (ctors [positions [ 0 ] ].is_copy_constructor )
5160 # test2::test2(test2 const & arg0) [copy constructor]
52- self .assertTrue (ctors [1 ].is_copy_constructor )
61+ self .assertTrue (ctors [positions [ 1 ] ].is_copy_constructor )
5362
5463
5564def create_suite ():
You can’t perform that action at this time.
0 commit comments