giscanner: add AnnotationParser tests
[platform/upstream/gobject-introspection.git] / tests / scanner / annotationparser / gi / annotation_closure.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <tests>
4
5 <test>
6   <commentblock>/**
7  * AnnotationNotifyFunc:
8  * @data: (closure): The user data
9  *
10  * This is a callback with a 'closure' argument that is not named
11  * 'user_data' and hence has to be annotated.
12  */</commentblock>
13   <docblock>
14     <identifier>
15       <name>AnnotationNotifyFunc</name>
16     </identifier>
17     <parameters>
18       <parameter>
19         <name>data</name>
20         <annotations>
21           <annotation>
22             <name>closure</name>
23           </annotation>
24         </annotations>
25         <description>The user data</description>
26       </parameter>
27     </parameters>
28     <description>This is a callback with a 'closure' argument that is not named
29 'user_data' and hence has to be annotated.</description>
30   </docblock>
31 </test>
32
33 <test>
34   <commentblock>/**
35  * annotation_custom_destroy:
36  * @callback: (destroy destroy) (closure data): Destroy notification
37  *
38  * Test messing up the heuristic of closure/destroy-notification
39  * detection, and fixing it via annotations.
40  */</commentblock>
41   <docblock>
42     <identifier>
43       <name>annotation_custom_destroy</name>
44     </identifier>
45     <parameters>
46       <parameter>
47         <name>callback</name>
48         <annotations>
49           <annotation>
50             <name>destroy</name>
51             <options>
52               <option>
53                 <name>destroy</name>
54               </option>
55             </options>
56           </annotation>
57           <annotation>
58             <name>closure</name>
59             <options>
60               <option>
61                 <name>data</name>
62               </option>
63             </options>
64           </annotation>
65         </annotations>
66         <description>Destroy notification</description>
67       </parameter>
68     </parameters>
69     <description>Test messing up the heuristic of closure/destroy-notification
70 detection, and fixing it via annotations.</description>
71   </docblock>
72 </test>
73
74 </tests>