Skip to content

Commit b738d9f

Browse files
author
roman_yakovenko
committed
few bug fixes, after upgrading to latest gccxml version
1 parent 7fad490 commit b738d9f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

unittests/dependencies_tester.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@
1212
from pygccxml import declarations
1313

1414
class tester_t( parser_test_case.parser_test_case_t ):
15+
global_ns = None
1516
def __init__(self, *args ):
1617
parser_test_case.parser_test_case_t.__init__( self, *args )
1718
self.header = 'include_all.hpp'
1819
self.global_ns = None
1920

20-
def setUp(self):
21-
if not self.global_ns:
21+
def setUp(self):
22+
if not tester_t.global_ns:
2223
decls = parser.parse( [self.header], self.config )
23-
self.global_ns = declarations.get_global_namespace( decls )
24-
self.global_ns.init_optimizer()
24+
tester_t.global_ns = declarations.get_global_namespace( decls )
25+
tester_t.global_ns.init_optimizer()
26+
self.global_ns = tester_t.global_ns
2527

2628
def test_variable( self ):
2729
ns_vars = self.global_ns.namespace( '::declarations::variables' )
@@ -43,6 +45,9 @@ def test_class( self ):
4345
cls = ns_vars.class_( 'struct_variables_t' )
4446
dependencies = cls.i_depend_on_them()
4547
if '0.9' in cls.compiler:
48+
#GCCXML R122 adds compiler generated constructors/destructors and operator=
49+
#to the class, if it has
50+
dependencies = filter( lambda d: not d.declaration.is_artificial, dependencies )
4651
self.failUnless( len(dependencies) == 1 )
4752
else:
4853
self.failUnless( len(dependencies) == 2 ) #compiler generated copy constructor

0 commit comments

Comments
 (0)