Update of /cvsroot/pygccxml/source/pygccxml/unittests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25022/pygccxml/unittests
Modified Files:
declarations_tester.py variable_matcher_tester.py
Log Message:
1. adding few classes that will make it easier to find some declaration within declaration tree
2. new unittests has been added
Index: variable_matcher_tester.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pygccxml/unittests/variable_matcher_tester.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** variable_matcher_tester.py 28 Feb 2006 07:11:09 -0000 1.1
--- variable_matcher_tester.py 2 Mar 2006 05:55:41 -0000 1.2
***************
*** 4,7 ****
--- 4,8 ----
# http://www.boost.org/LICENSE_1_0.txt)
+ import os
import unittest
import autoconfig
***************
*** 24,31 ****
def test( self ):
! criteria = declarations.variable_matcher_t( name='x', type_str='unsigned int' )
x = declarations.matcher.get_single( criteria, self.declarations )
! criteria.name = '::bit_fields::fields_t::x'
x = declarations.matcher.get_single( criteria, self.declarations )
def create_suite():
--- 25,40 ----
def test( self ):
! criteria = declarations.variable_matcher_t( name='x', type='unsigned int' )
x = declarations.matcher.get_single( criteria, self.declarations )
!
! criteria = declarations.variable_matcher_t(
! name='::bit_fields::fields_t::x'
! , type=declarations.unsigned_int_t()
! , value=x.value
! , header_dir=os.path.dirname(x.location.file_name)
! , header_file=x.location.file_name)
!
x = declarations.matcher.get_single( criteria, self.declarations )
+ self.failUnless( x, "Variable was not found." )
def create_suite():
Index: declarations_tester.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pygccxml/unittests/declarations_tester.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** declarations_tester.py 29 Sep 2005 06:09:10 -0000 1.3
--- declarations_tester.py 2 Mar 2006 05:55:41 -0000 1.4
***************
*** 69,73 ****
self.failUnless( not m_mutable.type_qualifiers.has_static
, "m_mutable must not have static type qualifier" )
! TODO( "There is bug in GCCXML: doesn't write mutable qualifier." )
#self.failUnless( m_mutable.type_qualifiers.has_mutable
# , "static_var must have mutable type qualifier" )
--- 69,73 ----
self.failUnless( not m_mutable.type_qualifiers.has_static
, "m_mutable must not have static type qualifier" )
! ##TODO: "There is bug in GCCXML: doesn't write mutable qualifier."
#self.failUnless( m_mutable.type_qualifiers.has_mutable
# , "static_var must have mutable type qualifier" )
***************
*** 88,92 ****
no_return_1_arg = find_declaration( ns.declarations, type=free_function_t, name='no_return_1_arg' )
self.failUnless( no_return_1_arg, "unable to find 'no_return_1_arg' function" )
- TODO("Find out why GCCXML doesn't preserve argument names, except inline function." )
self._test_calldef_args( no_return_1_arg, [ argument_t( name='arg0', type=int_t() )] )
--- 88,91 ----
|