giscanner: add AnnotationParser tests
[platform/upstream/gobject-introspection.git] / tests / scanner / annotationparser / gi / annotation_array.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <tests>
4
5 <test>
6   <commentblock>/**
7  * annotation_object_compute_sum:
8  * @nums: (array): Sequence of numbers
9  *
10  * Test taking a zero-terminated array
11  **/</commentblock>
12   <docblock>
13     <identifier>
14       <name>annotation_object_compute_sum</name>
15     </identifier>
16     <parameters>
17       <parameter>
18         <name>nums</name>
19         <annotations>
20           <annotation>
21             <name>array</name>
22           </annotation>
23         </annotations>
24         <description>Sequence of numbers</description>
25       </parameter>
26     </parameters>
27     <description>Test taking a zero-terminated array</description>
28   </docblock>
29 </test>
30
31 <test>
32   <commentblock>/**
33  * annotation_object_compute_sum_n:
34  * @object: a #AnnotationObject
35  * @nums: (array length=n_nums zero-terminated=0): Sequence of
36  *   numbers that are zero-terminated
37  * @n_nums: Length of number array
38  *
39  * Test taking an array with length parameter
40  **/</commentblock>
41   <docblock>
42     <identifier>
43       <name>annotation_object_compute_sum_n</name>
44     </identifier>
45     <parameters>
46       <parameter>
47         <name>object</name>
48         <description>a #AnnotationObject</description>
49       </parameter>
50       <parameter>
51         <name>nums</name>
52         <annotations>
53           <annotation>
54             <name>array</name>
55             <options>
56               <option>
57                 <name>length</name>
58                 <value>n_nums</value>
59               </option>
60               <option>
61                 <name>zero-terminated</name>
62                 <value>0</value>
63               </option>
64             </options>
65           </annotation>
66         </annotations>
67         <description>Sequence of numbers that are zero-terminated</description>
68       </parameter>
69       <parameter>
70         <name>n_nums</name>
71         <description>Length of number array</description>
72       </parameter>
73     </parameters>
74     <description>Test taking an array with length parameter</description>
75   </docblock>
76 </test>
77
78 <test>
79   <commentblock>/**
80  * annotation_object_compute_sum_nz:
81  * @object: a #AnnotationObject
82  * @nums: (array length=n_nums zero-terminated=1): Sequence of numbers that
83  * are zero-terminated
84  * @n_nums: Length of number array
85  *
86  * Test taking a zero-terminated array with length parameter
87  **/</commentblock>
88   <docblock>
89     <identifier>
90       <name>annotation_object_compute_sum_nz</name>
91     </identifier>
92     <parameters>
93       <parameter>
94         <name>object</name>
95         <description>a #AnnotationObject</description>
96       </parameter>
97       <parameter>
98         <name>nums</name>
99         <annotations>
100           <annotation>
101             <name>array</name>
102             <options>
103               <option>
104                 <name>length</name>
105                 <value>n_nums</value>
106               </option>
107               <option>
108                 <name>zero-terminated</name>
109                 <value>1</value>
110               </option>
111             </options>
112           </annotation>
113         </annotations>
114         <description>Sequence of numbers that are zero-terminated</description>
115       </parameter>
116       <parameter>
117         <name>n_nums</name>
118         <description>Length of number array</description>
119       </parameter>
120     </parameters>
121     <description>Test taking a zero-terminated array with length parameter</description>
122   </docblock>
123 </test>
124
125 <test>
126   <commentblock>/**
127  * annotation_object_parse_args:
128  * @object: a #AnnotationObject
129  * @argc: (inout): Length of the argument vector
130  * @argv: (inout) (array length=argc zero-terminated=1): Argument vector
131  *
132  * Test taking a zero-terminated array with length parameter
133  **/</commentblock>
134   <docblock>
135     <identifier>
136       <name>annotation_object_parse_args</name>
137     </identifier>
138     <parameters>
139       <parameter>
140         <name>object</name>
141         <description>a #AnnotationObject</description>
142       </parameter>
143       <parameter>
144         <name>argc</name>
145         <annotations>
146           <annotation>
147             <name>inout</name>
148           </annotation>
149         </annotations>
150         <description>Length of the argument vector</description>
151       </parameter>
152       <parameter>
153         <name>argv</name>
154         <annotations>
155           <annotation>
156             <name>inout</name>
157           </annotation>
158           <annotation>
159             <name>array</name>
160             <options>
161               <option>
162                 <name>length</name>
163                 <value>argc</value>
164               </option>
165               <option>
166                 <name>zero-terminated</name>
167                 <value>1</value>
168               </option>
169             </options>
170           </annotation>
171         </annotations>
172         <description>Argument vector</description>
173       </parameter>
174     </parameters>
175     <description>Test taking a zero-terminated array with length parameter</description>
176   </docblock>
177 </test>
178
179 <test>
180   <commentblock>/**
181  * annotation_object_set_data:
182  * @object: a #AnnotationObject
183  * @data: (array length=length): The data
184  * @length: Length of the data
185  *
186  * Test taking a guchar * with a length.
187  **/</commentblock>
188   <docblock>
189     <identifier>
190       <name>annotation_object_set_data</name>
191     </identifier>
192     <parameters>
193       <parameter>
194         <name>object</name>
195         <description>a #AnnotationObject</description>
196       </parameter>
197       <parameter>
198         <name>data</name>
199         <annotations>
200           <annotation>
201             <name>array</name>
202             <options>
203               <option>
204                 <name>length</name>
205                 <value>length</value>
206               </option>
207             </options>
208           </annotation>
209         </annotations>
210         <description>The data</description>
211       </parameter>
212       <parameter>
213         <name>length</name>
214         <description>Length of the data</description>
215       </parameter>
216     </parameters>
217     <description>Test taking a guchar * with a length.</description>
218   </docblock>
219 </test>
220
221 <test>
222   <commentblock>/**
223  * annotation_string_zero_terminated:
224  * @data: (array fixed-size=2): a third value
225  *
226  * Return value: (transfer full) (array zero-terminated=1): The return value
227  */</commentblock>
228   <docblock>
229     <identifier>
230       <name>annotation_string_zero_terminated</name>
231     </identifier>
232     <parameters>
233       <parameter>
234         <name>data</name>
235         <annotations>
236           <annotation>
237             <name>array</name>
238             <options>
239               <option>
240                 <name>fixed-size</name>
241                 <value>2</value>
242               </option>
243             </options>
244           </annotation>
245         </annotations>
246         <description>a third value</description>
247       </parameter>
248     </parameters>
249     <tags>
250       <tag>
251         <name>returns</name>
252         <annotations>
253           <annotation>
254             <name>transfer</name>
255             <options>
256               <option>
257                 <name>full</name>
258               </option>
259             </options>
260           </annotation>
261           <annotation>
262             <name>array</name>
263             <options>
264               <option>
265                 <name>zero-terminated</name>
266                 <value>1</value>
267               </option>
268             </options>
269           </annotation>
270         </annotations>
271         <description>The return value</description>
272       </tag>
273     </tags>
274   </docblock>
275 </test>
276
277 </tests>