~vcs-imports/vala/trunk

« back to all changes in this revision

Viewing changes to tests/gir/bug792998.test

  • Committer: Rico Tzschichholz
  • Date: 2022-09-12 06:29:48 UTC
  • Revision ID: git-v1:841ac8c8c963e6fe0e74f82b7880a7049704bf14
tests: Split up gir parser tests into dedicated files

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
GIR
2
 
 
3
 
Input:
4
 
 
5
 
<class name="Foo" c:type="TestFoo" glib:type-name="TestFoo" glib:get-type="test_foo_get_type" glib:type-struct="FooClass" parent="GObject.Object">
6
 
  <method name="get_prop1" c:identifier="test_foo_get_prop1" throws="1">
7
 
    <return-value transfer-ownership="full">
8
 
      <type name="gint" c:type="gint"/>
9
 
    </return-value>
10
 
  </method>
11
 
  <method name="set_prop2" c:identifier="test_foo_set_prop2" throws="1">
12
 
    <return-value transfer-ownership="full">
13
 
      <type name="gboolean" c:type="gboolean"/>
14
 
    </return-value>
15
 
    <parameters>
16
 
      <parameter name="i" transfer-ownership="none">
17
 
        <type name="gint" c:type="gint"/>
18
 
      </parameter>
19
 
    </parameters>
20
 
  </method>
21
 
  <property name="prop1" writable="1">
22
 
    <type name="gint" c:type="gint"/>
23
 
  </property>
24
 
  <method name="set_prop1" c:identifier="test_foo_set_prop1">
25
 
    <return-value transfer-ownership="none">
26
 
      <type name="none"/>
27
 
    </return-value>
28
 
    <parameters>
29
 
      <parameter name="value" transfer-ownership="none">
30
 
        <type name="gint" c:type="gint"/>
31
 
      </parameter>
32
 
    </parameters>
33
 
  </method>
34
 
  <property name="prop2" writable="1">
35
 
    <type name="gint" c:type="gint"/>
36
 
  </property>
37
 
  <method name="get_prop2" c:identifier="test_foo_get_prop2">
38
 
    <return-value transfer-ownership="none">
39
 
      <type name="gint" c:type="gint"/>
40
 
    </return-value>
41
 
  </method>
42
 
</class>
43
 
<record name="FooClass" c:type="TestFooClass" glib:is-gtype-struct-for="Foo"/>
44
 
 
45
 
Output:
46
 
 
47
 
[CCode (cheader_filename = "test.h", type_id = "test_foo_get_type ()")]
48
 
public class Foo : GLib.Object {
49
 
        [CCode (has_construct_function = false)]
50
 
        protected Foo ();
51
 
        public int get_prop1 () throws GLib.Error;
52
 
        public int get_prop2 ();
53
 
        public void set_prop1 (int value);
54
 
        public bool set_prop2 (int i) throws GLib.Error;
55
 
        [NoAccessorMethod]
56
 
        public int prop1 { get; set; }
57
 
        [NoAccessorMethod]
58
 
        public int prop2 { get; set; }
59
 
}