summaryrefslogtreecommitdiff
path: root/tests/scanner/annotationparser/gi/tag.xml
blob: 8480d4b48566023c56724e85adb682cd133be44c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
<?xml version="1.0" encoding="UTF-8"?>

<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">

<test>
  <input>/**
 * test_tag_missing_colon:
 *
 * Forgotten colon below will result in a warning.
 *
 * Returns: (allow-none) return value
 **/</input>
  <parser>
    <docblock>
      <identifier>
        <name>test_tag_missing_colon</name>
      </identifier>
      <description>Forgotten colon below will result in a warning.</description>
      <tags>
        <tag>
          <name>returns</name>
          <annotations>
            <annotation>
              <name>allow-none</name>
            </annotation>
          </annotations>
          <description>return value</description>
        </tag>
      </tags>
    </docblock>
    <messages>
      <message>6: Warning: Test: missing ":" at column 25:
 * Returns: (allow-none) return value
                        ^</message>
    </messages>
  </parser>
  <output>/**
 * test_tag_missing_colon:
 *
 * Forgotten colon below will result in a warning.
 *
 * Returns: (allow-none): return value
 */</output>
</test>

<test>
  <input>/**
 * test_unexpected_tag:
 *
 * @param1: first parameter
 * does something
 * Returns: something
 * returning something
 *
 * Probably intended as the comment block description part but in reality belongs to
 * the "Returns:"" tag description field.
 **/</input>
  <parser>
    <docblock>
      <identifier>
        <name>test_unexpected_tag</name>
      </identifier>
      <parameters>
        <parameter>
          <name>param1</name>
          <description>first parameter
does something</description>
        </parameter>
      </parameters>
      <tags>
        <tag>
          <name>returns</name>
          <description>something
returning something

Probably intended as the comment block description part but in reality belongs to
the "Returns:"" tag description field.</description>
        </tag>
      </tags>
    </docblock>
    <messages>
      <message>4: Warning: Test: "@param1" parameter unexpected at this location:
 * @param1: first parameter
    ^</message>
    </messages>
  </parser>
  <output>/**
 * test_unexpected_tag:
 * @param1: first parameter
 * does something
 *
 * Returns: something
 * returning something
 *
 * Probably intended as the comment block description part but in reality belongs to
 * the "Returns:"" tag description field.
 */</output>
</test>

<test>
  <input>/**
 * test_unknown_tag:
 *
 * Foo: something
 *
 * Returns: True
 * Moo: anything
 **/</input>
  <parser>
    <docblock>
      <identifier>
        <name>test_unknown_tag</name>
      </identifier>
      <description>Foo: something</description>
      <tags>
        <tag>
          <name>returns</name>
          <description>True
Moo: anything</description>
        </tag>
      </tags>
    </docblock>
  </parser>
  <output>/**
 * test_unknown_tag:
 *
 * Foo: something
 *
 * Returns: True
 * Moo: anything
 */</output>
</test>

<test>
  <input>/**
 * test_multiline_tag:
 *
 * Returns:
 * True
 * Since:
 * 1.0: yeah
 */</input>
  <parser>
    <docblock>
      <identifier>
        <name>test_multiline_tag</name>
      </identifier>
      <tags>
        <tag>
          <name>returns</name>
          <description>True</description>
        </tag>
        <tag>
          <name>since</name>
          <description>1.0: yeah</description>
        </tag>
      </tags>
    </docblock>
  </parser>
  <output>/**
 * test_multiline_tag:
 *
 * Returns: True
 * Since: 1.0: yeah
 */</output>
</test>

<test>
  <input>/**
 * test_multiline_annotations_on_tag:
 *
 * Annotations spanning multiple lines are not valid
 *
 * Returns: (allow-none)
 * (transfer full): something
 **/</input>
  <parser>
    <docblock>
      <identifier>
        <name>test_multiline_annotations_on_tag</name>
      </identifier>
      <description>Annotations spanning multiple lines are not valid</description>
      <tags>
        <tag>
          <name>returns</name>
          <annotations>
            <annotation>
              <name>allow-none</name>
            </annotation>
          </annotations>
          <description>
(transfer full): something</description>
        </tag>
      </tags>
    </docblock>
    <messages>
      <message>7: Error: Test: ignoring invalid multiline annotation continuation:
 * (transfer full): something
   ^</message>
    </messages>
  </parser>
  <output>/**
 * test_multiline_annotations_on_tag:
 *
 * Annotations spanning multiple lines are not valid
 *
 * Returns: (allow-none):
 * (transfer full): something
 */</output>
</test>

<test>
  <input>/**
 * test_multiline_annotations_on_tag:
 *
 * Annotations spanning multiple lines are not valid
 *
 * Returns: (allow-none): Returns tag having a second line which looks
 * (like an annotation), but isn't. This should not result in a warning.
 **/</input>
  <parser>
    <docblock>
      <identifier>
        <name>test_multiline_annotations_on_tag</name>
      </identifier>
      <description>Annotations spanning multiple lines are not valid</description>
      <tags>
        <tag>
          <name>returns</name>
          <annotations>
            <annotation>
              <name>allow-none</name>
            </annotation>
          </annotations>
          <description>Returns tag having a second line which looks
