[pygccxml-commit] SF.net SVN: pygccxml:[1668] pyplusplus_dev/unittests
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2009-02-09 19:10:01
|
Revision: 1668 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1668&view=rev Author: roman_yakovenko Date: 2009-02-09 19:09:47 +0000 (Mon, 09 Feb 2009) Log Message: ----------- add new test case Modified Paths: -------------- pyplusplus_dev/unittests/data/protected_to_be_exported.hpp pyplusplus_dev/unittests/protected_tester.py Modified: pyplusplus_dev/unittests/data/protected_to_be_exported.hpp =================================================================== --- pyplusplus_dev/unittests/data/protected_to_be_exported.hpp 2009-02-09 14:09:58 UTC (rev 1667) +++ pyplusplus_dev/unittests/data/protected_to_be_exported.hpp 2009-02-09 19:09:47 UTC (rev 1668) @@ -7,28 +7,44 @@ #define __protected_to_be_exported_hpp__ namespace protected_{ - -struct protected_t{ -protected: - int get_1(){ return 1; } -}; - -struct protected_s_t{ -protected: - static int get_2(){ return 2; } -}; + +struct protected_t{ +protected: + int get_1(){ return 1; } +}; + +struct protected_s_t{ +protected: + static int get_2(){ return 2; } +}; - -struct protected_v_t{ -protected: - virtual int get_i(){ return 10; } -}; +struct protected_v_t{ +protected: + virtual int get_i(){ return 10; } +}; + struct protected_v_derived_t : public protected_v_t{ }; } -#endif//__protected_to_be_exported_hpp__ +class Thing +{ +protected: + virtual ~Thing() {} +}; +class Callback +{ +public: + Callback() { } + virtual void execute(const Thing& t) { } +protected: + virtual ~Callback() {} +}; + +#endif//__protected_to_be_exported_hpp__ + + Modified: pyplusplus_dev/unittests/protected_tester.py =================================================================== --- pyplusplus_dev/unittests/protected_tester.py 2009-02-09 14:09:58 UTC (rev 1667) +++ pyplusplus_dev/unittests/protected_tester.py 2009-02-09 19:09:47 UTC (rev 1668) @@ -8,6 +8,7 @@ import unittest import fundamental_tester_base from pygccxml import declarations +from pyplusplus import function_transformers as ft class tester_t(fundamental_tester_base.fundamental_tester_base_t): EXTENSION_NAME = 'protected' @@ -19,8 +20,16 @@ , *args ) def customize(self, mb ): + def tt( type_ ): + type_ = declarations.remove_reference( type_ ) + type_ = declarations.remove_const( type_ ) + return declarations.reference_t( type_ ) mb.classes().always_expose_using_scope = True mb.calldefs().create_with_signature = True + mb.class_( 'Callback' ).add_wrapper_code( '//hhhh' ) + execute = mb.class_( 'Callback' ).mem_fun( 'execute' ) + execute.add_transformation( ft.modify_type(0, tt ) ) + #execute.exclude() def create_protected_s_derived_no_override( self, module ): class derived(module.protected_v_t): @@ -71,4 +80,4 @@ unittest.TextTestRunner(verbosity=2).run( create_suite() ) if __name__ == "__main__": - run_suite() \ No newline at end of file + run_suite() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |