@@ -65,16 +65,25 @@ def test_find_traits( self ):
6565 self .__cmp_traits ( 'hmm_i2d' , declarations .hash_multimap_traits , "hash_multimap< int, double >" , 'int' )
6666
6767 def test_multimap ( self ):
68- mm = self .global_ns .classes ( lambda decl : decl .name .startswith ( 'multimap' ) )
69- for m in mm :
70- traits = declarations .find_container_traits ( m )
71- print m .partial_name
68+ m = self .global_ns .class_ ( lambda decl : decl .name .startswith ( 'multimap' ) )
69+ traits = declarations .find_container_traits ( m )
70+ self .failUness ( m .partial_name == 'multimap< int, int >' )
7271
7372 def test_recursive_partial_name ( self ):
7473 f1 = self .global_ns .free_fun ( 'f1' )
7574 t1 = declarations .class_traits .get_declaration ( f1 .arguments [0 ].type )
7675 self .failUnless ( 'type< std::set< std::vector< int > > >' == t1 .partial_name )
7776
77+ def test_remove_defaults_partial_name_namespace ( self ):
78+ f2 = self .global_ns .free_fun ( 'f2' )
79+ type_info = f2 .return_type
80+ traits = declarations .find_container_traits ( type_info )
81+ cls = traits .class_declaration ( type_info )
82+ decl_string = cls .partial_decl_string #traits.remove_defaults(type_info)
83+ key_type_string = traits .key_type (type_info ).partial_decl_string
84+ self .assert_ (decl_string .startswith ('::std::' ), "declaration string %r doesn't start with 'std::'" % decl_string )
85+ self .assert_ (key_type_string .startswith ('::std::' ), "key type string %r doesn't start with 'std::'" % key_type_string )
86+
7887 def test_from_ogre ( self ):
7988 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&)> > >'
8089 ct = declarations .find_container_traits ( x )
0 commit comments