[pygccxml-commit] SF.net SVN: pygccxml: [1238] pyplusplus_dev
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2008-02-15 20:50:05
|
Revision: 1238 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1238&view=rev Author: roman_yakovenko Date: 2008-02-15 12:50:07 -0800 (Fri, 15 Feb 2008) Log Message: ----------- bug fix - improving algorithm, which selects what functions should\could be overriden Thanks to Julian Scheid for bug reporting Modified Paths: -------------- pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py pyplusplus_dev/unittests/hierarchy3_tester.py pyplusplus_dev/unittests/test_all.py Added Paths: ----------- pyplusplus_dev/unittests/data/override_bug_to_be_exported.hpp pyplusplus_dev/unittests/override_bug_tester.py Modified: pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py 2008-02-14 07:12:22 UTC (rev 1237) +++ pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py 2008-02-15 20:50:07 UTC (rev 1238) @@ -429,9 +429,11 @@ all_included = declarations.custom_matcher_t( lambda decl: decl.ignore == False and decl.exportable ) all_protected = declarations.access_type_matcher_t( 'protected' ) & all_included all_pure_virtual = declarations.virtuality_type_matcher_t( VIRTUALITY_TYPES.PURE_VIRTUAL ) + all_public_virtual = declarations.virtuality_type_matcher_t( VIRTUALITY_TYPES.VIRTUAL ) \ + & declarations.access_type_matcher_t( 'public' ) all_not_pure_virtual = ~all_pure_virtual - query = all_protected | all_pure_virtual + query = all_protected | all_pure_virtual | all_public_virtual relevant_opers = declarations.custom_matcher_t( lambda decl: decl.symbol in ('()', '[]') ) funcs = set() defined_funcs = set() Added: pyplusplus_dev/unittests/data/override_bug_to_be_exported.hpp =================================================================== --- pyplusplus_dev/unittests/data/override_bug_to_be_exported.hpp (rev 0) +++ pyplusplus_dev/unittests/data/override_bug_to_be_exported.hpp 2008-02-15 20:50:07 UTC (rev 1238) @@ -0,0 +1,30 @@ +// 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 __final_classes_to_be_exported_hpp__ +#define __final_classes_to_be_exported_hpp__ + +#include <string> + +namespace override_bug{ + +class A +{ + public: + virtual void foo() const {} + virtual ~A(){} +}; + +class B: public A +{ +}; + +inline void invoke_foo( const A& a ){ + a.foo(); +}; +} + +#endif//__final_classes_to_be_exported_hpp__ + Modified: pyplusplus_dev/unittests/hierarchy3_tester.py =================================================================== --- pyplusplus_dev/unittests/hierarchy3_tester.py 2008-02-14 07:12:22 UTC (rev 1237) +++ pyplusplus_dev/unittests/hierarchy3_tester.py 2008-02-15 20:50:07 UTC (rev 1238) @@ -26,8 +26,8 @@ , type=declarations.class_t) found = find( matcher, mb.code_creator.body.creators ) self.failUnless( found ) - self.failUnless( not found.wrapper ) - self.failUnless( 0 == len( found.creators ) ) + self.failUnless( found.wrapper ) + #self.failUnless( 0 == len( found.creators ) ) def run_tests(self, module): pass Added: pyplusplus_dev/unittests/override_bug_tester.py =================================================================== --- pyplusplus_dev/unittests/override_bug_tester.py (rev 0) +++ pyplusplus_dev/unittests/override_bug_tester.py 2008-02-15 20:50:07 UTC (rev 1238) @@ -0,0 +1,37 @@ +# 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 = 'override_bug' + + def __init__( self, *args ): + fundamental_tester_base.fundamental_tester_base_t.__init__( + self + , tester_t.EXTENSION_NAME + , *args ) + + def run_tests(self, module): + class C( module.B ): + def __init__( self ): + module.B.__init__( self ) + def foo( self ): + print "C.foo" + module.invoke_foo( C() ) + +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() Modified: pyplusplus_dev/unittests/test_all.py =================================================================== --- pyplusplus_dev/unittests/test_all.py 2008-02-14 07:12:22 UTC (rev 1237) +++ pyplusplus_dev/unittests/test_all.py 2008-02-15 20:50:07 UTC (rev 1238) @@ -84,6 +84,7 @@ import final_classes_tester import templates_tester import deepcopy_tester +import override_bug_tester #gui_tester #gui_wizard_tester # @@ -187,6 +188,7 @@ , balanced_files_tester , ft_inout_tester , deepcopy_tester + , override_bug_tester ] class module_runner_t( object ): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |