[pygccxml-commit] SF.net SVN: pygccxml:[1409] pygccxml_dev/unittests
Brought to you by:
mbaas,
roman_yakovenko
|
From: <rom...@us...> - 2008-08-26 19:01:21
|
Revision: 1409
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1409&view=rev
Author: roman_yakovenko
Date: 2008-08-26 19:01:31 +0000 (Tue, 26 Aug 2008)
Log Message:
-----------
adding new test case from Gustavo Carneiro
Modified Paths:
--------------
pygccxml_dev/unittests/data/remove_template_defaults.hpp
pygccxml_dev/unittests/find_container_traits_tester.py
Modified: pygccxml_dev/unittests/data/remove_template_defaults.hpp
===================================================================
--- pygccxml_dev/unittests/data/remove_template_defaults.hpp 2008-08-26 11:23:56 UTC (rev 1408)
+++ pygccxml_dev/unittests/data/remove_template_defaults.hpp 2008-08-26 19:01:31 UTC (rev 1409)
@@ -76,6 +76,9 @@
typedef std::map< int, double > m_i2d;
typedef std::map< std::wstring, double > m_wstr2d;
typedef std::map< const std::vector< int >, m_wstr2d > m_v_i2m_wstr2d;
+
+ inline std::map<std::string, int> f2(){}
+
}
namespace multimaps{
Modified: pygccxml_dev/unittests/find_container_traits_tester.py
===================================================================
--- pygccxml_dev/unittests/find_container_traits_tester.py 2008-08-26 11:23:56 UTC (rev 1408)
+++ pygccxml_dev/unittests/find_container_traits_tester.py 2008-08-26 19:01:31 UTC (rev 1409)
@@ -65,16 +65,25 @@
self.__cmp_traits( 'hmm_i2d', declarations.hash_multimap_traits, "hash_multimap< int, double >", 'int' )
def test_multimap( self ):
- mm = self.global_ns.classes( lambda decl: decl.name.startswith( 'multimap' ) )
- for m in mm:
- traits = declarations.find_container_traits( m )
- print m.partial_name
+ m = self.global_ns.class_( lambda decl: decl.name.startswith( 'multimap' ) )
+ traits = declarations.find_container_traits( m )
+ self.failUness( m.partial_name == 'multimap< int, int >' )
def test_recursive_partial_name( self ):
f1 = self.global_ns.free_fun( 'f1' )
t1 = declarations.class_traits.get_declaration( f1.arguments[0].type )
self.failUnless( 'type< std::set< std::vector< int > > >' == t1.partial_name )
+ def test_remove_defaults_partial_name_namespace( self ):
+ f2 = self.global_ns.free_fun( 'f2' )
+ type_info = f2.return_type
+ traits = declarations.find_container_traits( type_info )
+ cls = traits .class_declaration( type_info )
+ decl_string = cls.partial_decl_string #traits.remove_defaults(type_info)
+ key_type_string = traits.key_type(type_info).partial_decl_string
+ self.assert_(decl_string.startswith('::std::'), "declaration string %r doesn't start with 'std::'" % decl_string)
+ self.assert_(key_type_string.startswith('::std::'), "key type string %r doesn't start with 'std::'" % key_type_string)
+
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 )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|