[pygccxml-commit] SF.net SVN: pygccxml: [1320] pyplusplus_dev/unittests/data
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2008-05-12 18:54:46
|
Revision: 1320 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1320&view=rev Author: roman_yakovenko Date: 2008-05-12 11:53:09 -0700 (Mon, 12 May 2008) Log Message: ----------- fixing small bug: return types could be same type Modified Paths: -------------- pygccxml_dev/pygccxml/declarations/function_traits.py pyplusplus_dev/unittests/bug_covariant_returns_tester.py pyplusplus_dev/unittests/data/bug_covariant_returns_to_be_exported.hpp Modified: pygccxml_dev/pygccxml/declarations/function_traits.py =================================================================== --- pygccxml_dev/pygccxml/declarations/function_traits.py 2008-05-11 20:23:01 UTC (rev 1319) +++ pygccxml_dev/pygccxml/declarations/function_traits.py 2008-05-12 18:53:09 UTC (rev 1320) @@ -27,6 +27,7 @@ # cv-qualification than the class type in the return type of B::f. if not f1.__class__ is f2.__class__: + #it should be assert return False #2 different calldef types if not isinstance( f1, calldef.member_calldef_t ): #for free functions we compare return types as usual @@ -58,7 +59,8 @@ if c1.class_type == class_declaration.CLASS_TYPES.UNION \ or c2.class_type == class_declaration.CLASS_TYPES.UNION: return type_traits.is_same( rt1, rt2 ) - return type_traits.is_base_and_derived( c1, c2 ) \ + return type_traits.is_same( c1, c2 ) \ + or type_traits.is_base_and_derived( c1, c2 ) \ or type_traits.is_base_and_derived( c2, c1 ) Modified: pyplusplus_dev/unittests/bug_covariant_returns_tester.py =================================================================== --- pyplusplus_dev/unittests/bug_covariant_returns_tester.py 2008-05-11 20:23:01 UTC (rev 1319) +++ pyplusplus_dev/unittests/bug_covariant_returns_tester.py 2008-05-12 18:53:09 UTC (rev 1320) @@ -21,6 +21,9 @@ def customize(self, mb ): mb.mem_funs( 'f' ).call_policies = return_value_policy(manage_new_object) + mb.decl( 'DObjectState' ).opaque = True + saveState = mb.mem_funs( lambda f: f.name == 'saveState' and 'FObjectState' in f.decl_string ) + saveState.call_policies = return_value_policy(manage_new_object) def run_tests( self, module): pass Modified: pyplusplus_dev/unittests/data/bug_covariant_returns_to_be_exported.hpp =================================================================== --- pyplusplus_dev/unittests/data/bug_covariant_returns_to_be_exported.hpp 2008-05-11 20:23:01 UTC (rev 1319) +++ pyplusplus_dev/unittests/data/bug_covariant_returns_to_be_exported.hpp 2008-05-12 18:53:09 UTC (rev 1320) @@ -32,5 +32,42 @@ } }; - + + +struct FObjectState {}; + +struct DObjectState; + + +struct FSerializable { +public: + virtual FObjectState* saveState() const = 0; +}; + +struct DSerializable { +public: + virtual DObjectState* saveState() const = 0; +}; + + +class FMachinePart : public FSerializable { +}; + +class DMachinePart : public DSerializable { +}; + + +class FComponent : public FMachinePart { +public: + // methods inherited from Serializable interface + virtual FObjectState* saveState() const{ return 0; } +}; + + +class DComponent : public DMachinePart { +public: + // methods inherited from Serializable interface + virtual DObjectState* saveState() const{ return 0; } +}; + #endif//__bug_virtual_functions_overload_to_be_exported_hpp__ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |