[pygccxml-commit] SF.net SVN: pygccxml: [1205] pygccxml_dev
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2007-12-21 21:29:09
|
Revision: 1205 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1205&view=rev Author: roman_yakovenko Date: 2007-12-21 13:29:10 -0800 (Fri, 21 Dec 2007) Log Message: ----------- has_trivial_constructor - small buf was fixed - only public constructors are taken into account Modified Paths: -------------- pygccxml_dev/pygccxml/declarations/type_traits.py pygccxml_dev/unittests/data/type_traits.hpp pygccxml_dev/unittests/find_container_traits_tester.py pygccxml_dev/unittests/templates_tester.py Modified: pygccxml_dev/pygccxml/declarations/type_traits.py =================================================================== --- pygccxml_dev/pygccxml/declarations/type_traits.py 2007-12-14 20:29:44 UTC (rev 1204) +++ pygccxml_dev/pygccxml/declarations/type_traits.py 2007-12-21 21:29:10 UTC (rev 1205) @@ -378,9 +378,8 @@ logger.debug( true_header + "class doesn't have any user defined constructor and it is copyable" ) return True else: - if None != find_trivial_constructor( type ): - return True - return False + cons = find_trivial_constructor( type ) + return cons and cons.access_type == 'public' """ Question: Do I have to define a copy constructor and assignment operator? Modified: pygccxml_dev/unittests/data/type_traits.hpp =================================================================== --- pygccxml_dev/unittests/data/type_traits.hpp 2007-12-14 20:29:44 UTC (rev 1204) +++ pygccxml_dev/unittests/data/type_traits.hpp 2007-12-21 21:29:10 UTC (rev 1205) @@ -538,6 +538,17 @@ struct const_item{ const int values[10]; }; struct const_container{ const const_item items[10]; }; + class singleton_t + { + private: + static singleton_t *m_instance; + + singleton_t () {} + ~singleton_t () {} + + public: + static singleton_t* instance(); + }; } } namespace has_public_constructor{ Modified: pygccxml_dev/unittests/find_container_traits_tester.py =================================================================== --- pygccxml_dev/unittests/find_container_traits_tester.py 2007-12-14 20:29:44 UTC (rev 1204) +++ pygccxml_dev/unittests/find_container_traits_tester.py 2007-12-21 21:29:10 UTC (rev 1205) @@ -61,6 +61,11 @@ t1 = declarations.class_traits.get_declaration( f1.arguments[0].type ) self.failUnless( 'type< std::set< std::vector< int > > >' == t1.partial_name ) + def test_from_ogre( self ): + x = 'map<std::string, bool (*)(std::string&, Ogre::MaterialScriptContext&), std::less<std::string>, std::allocator<std::pair<std::string const, bool (*)(std::string&, Ogre::MaterialScriptContext&)> > >' + ct = declarations.find_container_traits( x ) + y = ct.remove_defaults( x ) + def create_suite(): suite = unittest.TestSuite() suite.addTest( unittest.makeSuite(tester_t)) Modified: pygccxml_dev/unittests/templates_tester.py =================================================================== --- pygccxml_dev/unittests/templates_tester.py 2007-12-14 20:29:44 UTC (rev 1204) +++ pygccxml_dev/unittests/templates_tester.py 2007-12-21 21:29:10 UTC (rev 1205) @@ -59,6 +59,11 @@ def test_bug_is_tmpl_inst(self): self.failUnless( False == declarations.templates.is_instantiation( "::FX::QMemArray<unsigned char>::setRawData" ) ) + def test_split_bug_fptr(self): + x = 'map<std::string, bool (*)(std::string&, Ogre::MaterialScriptContext&), std::less<std::string>, std::allocator<std::pair<std::string const, bool (*)(std::string&, Ogre::MaterialScriptContext&)> > >' + name, args = declarations.templates.split( x ) + self.failUnless( len(x) == 4 ) + def create_suite(): suite = unittest.TestSuite() suite.addTest( unittest.makeSuite(tester_t)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |