@@ -65,16 +65,25 @@ def test_find_traits( self ):
65
65
self .__cmp_traits ( 'hmm_i2d' , declarations .hash_multimap_traits , "hash_multimap< int, double >" , 'int' )
66
66
67
67
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 >' )
72
71
73
72
def test_recursive_partial_name ( self ):
74
73
f1 = self .global_ns .free_fun ( 'f1' )
75
74
t1 = declarations .class_traits .get_declaration ( f1 .arguments [0 ].type )
76
75
self .failUnless ( 'type< std::set< std::vector< int > > >' == t1 .partial_name )
77
76
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
+
78
87
def test_from_ogre ( self ):
79
88
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&)> > >'
80
89
ct = declarations .find_container_traits ( x )
0 commit comments