[pygccxml-commit] SF.net SVN: pygccxml: [1049] pyplusplus_dev
Brought to you by:
mbaas,
roman_yakovenko
|
From: <rom...@us...> - 2007-06-03 07:40:12
|
Revision: 1049
http://svn.sourceforge.net/pygccxml/?rev=1049&view=rev
Author: roman_yakovenko
Date: 2007-06-03 00:40:11 -0700 (Sun, 03 Jun 2007)
Log Message:
-----------
the overridden virtual function bug fix
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py
Added Paths:
-----------
pyplusplus_dev/unittests/data/overriden_virtual_functions_bug_to_be_exported.hpp
pyplusplus_dev/unittests/overriden_virtual_functions_bug_tester.py
Modified: pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py
===================================================================
--- pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py 2007-05-28 15:02:03 UTC (rev 1048)
+++ pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py 2007-06-03 07:40:11 UTC (rev 1049)
@@ -469,6 +469,10 @@
#should test whether this function has been added or not
for f_impl in not_reimplemented_funcs:
if is_same_function( f, f_impl ):
+ if declarations.is_base_and_derived( f_impl.parent, f.parent ):
+ #add function from the most derived class
+ not_reimplemented_funcs.remove( f_impl )
+ not_reimplemented_funcs.add( f )
break
else:
#should test whether this function is implemented in base class
Added: pyplusplus_dev/unittests/data/overriden_virtual_functions_bug_to_be_exported.hpp
===================================================================
--- pyplusplus_dev/unittests/data/overriden_virtual_functions_bug_to_be_exported.hpp (rev 0)
+++ pyplusplus_dev/unittests/data/overriden_virtual_functions_bug_to_be_exported.hpp 2007-06-03 07:40:11 UTC (rev 1049)
@@ -0,0 +1,26 @@
+// Copyright 2004 Roman Yakovenko.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef __overriden_virtual_functions_bug_to_be_exported_hpp__
+#define __overriden_virtual_functions_bug_to_be_exported_hpp__
+
+namespace vector3{
+
+struct window_t{
+protected:
+ virtual void on_mouse_leaves( int ){};
+};
+
+struct button_based_t : public window_t{
+protected:
+ virtual void on_mouse_leaves( int ){};
+};
+
+struct checkbox_t : public button_based_t{
+};
+
+}
+
+#endif//__overriden_virtual_functions_bug_to_be_exported_hpp__
Added: pyplusplus_dev/unittests/overriden_virtual_functions_bug_tester.py
===================================================================
--- pyplusplus_dev/unittests/overriden_virtual_functions_bug_tester.py (rev 0)
+++ pyplusplus_dev/unittests/overriden_virtual_functions_bug_tester.py 2007-06-03 07:40:11 UTC (rev 1049)
@@ -0,0 +1,40 @@
+# Copyright 2004 Roman Yakovenko.
+# Distributed under the Boost Software License, Version 1.0. (See
+# accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+
+import os
+import sys
+import unittest
+import fundamental_tester_base
+
+class tester_t(fundamental_tester_base.fundamental_tester_base_t):
+ EXTENSION_NAME = 'overriden_virtual_functions_bug'
+
+ def __init__( self, *args ):
+ fundamental_tester_base.fundamental_tester_base_t.__init__(
+ self
+ , tester_t.EXTENSION_NAME
+ , *args )
+
+ def customize(self, mb):
+ checkbox = mb.class_('checkbox_t')
+ button_based = mb.class_( 'button_based_t')
+
+ redefined = checkbox.redefined_funcs()
+ self.failUnless( 1 == len(redefined) )
+ self.failUnless( redefined[0].parent is button_based )
+
+ def run_tests(self, module):
+ pass
+
+def create_suite():
+ suite = unittest.TestSuite()
+ suite.addTest( unittest.makeSuite(tester_t))
+ return suite
+
+def run_suite():
+ unittest.TextTestRunner(verbosity=2).run( create_suite() )
+
+if __name__ == "__main__":
+ run_suite()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|