15
15
"vector_traits.hpp" ,
16
16
]
17
17
18
+ # import logging
19
+ # from pygccxml import utils
20
+ # utils.loggers.set_level(logging.DEBUG)
21
+
18
22
19
23
@pytest .fixture
20
24
def global_ns ():
@@ -30,59 +34,60 @@ def global_ns():
30
34
return global_ns
31
35
32
36
33
- def validate_yes (value_type , container ):
34
- traits = declarations .vector_traits
35
- assert traits .is_my_case (container ) is True
36
- assert declarations .is_same (
37
- value_type ,
38
- traits .element_type (container )) is True
39
- assert traits .is_sequence (container ) is True
40
-
41
-
42
- def test_global_ns (global_ns ):
43
- value_type = global_ns .class_ ('_0_' )
44
- container = global_ns .typedef ('container' , recursive = False )
45
- validate_yes (value_type , container )
46
-
47
-
48
- def test_yes (global_ns ):
49
- yes_ns = global_ns .namespace ('yes' )
50
- for struct in yes_ns .classes ():
51
- if not struct .name .startswith ('_' ):
52
- continue
53
- if not struct .name .endswith ('_' ):
54
- continue
55
- validate_yes (
56
- struct .typedef ('value_type' ),
57
- struct .typedef ('container' ))
58
-
59
-
60
- def test_no (global_ns ):
61
- traits = declarations .vector_traits
62
- no_ns = global_ns .namespace ('no' )
63
- for struct in no_ns .classes ():
64
- if not struct .name .startswith ('_' ):
65
- continue
66
- if not struct .name .endswith ('_' ):
67
- continue
68
- assert traits .is_my_case (struct .typedef ('container' )) is False
69
-
70
-
71
- def test_declaration ():
72
- cnt = (
73
- 'std::vector<std::basic_string<char, std::char_traits<char>, ' +
74
- 'std::allocator<char>>,std::allocator<std::basic_string<char, ' +
75
- 'std::char_traits<char>, std::allocator<char>>>>' +
76
- '@::std::vector<std::basic_string<char, std::char_traits<char>, ' +
77
- 'std::allocator<char>>, std::allocator<std::basic_string<char, ' +
78
- 'std::char_traits<char>, std::allocator<char>>>>' )
79
- traits = declarations .find_container_traits (cnt )
80
- assert declarations .vector_traits == traits
37
+ # def validate_yes(value_type, container):
38
+ # traits = declarations.vector_traits
39
+ # assert traits.is_my_case(container) is True
40
+ # assert declarations.is_same(
41
+ # value_type,
42
+ # traits.element_type(container)) is True
43
+ # assert traits.is_sequence(container) is True
44
+
45
+
46
+ # def test_global_ns(global_ns):
47
+ # value_type = global_ns.class_('_0_')
48
+ # container = global_ns.typedef('container', recursive=False)
49
+ # validate_yes(value_type, container)
50
+
51
+
52
+ # def test_yes(global_ns):
53
+ # yes_ns = global_ns.namespace('yes')
54
+ # for struct in yes_ns.classes():
55
+ # if not struct.name.startswith('_'):
56
+ # continue
57
+ # if not struct.name.endswith('_'):
58
+ # continue
59
+ # validate_yes(
60
+ # struct.typedef('value_type'),
61
+ # struct.typedef('container'))
62
+
63
+
64
+ # def test_no(global_ns):
65
+ # traits = declarations.vector_traits
66
+ # no_ns = global_ns.namespace('no')
67
+ # for struct in no_ns.classes():
68
+ # if not struct.name.startswith('_'):
69
+ # continue
70
+ # if not struct.name.endswith('_'):
71
+ # continue
72
+ # assert traits.is_my_case(struct.typedef('container')) is False
73
+
74
+
75
+ # def test_declaration():
76
+ # cnt = (
77
+ # 'std::vector<std::basic_string<char, std::char_traits<char>, ' +
78
+ # 'std::allocator<char>>,std::allocator<std::basic_string<char, ' +
79
+ # 'std::char_traits<char>, std::allocator<char>>>>' +
80
+ # '@::std::vector<std::basic_string<char, std::char_traits<char>, ' +
81
+ # 'std::allocator<char>>, std::allocator<std::basic_string<char, ' +
82
+ # 'std::char_traits<char>, std::allocator<char>>>>')
83
+ # traits = declarations.find_container_traits(cnt)
84
+ # assert declarations.vector_traits == traits
81
85
82
86
83
87
def test_element_type (global_ns ):
84
88
do_nothing = global_ns .free_function ('do_nothing' )
85
89
v = declarations .remove_reference (
86
90
declarations .remove_declarated (
87
91
do_nothing .arguments [0 ].decl_type ))
92
+ print ("v" , v )
88
93
declarations .vector_traits .element_type (v )
0 commit comments