[pygccxml-commit] SF.net SVN: pygccxml: [1262] pyplusplus_dev/unittests
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2008-02-25 20:47:51
|
Revision: 1262 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1262&view=rev Author: roman_yakovenko Date: 2008-02-25 12:47:57 -0800 (Mon, 25 Feb 2008) Log Message: ----------- update unit tests Modified Paths: -------------- pyplusplus_dev/unittests/data/override_bug_to_be_exported.hpp pyplusplus_dev/unittests/override_bug_tester.py Modified: pyplusplus_dev/unittests/data/override_bug_to_be_exported.hpp =================================================================== --- pyplusplus_dev/unittests/data/override_bug_to_be_exported.hpp 2008-02-25 20:40:52 UTC (rev 1261) +++ pyplusplus_dev/unittests/data/override_bug_to_be_exported.hpp 2008-02-25 20:47:57 UTC (rev 1262) @@ -60,16 +60,16 @@ } -class AA +struct AA { public: virtual void do_smth(int& i) const { i = 'a' ;} virtual ~AA(){} }; -class BB: public AA +struct BB: public AA { - virtual void do_smth(int& i) const { i = 'b' ;} + virtual void do_smth(int& i, int& j) const { i = j = 'b' ;} }; } Modified: pyplusplus_dev/unittests/override_bug_tester.py =================================================================== --- pyplusplus_dev/unittests/override_bug_tester.py 2008-02-25 20:40:52 UTC (rev 1261) +++ pyplusplus_dev/unittests/override_bug_tester.py 2008-02-25 20:47:57 UTC (rev 1262) @@ -21,8 +21,10 @@ def customize( self, mb ): mb.class_("Derived2").member_functions("eval_c").exclude() mb.class_( 'BB' ).include() - do_smth = mb.mem_funs( 'do_smth' ) - do_smth.add_transformation( FT.output(0) ) + do_smth = mb.mem_fun( '::override_bug::AA::do_smth' ) + do_smth.add_transformation( FT.output(0), alias='do_smth_a' ) + do_smth = mb.mem_fun( '::override_bug::BB::do_smth' ) + do_smth.add_transformation( FT.output(0), FT.output(1), alias='do_smth_b' ) def run_tests(self, module): class C( module.B ): @@ -42,6 +44,11 @@ self.failUnless( 22223 == module.eval( Derived4() ) ) + bb = module.BB() + print dir( bb ) + x = bb.do_smth_b() + self.failUnless( x[0] == x[1] == ord( 'b' ) ) + # Notes: # would return 22222 before any patch, since Derived3 wouldn't have a wrapper # would return 22123 with my original "ignore" handling and a list This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |