giscanner: add AnnotationParser tests
[platform/upstream/gobject-introspection.git] / tests / scanner / annotationparser / gtkdoc / annotations / tester.c.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <tests>
4
5 <test>
6   <commentblock>/**
7  * SECTION:tester
8  * @short_description: module for gtk-doc unit test
9  *
10  * This file contains non-sense code for the sole purpose of testing the docs.
11  */</commentblock>
12   <docblock>
13     <identifier>
14       <name>SECTION:tester</name>
15     </identifier>
16     <parameters>
17       <parameter>
18         <name>short_description</name>
19         <description>module for gtk-doc unit test</description>
20       </parameter>
21     </parameters>
22     <description>This file contains non-sense code for the sole purpose of testing the docs.</description>
23   </docblock>
24 </test>
25
26 <test>
27   <commentblock>/**
28  * annotation_array_length:
29  * @list: a #GtkListStore
30  * @n_columns: number of columns
31  * @types: (array length=n_columns): list of types
32  *
33  * Document parameter relation for array length.
34  */</commentblock>
35   <docblock>
36     <identifier>
37       <name>annotation_array_length</name>
38     </identifier>
39     <parameters>
40       <parameter>
41         <name>list</name>
42         <description>a #GtkListStore</description>
43       </parameter>
44       <parameter>
45         <name>n_columns</name>
46         <description>number of columns</description>
47       </parameter>
48       <parameter>
49         <name>types</name>
50         <annotations>
51           <annotation>
52             <name>array</name>
53             <options>
54               <option>
55                 <name>length</name>
56                 <value>n_columns</value>
57               </option>
58             </options>
59           </annotation>
60         </annotations>
61         <description>list of types</description>
62       </parameter>
63     </parameters>
64     <description>Document parameter relation for array length.</description>
65   </docblock>
66 </test>
67
68 <test>
69   <commentblock>/**
70  * annotation_nullable:
71  * @uri: a uri
72  * @label: (allow-none): an optional string, which is used in ways too
73  *  complicated to describe in a single line, making it necessary to wrap it
74  *
75  * Document optional parameters.
76  *
77  * Returns: (transfer full) (allow-none): Returns stuff which you have to
78  *  free after use, whose description is also rather long
79  */</commentblock>
80   <docblock>
81     <identifier>
82       <name>annotation_nullable</name>
83     </identifier>
84     <parameters>
85       <parameter>
86         <name>uri</name>
87         <description>a uri</description>
88       </parameter>
89       <parameter>
90         <name>label</name>
91         <annotations>
92           <annotation>
93             <name>allow-none</name>
94           </annotation>
95         </annotations>
96         <description>an optional string, which is used in ways too complicated to describe in a single line, making it necessary to wrap it</description>
97       </parameter>
98     </parameters>
99     <description>Document optional parameters.</description>
100     <tags>
101       <tag>
102         <name>returns</name>
103         <annotations>
104           <annotation>
105             <name>transfer</name>
106             <options>
107               <option>
108                 <name>full</name>
109               </option>
110             </options>
111           </annotation>
112           <annotation>
113             <name>allow-none</name>
114           </annotation>
115         </annotations>
116         <description>Returns stuff which you have to free after use, whose description is also rather long</description>
117       </tag>
118     </tags>
119   </docblock>
120 </test>
121
122 <test>
123   <commentblock>/**
124  * annotation_elementtype:
125  * @list: (element-type GObject): list of #GObject instances to search
126  *
127  * Document optional parameters.
128  *
129  * Returns: %TRUE for success
130  */</commentblock>
131   <docblock>
132     <identifier>
133       <name>annotation_elementtype</name>
134     </identifier>
135     <parameters>
136       <parameter>
137         <name>list</name>
138         <annotations>
139           <annotation>
140             <name>element-type</name>
141             <options>
142               <option>
143                 <name>GObject</name>
144               </option>
145             </options>
146           </annotation>
147         </annotations>
148         <description>list of #GObject instances to search</description>
149       </parameter>
150     </parameters>
151     <description>Document optional parameters.</description>
152     <tags>
153       <tag>
154         <name>returns</name>
155         <description>%TRUE for success</description>
156       </tag>
157     </tags>
158   </docblock>
159 </test>
160
161 <test>
162   <commentblock>/**
163  * annotation_elementtype_transfer:
164  * @list: (element-type utf8) (transfer full): list of #GObject instances to search
165  *
166  * Document optional parameters.
167  *
168  * Returns: %TRUE for success
169  */</commentblock>
170   <docblock>
171     <identifier>
172       <name>annotation_elementtype_transfer</name>
173     </identifier>
174     <parameters>
175       <parameter>
176         <name>list</name>
177         <annotations>
178           <annotation>
179             <name>element-type</name>
180             <options>
181               <option>
182                 <name>utf8</name>
183               </option>
184             </options>
185           </annotation>
186           <annotation>
187             <name>transfer</name>
188             <options>
189               <option>
190                 <name>full</name>
191               </option>
192             </options>
193           </annotation>
194         </annotations>
195         <description>list of #GObject instances to search</description>
196       </parameter>
197     </parameters>
198     <description>Document optional parameters.</description>
199     <tags>
200       <tag>
201         <name>returns</name>
202         <description>%TRUE for success</description>
203       </tag>
204     </tags>
205   </docblock>
206 </test>
207
208 <test>
209   <commentblock>/**
210  * annotation_elementtype_returns:
211  *
212  * Document optional parameters.
213  *
214  * Returns: (element-type GObject): A list of #GObject instances.
215  */</commentblock>
216   <docblock>
217     <identifier>
218       <name>annotation_elementtype_returns</name>
219     </identifier>
220     <description>Document optional parameters.</description>
221     <tags>
222       <tag>
223         <name>returns</name>
224         <annotations>
225           <annotation>
226             <name>element-type</name>
227             <options>
228               <option>
229                 <name>GObject</name>
230               </option>
231             </options>
232           </annotation>
233         </annotations>
234         <description>A list of #GObject instances.</description>
235       </tag>
236     </tags>
237   </docblock>
238 </test>
239
240 <test>
241   <commentblock>/**
242  * annotation_outparams:
243  * @list: (out) (transfer none): a pointer to take a list
244  *
245  * Document optional parameters.
246  *
247  * Returns: %TRUE for success
248  */</commentblock>
249   <docblock>
250     <identifier>
251       <name>annotation_outparams</name>
252     </identifier>
253     <parameters>
254       <parameter>
255         <name>list</name>
256         <annotations>
257           <annotation>
258             <name>out</name>
259           </annotation>
260           <annotation>
261             <name>transfer</name>
262             <options>
263               <option>
264                 <name>none</name>
265               </option>
266             </options>
267           </annotation>
268         </annotations>
269         <description>a pointer to take a list</description>
270       </parameter>
271     </parameters>
272     <description>Document optional parameters.</description>
273     <tags>
274       <tag>
275         <name>returns</name>
276         <description>%TRUE for success</description>
277       </tag>
278     </tags>
279   </docblock>
280 </test>
281
282 <test>
283   <commentblock>/**
284  * annotation_skip: (skip)
285  * @list: a pointer to take a list
286  *
287  * Documentation for this function.
288  */</commentblock>
289   <docblock>
290     <identifier>
291       <name>annotation_skip</name>
292       <annotations>
293         <annotation>
294           <name>skip</name>
295         </annotation>
296       </annotations>
297     </identifier>
298     <parameters>
299       <parameter>
300         <name>list</name>
301         <description>a pointer to take a list</description>
302       </parameter>
303     </parameters>
304     <description>Documentation for this function.</description>
305   </docblock>
306 </test>
307
308 <test>
309   <commentblock>/**
310  * annotation_scope:
311  * @callback: (scope async): a callback
312  * @user_data: data to pass to callback
313  *
314  * Documentation for this function.
315  */</commentblock>
316   <docblock>
317     <identifier>
318       <name>annotation_scope</name>
319     </identifier>
320     <parameters>
321       <parameter>
322         <name>callback</name>
323         <annotations>
324           <annotation>
325             <name>scope</name>
326             <options>
327               <option>
328                 <name>async</name>
329               </option>
330             </options>
331           </annotation>
332         </annotations>
333         <description>a callback</description>
334       </parameter>
335       <parameter>
336         <name>user_data</name>
337         <description>data to pass to callback</description>
338       </parameter>
339     </parameters>
340     <description>Documentation for this function.</description>
341   </docblock>
342 </test>
343
344 </tests>