Skip to content

Commit 687e247

Browse files
author
roman_yakovenko
committed
few bug fixes, after upgrading to latest gccxml version
1 parent 6158084 commit 687e247

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

unittests/source_reader_tester.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,27 @@
88
import parser_test_case
99

1010
import pygccxml
11-
from pygccxml.utils import *
12-
from pygccxml.parser import *
13-
from pygccxml.declarations import *
11+
from pygccxml import utils
12+
from pygccxml import parser
13+
from pygccxml import declarations
1414

1515
class tester_t( parser_test_case.parser_test_case_t ):
16+
global_ns = None
1617
def __init__(self, *args):
1718
parser_test_case.parser_test_case_t.__init__(self, *args)
19+
self.header = 'declarations_calldef.hpp'
20+
self.global_ns = None
21+
22+
def setUp(self):
23+
if not tester_t.global_ns:
24+
decls = parser.parse( [self.header], self.config )
25+
tester_t.global_ns = declarations.get_global_namespace( decls )
26+
tester_t.global_ns.init_optimizer()
27+
self.global_ns = tester_t.global_ns
1828

1929
def test_compound_argument_type(self):
20-
reader = source_reader_t( self.config )
21-
decls = reader.read_file( 'declarations_calldef.hpp' )
22-
do_smth = find_declaration( decls, type=member_function_t, name='do_smth' )
23-
self.failUnless( do_smth, "unable to find calldefs_t.do_smth" )
30+
do_smth = self.global_ns.calldefs( 'do_smth' )
31+
self.failUnless( do_smth, "unable to find do_smth" )
2432
cpptype = do_smth.function_type()
2533

2634
def create_suite():

0 commit comments

Comments
 (0)