File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class internal_type_traits(object):
1818 @staticmethod
1919 def get_by_name (type_ , name ):
2020 if class_traits .is_my_case (type_ ):
21- cls = class_traits .declaration_class (type_ )
21+ cls = class_traits .get_declaration (type_ )
2222 return type_traits .remove_declarated (
2323 cls .typedef (name , recursive = False ).decl_type )
2424 elif class_declaration_traits .is_my_case (type_ ):
@@ -72,7 +72,7 @@ def value_type(type_):
7272 'Type "%s" is not an instantiation of \
7373 boost::shared_ptr or std::shared_ptr' %
7474 type_ .decl_string )
75- return internal_type_traits .get_by_name (type_ , "value_type " )
75+ return internal_type_traits .get_by_name (type_ , "element_type " )
7676
7777
7878class auto_ptr_traits (object ):
Original file line number Diff line number Diff line change @@ -76,6 +76,34 @@ def test_is_auto_pointer(self):
7676 self .assertFalse (
7777 declarations .auto_ptr_traits .is_smart_pointer (decls [0 ].decl_type ))
7878
79+ def test_smart_pointer_value_type (self ):
80+ """
81+ Test smart_pointer_traits.value_type method.
82+
83+ """
84+
85+ if self .config .xml_generator == "gccxml" :
86+ return
87+
88+ criteria = declarations .declaration_matcher (name = "yes1" )
89+ decls = declarations .matcher .find (criteria , self .global_ns )
90+ vt = declarations .smart_pointer_traits .value_type (decls [0 ].decl_type )
91+ self .assertIsInstance (vt , declarations .int_t )
92+
93+ def test_auto_pointer_value_type (self ):
94+ """
95+ Test auto_pointer_traits.value_type method.
96+
97+ """
98+
99+ if self .config .xml_generator == "gccxml" :
100+ return
101+
102+ criteria = declarations .declaration_matcher (name = "yes2" )
103+ decls = declarations .matcher .find (criteria , self .global_ns )
104+ vt = declarations .auto_ptr_traits .value_type (decls [0 ].decl_type )
105+ self .assertIsInstance (vt , declarations .double_t )
106+
79107
80108def create_suite ():
81109 suite = unittest .TestSuite ()
You can’t perform that action at this time.
0 commit comments