Пример #1
0
 def __configure_sealed(self, controller):
     w_arg = controller.find_wrapper_arg(self.arg.name)
     w_arg.type = self.modifier(self.arg.type)
     if not declarations.is_convertible(w_arg.type, self.arg.type):
         casting_code = 'reinterpret_cast< %s >( %s )' % (self.arg.type,
                                                          w_arg.name)
         controller.modify_arg_expression(self.arg_index, casting_code)
 def __is_convertible_impl( self, decl ):
     defs = decl.bases[0].related_class.declarations
     source_type = declarations.find_declaration( defs, name='source_type' )
     target_type = declarations.find_declaration( defs, name='target_type' )
     expected_type = declarations.find_declaration( defs
                                                    , name='expected'
                                                    , type=declarations.enumeration_t )
     expected_value = bool( expected_type.get_name2value_dict()['value'] )
     self.failUnless( expected_value == declarations.is_convertible( source_type, target_type )
                      , 'Check conversion failed for ' + decl.name )
Пример #3
0
 def __is_convertible_impl(self, decl):
     defs = decl.bases[0].related_class.declarations
     source_type = declarations.find_declaration(defs, name='source_type')
     target_type = declarations.find_declaration(defs, name='target_type')
     expected_type = declarations.find_declaration(
         defs, name='expected', decl_type=declarations.enumeration_t)
     expected_value = bool(expected_type.get_name2value_dict()['value'])
     self.assertTrue(
         expected_value == declarations.is_convertible(
             source_type, target_type),
         'Check conversion failed for ' + decl.name)
 def __is_convertible_impl( self, decl ):
     if decl.name == 'x81':
         i = 0
     defs = decl.bases[0].related_class.declarations
     source_type = declarations.find_declaration( defs, name='source_type' )
     target_type = declarations.find_declaration( defs, name='target_type' )
     expected_type = declarations.find_declaration( defs
                                                    , name='expected'
                                                    , type=declarations.enumeration_t )
     expected_value = bool( expected_type.get_name2value_dict()['value'] )
     if expected_value != declarations.is_convertible( source_type, target_type ):
         print decl.name
Пример #5
0
 def __configure_sealed( self, controller ):
     w_arg = controller.find_wrapper_arg( self.arg.name )
     w_arg.type = self.modifier( self.arg.type )
     if not declarations.is_convertible( w_arg.type, self.arg.type ):
         casting_code = 'reinterpret_cast< %s >( %s )' % ( self.arg.type, w_arg.name )
         controller.modify_arg_expression(self.arg_index, casting_code)