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):
18
18
@staticmethod
19
19
def get_by_name (type_ , name ):
20
20
if class_traits .is_my_case (type_ ):
21
- cls = class_traits .declaration_class (type_ )
21
+ cls = class_traits .get_declaration (type_ )
22
22
return type_traits .remove_declarated (
23
23
cls .typedef (name , recursive = False ).decl_type )
24
24
elif class_declaration_traits .is_my_case (type_ ):
@@ -72,7 +72,7 @@ def value_type(type_):
72
72
'Type "%s" is not an instantiation of \
73
73
boost::shared_ptr or std::shared_ptr' %
74
74
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 " )
76
76
77
77
78
78
class auto_ptr_traits (object ):
Original file line number Diff line number Diff line change @@ -76,6 +76,34 @@ def test_is_auto_pointer(self):
76
76
self .assertFalse (
77
77
declarations .auto_ptr_traits .is_smart_pointer (decls [0 ].decl_type ))
78
78
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
+
79
107
80
108
def create_suite ():
81
109
suite = unittest .TestSuite ()
You can’t perform that action at this time.
0 commit comments