Change license name
[platform/upstream/gobject-introspection.git] / tests / scanner / annotationparser / gi / tag_returns.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
4
5 <test>
6   <input>/**
7  * annotation_object_string_out:
8  *
9  * Test returning a string as an out parameter
10  *
11  * Returns: (allow-none): some boolean
12  **/</input>
13   <parser>
14     <docblock>
15       <identifier>
16         <name>annotation_object_string_out</name>
17       </identifier>
18       <description>Test returning a string as an out parameter</description>
19       <tags>
20         <tag>
21           <name>returns</name>
22           <annotations>
23             <annotation>
24               <name>allow-none</name>
25             </annotation>
26           </annotations>
27           <description>some boolean</description>
28         </tag>
29       </tags>
30     </docblock>
31   </parser>
32   <output>/**
33  * annotation_object_string_out:
34  *
35  * Test returning a string as an out parameter
36  *
37  * Returns: (allow-none): some boolean
38  */</output>
39 </test>
40
41 <test>
42   <input>/**
43  * annotation_object_string_out:
44  *
45  * Test returning a string as an out parameter
46  *
47  * Returns: (allow-none)): some boolean
48  **/</input>
49   <parser>
50     <docblock>
51       <identifier>
52         <name>annotation_object_string_out</name>
53       </identifier>
54       <description>Test returning a string as an out parameter</description>
55       <tags>
56         <tag>
57           <name>returns</name>
58         </tag>
59       </tags>
60     </docblock>
61     <messages>
62       <message>6: Error: Test: unbalanced parentheses, annotations will be ignored:
63  * Returns: (allow-none)): some boolean
64                         ^</message>
65     </messages>
66   </parser>
67   <output>/**
68  * annotation_object_string_out:
69  *
70  * Test returning a string as an out parameter
71  *
72  * Returns:
73  */</output>
74 </test>
75
76 <test>
77   <input>/**
78  * test_unexpected_tag:
79  * @param1: first parameter
80  * Returns: something
81  *
82  * Tags should go after the comment block description
83  **/</input>
84   <parser>
85     <docblock>
86       <identifier>
87         <name>test_unexpected_tag</name>
88       </identifier>
89       <parameters>
90         <parameter>
91           <name>param1</name>
92           <description>first parameter</description>
93         </parameter>
94       </parameters>
95       <tags>
96         <tag>
97           <name>returns</name>
98           <description>something
99
100 Tags should go after the comment block description</description>
101         </tag>
102       </tags>
103     </docblock>
104   </parser>
105   <output>/**
106  * test_unexpected_tag:
107  * @param1: first parameter
108  *
109  * Returns: something
110  *
111  * Tags should go after the comment block description
112  */</output>
113 </test>
114
115 <test>
116   <!--
117   Deprecated "Return value:" tag
118   -->
119   <input>/**
120  * annotation_object_string_out:
121  *
122  * Test returning a string as an out parameter
123  *
124  * Return value: (allow-none): some boolean
125  **/</input>
126   <parser>
127     <docblock>
128       <identifier>
129         <name>annotation_object_string_out</name>
130       </identifier>
131       <description>Test returning a string as an out parameter</description>
132       <tags>
133         <tag>
134           <name>returns</name>
135           <annotations>
136             <annotation>
137               <name>allow-none</name>
138             </annotation>
139           </annotations>
140           <description>some boolean</description>
141         </tag>
142       </tags>
143     </docblock>
144   </parser>
145   <output>/**
146  * annotation_object_string_out:
147  *
148  * Test returning a string as an out parameter
149  *
150  * Returns: (allow-none): some boolean
151  */</output>
152 </test>
153
154 <test>
155   <!--
156   Deprecated "@returns" as a parameter
157   -->
158   <input>/**
159  * annotation_object_string_out:
160  * @returns: (allow-none): some boolean
161  *
162  * Test returning a string as an out parameter
163  **/</input>
164   <parser>
165     <docblock>
166       <identifier>
167         <name>annotation_object_string_out</name>
168       </identifier>
169       <description>Test returning a string as an out parameter</description>
170       <tags>
171         <tag>
172           <name>returns</name>
173           <annotations>
174             <annotation>
175               <name>allow-none</name>
176             </annotation>
177           </annotations>
178           <description>some boolean</description>
179         </tag>
180       </tags>
181     </docblock>
182   </parser>
183   <output>/**
184  * annotation_object_string_out:
185  *
186  * Test returning a string as an out parameter
187  *
188  * Returns: (allow-none): some boolean
189  */</output>
190 </test>
191
192 <test>
193   <!--
194   Variation of "@returns" as a parameter
195   -->
196   <input>/**
197  * annotation_object_string_out:
198  * @returns: (allow-none)): some boolean
199  *
200  * Test returning a string as an out parameter
201  **/</input>
202   <parser>
203     <docblock>
204       <identifier>
205         <name>annotation_object_string_out</name>
206       </identifier>
207       <description>Test returning a string as an out parameter</description>
208       <tags>
209         <tag>
210           <name>returns</name>
211         </tag>
212       </tags>
213     </docblock>
214     <messages>
215       <message>3: Error: Test: unbalanced parentheses, annotations will be ignored:
216  * @returns: (allow-none)): some boolean
217                          ^</message>
218     </messages>
219   </parser>
220   <output>/**
221  * annotation_object_string_out:
222  *
223  * Test returning a string as an out parameter
224  *
225  * Returns:
226  */</output>
227 </test>
228
229 <test>
230   <!--
231   Variation of "@returns" as a parameter
232   -->
233   <input>/**
234  * annotation_object_string_out:
235  * @returns:
236  *
237  * Test returning a string as an out parameter
238  **/</input>
239   <parser>
240     <docblock>
241       <identifier>
242         <name>annotation_object_string_out</name>
243       </identifier>
244       <description>Test returning a string as an out parameter</description>
245       <tags>
246         <tag>
247           <name>returns</name>
248         </tag>
249       </tags>
250     </docblock>
251   </parser>
252   <output>/**
253  * annotation_object_string_out:
254  *
255  * Test returning a string as an out parameter
256  *
257  * Returns:
258  */</output>
259 </test>
260
261 <test>
262   <!--
263   Variation of multiple "Returns:" notations
264   -->
265   <input>/**
266  * test_multiple_returns_tag_and_parameter:
267  *
268  * Multiple return value warnings are checked for when a returns
269  * parameter is encountered.
270  *
271  * Return Value: something
272  * @returns: something else
273  */</input>
274   <parser>
275     <docblock>
276       <identifier>
277         <name>test_multiple_returns_tag_and_parameter</name>
278       </identifier>
279       <description>Multiple return value warnings are checked for when a returns
280 parameter is encountered.</description>
281       <tags>
282         <tag>
283           <name>returns</name>
284           <description>something else</description>
285         </tag>
286       </tags>
287     </docblock>
288     <messages>
289       <message>8: Warning: Test: "@returns" parameter unexpected at this location:
290  * @returns: something else
291     ^</message>
292       <message>8: Error: Test: encountered multiple "Returns" parameters or tags for "test_multiple_returns_tag_and_parameter".</message>
293     </messages>
294   </parser>
295   <output>/**
296  * test_multiple_returns_tag_and_parameter:
297  *
298  * Multiple return value warnings are checked for when a returns
299  * parameter is encountered.
300  *
301  * Returns: something else
302  */</output>
303 </test>
304
305 <test>
306   <!--
307   Variation of multiple "Returns:" notations
308   -->
309   <input>/**
310  * test_multiple_returns_tag_and_parameter:
311  * @returns: something
312  *
313  * Multiple return value warnings are checked for when a returns
314  * parameter is encountered.
315  *
316  * Return Value: something else
317  */</input>
318   <parser>
319     <docblock>
320       <identifier>
321         <name>test_multiple_returns_tag_and_parameter</name>
322       </identifier>
323       <description>Multiple return value warnings are checked for when a returns
324 parameter is encountered.</description>
325       <tags>
326         <tag>
327           <name>returns</name>
328           <description>something else</description>
329         </tag>
330       </tags>
331     </docblock>
332     <messages>
333       <message>8: Error: Test: encountered multiple return value parameters or tags for "test_multiple_returns_tag_and_parameter".</message>
334     </messages>
335   </parser>
336   <output>/**
337  * test_multiple_returns_tag_and_parameter:
338  *
339  * Multiple return value warnings are checked for when a returns
340  * parameter is encountered.
341  *
342  * Returns: something else
343  */</output>
344 </test>
345
346 <test>
347   <!--
348   Variation of multiple "Returns:" notations
349   -->
350   <input>/**
351  * test_multiple_returns_tag_and_parameter:
352  * @returns: something
353  *
354  * Multiple return value warnings are checked for when a returns
355  * parameter is encountered.
356  *
357  * Returns: something else
358  */</input>
359   <parser>
360     <docblock>
361       <identifier>
362         <name>test_multiple_returns_tag_and_parameter</name>
363       </identifier>
364       <description>Multiple return value warnings are checked for when a returns
365 parameter is encountered.</description>
366       <tags>
367         <tag>
368           <name>returns</name>
369           <description>something else</description>
370         </tag>
371       </tags>
372     </docblock>
373     <messages>
374       <message>8: Error: Test: encountered multiple return value parameters or tags for "test_multiple_returns_tag_and_parameter".</message>
375     </messages>
376   </parser>
377   <output>/**
378  * test_multiple_returns_tag_and_parameter:
379  *
380  * Multiple return value warnings are checked for when a returns
381  * parameter is encountered.
382  *
383  * Returns: something else
384  */</output>
385 </test>
386
387 <test>
388   <input><![CDATA[/**
389  * gtk_rc_get_im_module_path:
390  * @returns: a newly-allocated string containing the path in which to 
391  *    look for IM modules.
392  *
393  * Obtains the path in which to look for IM modules. See the documentation
394  * of the <link linkend="im-module-path"><envar>GTK_PATH</envar></link>
395  * environment variable for more details about looking up modules. This
396  * function is useful solely for utilities supplied with GTK+ and should
397  * not be used by applications under normal circumstances.
398  */]]></input>
399   <parser>
400     <docblock>
401       <identifier>
402         <name>gtk_rc_get_im_module_path</name>
403       </identifier>
404       <description><![CDATA[Obtains the path in which to look for IM modules. See the documentation
405 of the <link linkend="im-module-path"><envar>GTK_PATH</envar></link>
406 environment variable for more details about looking up modules. This
407 function is useful solely for utilities supplied with GTK+ and should
408 not be used by applications under normal circumstances.]]></description>
409       <tags>
410         <tag>
411           <name>returns</name>
412           <description>a newly-allocated string containing the path in which to
413    look for IM modules.</description>
414         </tag>
415       </tags>
416     </docblock>
417   </parser>
418   <output><![CDATA[/**
419  * gtk_rc_get_im_module_path:
420  *
421  * Obtains the path in which to look for IM modules. See the documentation
422  * of the <link linkend="im-module-path"><envar>GTK_PATH</envar></link>
423  * environment variable for more details about looking up modules. This
424  * function is useful solely for utilities supplied with GTK+ and should
425  * not be used by applications under normal circumstances.
426  *
427  * Returns: a newly-allocated string containing the path in which to
428  *    look for IM modules.
429  */]]></output>
430 </test>
431
432 <test>
433   <!--
434   Technically not a valid Returns: tag, but we need to support this for backwards compatibility
435   with the old annotationparser.
436   -->
437   <input>/**
438  * clutter_text_coords_to_position:
439  * @self: a #ClutterText
440  * @x: the X coordinate, relative to the actor
441  * @y: the Y coordinate, relative to the actor
442  *
443  * Retrieves the position of the character at the given coordinates.
444  *
445  * Return: the position of the character
446  *
447  * Since: 1.10
448  */</input>
449   <parser>
450     <docblock>
451       <identifier>
452         <name>clutter_text_coords_to_position</name>
453       </identifier>
454       <parameters>
455         <parameter>
456           <name>self</name>
457           <description>a #ClutterText</description>
458         </parameter>
459         <parameter>
460           <name>x</name>
461           <description>the X coordinate, relative to the actor</description>
462         </parameter>
463         <parameter>
464           <name>y</name>
465           <description>the Y coordinate, relative to the actor</description>
466         </parameter>
467       </parameters>
468       <description>Retrieves the position of the character at the given coordinates.</description>
469       <tags>
470         <tag>
471           <name>returns</name>
472           <description>the position of the character</description>
473         </tag>
474         <tag>
475           <name>since</name>
476           <value>1.10</value>
477         </tag>
478       </tags>
479     </docblock>
480   </parser>
481   <output>/**
482  * clutter_text_coords_to_position:
483  * @self: a #ClutterText
484  * @x: the X coordinate, relative to the actor
485  * @y: the Y coordinate, relative to the actor
486  *
487  * Retrieves the position of the character at the given coordinates.
488  *
489  * Returns: the position of the character
490  * Since: 1.10
491  */</output>
492 </test>
493
494 <test>
495   <!--
496   Technically not a valid Returns: tag, but we need to support this for backwards compatibility
497   with the old annotationparser.
498   -->
499   <input>/**
500  * clutter_text_coords_to_position:
501  * @self: a #ClutterText
502  * @x: the X coordinate, relative to the actor
503  * @y: the Y coordinate, relative to the actor
504  *
505  * Retrieves the position of the character at the given coordinates.
506  *
507  * Returns value: the position of the character
508  *
509  * Since: 1.10
510  */</input>
511   <parser>
512     <docblock>
513       <identifier>
514         <name>clutter_text_coords_to_position</name>
515       </identifier>
516       <parameters>
517         <parameter>
518           <name>self</name>
519           <description>a #ClutterText</description>
520         </parameter>
521         <parameter>
522           <name>x</name>
523           <description>the X coordinate, relative to the actor</description>
524         </parameter>
525         <parameter>
526           <name>y</name>
527           <description>the Y coordinate, relative to the actor</description>
528         </parameter>
529       </parameters>
530       <description>Retrieves the position of the character at the given coordinates.</description>
531       <tags>
532         <tag>
533           <name>returns</name>
534           <description>the position of the character</description>
535         </tag>
536         <tag>
537           <name>since</name>
538           <value>1.10</value>
539         </tag>
540       </tags>
541     </docblock>
542   </parser>
543   <output>/**
544  * clutter_text_coords_to_position:
545  * @self: a #ClutterText
546  * @x: the X coordinate, relative to the actor
547  * @y: the Y coordinate, relative to the actor
548  *
549  * Retrieves the position of the character at the given coordinates.
550  *
551  * Returns: the position of the character
552  * Since: 1.10
553  */</output>
554 </test>
555
556 <test>
557   <input>/**
558  * annotation_object_string_out:
559  *
560  * Test returning a string as an out parameter
561  *
562  * Returns: (out): some boolean
563  **/</input>
564   <parser>
565     <docblock>
566       <identifier>
567         <name>annotation_object_string_out</name>
568       </identifier>
569       <description>Test returning a string as an out parameter</description>
570       <tags>
571         <tag>
572           <name>returns</name>
573           <annotations>
574             <annotation>
575               <name>out</name>
576             </annotation>
577           </annotations>
578           <description>some boolean</description>
579         </tag>
580       </tags>
581     </docblock>
582     <messages>
583       <message>6: Warning: Test: unexpected annotation: out</message>
584     </messages>
585   </parser>
586   <output>/**
587  * annotation_object_string_out:
588  *
589  * Test returning a string as an out parameter
590  *
591  * Returns: (out): some boolean
592  */</output>
593 </test>
594
595 </tests>