(like an annotation), but isn't. This should not result in a warning.</description>
        </tag>
      </tags>
    </docblock>
  </parser>
  <output>/**
 * test_multiline_annotations_on_tag:
 *
 * Annotations spanning multiple lines are not valid
 *
 * Returns: (allow-none): Returns tag having a second line which looks
 * (like an annotation), but isn't. This should not result in a warning.
 */</output>
</test>

<test>
  <input>/**
 * gdk_device_list_axes:
 * @device: a pointer #GdkDevice
 *
 * Returns a #GList of #GdkAtom<!-- -->s, containing the labels for
 * the axes that @device currently has.
 *
 * Returns: (transfer container) (element-type GdkAtom):
 *     A #GList of #GdkAtom<!-- -->s, free
 *     with g_list_free().
 *
 * Since: 3.0
 **/</input>
  <parser>
    <docblock>
      <identifier>
        <name>gdk_device_list_axes</name>
      </identifier>
      <parameters>
        <parameter>
          <name>device</name>
          <description>a pointer #GdkDevice</description>
        </parameter>
      </parameters>
      <description>Returns a #GList of #GdkAtom<!-- -->s, containing the labels for
the axes that @device currently has.</description>
      <tags>
        <tag>
          <name>returns</name>
          <annotations>
            <annotation>
              <name>transfer</name>
              <options>
                <option>
                  <name>container</name>
                </option>
              </options>
            </annotation>
            <annotation>
              <name>element-type</name>
              <options>
                <option>
                  <name>GdkAtom</name>
                </option>
              </options>
            </annotation>
          </annotations>
          <description>
    A #GList of #GdkAtom<!-- -->s, free
    with g_list_free().</description>
        </tag>
        <tag>
          <name>since</name>
          <value>3.0</value>
        </tag>
      </tags>
    </docblock>
  </parser>
  <output>/**
 * gdk_device_list_axes:
 * @device: a pointer #GdkDevice
 *
 * Returns a #GList of #GdkAtom<!-- -->s, containing the labels for
 * the axes that @device currently has.
 *
 * Returns: (transfer container) (element-type GdkAtom):
 *     A #GList of #GdkAtom<!-- -->s, free
 *     with g_list_free().
 * Since: 3.0
 */</output>
</test>

<test>
  <input>/**
   * FsSession:codec-preferences:
   *
   * Type: GLib.List(FsCodec)
   * Transfer: full
   *
   * This is the current preferences list for the local codecs. It is
   * set by the user to specify the codec options and priorities. The user may
   * change its value with fs_session_set_codec_preferences() at any time
   * during a session. It is a #GList of #FsCodec.
   * The user must free this codec list using fs_codec_list_destroy() when done.
   *
   * The payload type may be a valid dynamic PT (96-127), %FS_CODEC_ID_DISABLE
   * or %FS_CODEC_ID_ANY. If the encoding name is "reserve-pt", then the
   * payload type of the codec will be "reserved" and not be used by any
   * dynamically assigned payload type.
   */</input>
  <parser>
    <docblock>
      <identifier>
        <name>FsSession:codec-preferences</name>
        <annotations>
          <annotation>
            <name>type</name>
            <options>
              <option>
                <name>GLib.List(FsCodec)</name>
              </option>
            </options>
          </annotation>
          <annotation>
            <name>transfer</name>
            <options>
              <option>
                <name>full</name>
              </option>
            </options>
          </annotation>
        </annotations>
      </identifier>
      <description>This is the current preferences list for the local codecs. It is
set by the user to specify the codec options and priorities. The user may
change its value with fs_session_set_codec_preferences() at any time
during a session. It is a #GList of #FsCodec.
The user must free this codec list using fs_codec_list_destroy() when done.

The payload type may be a valid dynamic PT (96-127), %FS_CODEC_ID_DISABLE
or %FS_CODEC_ID_ANY. If the encoding name is "reserve-pt", then the
payload type of the codec will be "reserved" and not be used by any
dynamically assigned payload type.</description>
    </docblock>
    <messages>
      <message>4: Warning: Test: GObject-Introspection specific GTK-Doc tag "Type" has been deprecated, please use annotations on the identifier instead:
   * Type: GLib.List(FsCodec)
     ^</message>
     <message>5: Warning: Test: GObject-Introspection specific GTK-Doc tag "Transfer" has been deprecated, please use annotations on the identifier instead:
   * Transfer: full
     ^</message>
    </messages>
  </parser>
  <output>  /**
   * FsSession:codec-preferences: (type GLib.List(FsCodec)) (transfer full)
   *
   * This is the current preferences list for the local codecs. It is
   * set by the user to specify the codec options and priorities. The user may
   * change its value with fs_session_set_codec_preferences() at any time
   * during a session. It is a #GList of #FsCodec.
   * The user must free this codec list using fs_codec_list_destroy() when done.
   *
   * The payload type may be a valid dynamic PT (96-127), %FS_CODEC_ID_DISABLE
   * or %FS_CODEC_ID_ANY. If the encoding name is "reserve-pt", then the
   * payload type of the codec will be "reserved" and not be used by any
   * dynamically assigned payload type.
   */</output>
</test>

</tests>