diff options
author | Colin Walters <walters@verbum.org> | 2013-10-30 15:24:06 +0000 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2013-10-30 17:23:22 -0400 |
commit | 6b44b271fb27dc46175b58fbd7e1f36ac0419943 (patch) | |
tree | ce1d8e7424dd178ab1c7f35a074f460dd1834fc0 /tests/scanner | |
parent | a22fde8ba32aa0614371e4e3a8e6f5e755ae28ad (diff) | |
download | gobject-introspection-6b44b271fb27dc46175b58fbd7e1f36ac0419943.tar.gz |
scanner: Don't barf on anonymous unions
I'd like to be able to use this inside GTK+.
See: https://bugzilla.gnome.org/show_bug.cgi?id=711153
https://bugzilla.gnome.org/show_bug.cgi?id=711157
Diffstat (limited to 'tests/scanner')
8 files changed, 182 insertions, 0 deletions
diff --git a/tests/scanner/Regress-1.0-C-expected/Regress.AnAnonymousUnion.None.page b/tests/scanner/Regress-1.0-C-expected/Regress.AnAnonymousUnion.None.page new file mode 100644 index 00000000..6dc17b32 --- /dev/null +++ b/tests/scanner/Regress-1.0-C-expected/Regress.AnAnonymousUnion.None.page @@ -0,0 +1,25 @@ +<?xml version="1.0"?> +<page id="Regress.AnAnonymousUnion.None" + type="topic" + style="default" + xmlns="http://projectmallard.org/1.0/" + xmlns:api="http://projectmallard.org/experimental/api/" + xmlns:ui="http://projectmallard.org/1.0/ui/"> + <info> + + <link xref="index" group="default" type="guide"/> + + </info> + <title>Regress.AnAnonymousUnion.None</title> + + + + + + + + + + + +</page> diff --git a/tests/scanner/Regress-1.0-C-expected/Regress.AnAnonymousUnion.page b/tests/scanner/Regress-1.0-C-expected/Regress.AnAnonymousUnion.page new file mode 100644 index 00000000..f9323c69 --- /dev/null +++ b/tests/scanner/Regress-1.0-C-expected/Regress.AnAnonymousUnion.page @@ -0,0 +1,25 @@ +<?xml version="1.0"?> +<page id="Regress.AnAnonymousUnion" + type="topic" + style="record" + xmlns="http://projectmallard.org/1.0/" + xmlns:api="http://projectmallard.org/experimental/api/" + xmlns:ui="http://projectmallard.org/1.0/ui/"> + <info> + + <link xref="index" group="record" type="guide"/> + + </info> + <title>Regress.AnAnonymousUnion</title> + + + + + + + + + + + +</page> diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.AnAnonymousUnion.None.page b/tests/scanner/Regress-1.0-Gjs-expected/Regress.AnAnonymousUnion.None.page new file mode 100644 index 00000000..6dc17b32 --- /dev/null +++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.AnAnonymousUnion.None.page @@ -0,0 +1,25 @@ +<?xml version="1.0"?> +<page id="Regress.AnAnonymousUnion.None" + type="topic" + style="default" + xmlns="http://projectmallard.org/1.0/" + xmlns:api="http://projectmallard.org/experimental/api/" + xmlns:ui="http://projectmallard.org/1.0/ui/"> + <info> + + <link xref="index" group="default" type="guide"/> + + </info> + <title>Regress.AnAnonymousUnion.None</title> + + + + + + + + + + + +</page> diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.AnAnonymousUnion.page b/tests/scanner/Regress-1.0-Gjs-expected/Regress.AnAnonymousUnion.page new file mode 100644 index 00000000..2556feda --- /dev/null +++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.AnAnonymousUnion.page @@ -0,0 +1,25 @@ +<?xml version="1.0"?> +<page id="Regress.AnAnonymousUnion" + type="guide" + style="record" + xmlns="http://projectmallard.org/1.0/" + xmlns:api="http://projectmallard.org/experimental/api/" + xmlns:ui="http://projectmallard.org/1.0/ui/"> + <info> + + <link xref="index" group="record" type="guide"/> + + </info> + <title>Regress.AnAnonymousUnion</title> + + + + + + + + + + + +</page> diff --git a/tests/scanner/Regress-1.0-Python-expected/Regress.AnAnonymousUnion.None.page b/tests/scanner/Regress-1.0-Python-expected/Regress.AnAnonymousUnion.None.page new file mode 100644 index 00000000..6dc17b32 --- /dev/null +++ b/tests/scanner/Regress-1.0-Python-expected/Regress.AnAnonymousUnion.None.page @@ -0,0 +1,25 @@ +<?xml version="1.0"?> +<page id="Regress.AnAnonymousUnion.None" + type="topic" + style="default" + xmlns="http://projectmallard.org/1.0/" + xmlns:api="http://projectmallard.org/experimental/api/" + xmlns:ui="http://projectmallard.org/1.0/ui/"> + <info> + + <link xref="index" group="default" type="guide"/> + + </info> + <title>Regress.AnAnonymousUnion.None</title> + + + + + + + + + + + +</page> diff --git a/tests/scanner/Regress-1.0-Python-expected/Regress.AnAnonymousUnion.page b/tests/scanner/Regress-1.0-Python-expected/Regress.AnAnonymousUnion.page new file mode 100644 index 00000000..2556feda --- /dev/null +++ b/tests/scanner/Regress-1.0-Python-expected/Regress.AnAnonymousUnion.page @@ -0,0 +1,25 @@ +<?xml version="1.0"?> +<page id="Regress.AnAnonymousUnion" + type="guide" + style="record" + xmlns="http://projectmallard.org/1.0/" + xmlns:api="http://projectmallard.org/experimental/api/" + xmlns:ui="http://projectmallard.org/1.0/ui/"> + <info> + + <link xref="index" group="record" type="guide"/> + + </info> + <title>Regress.AnAnonymousUnion</title> + + + + + + + + + + + +</page> diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir index a16205bc..c6ae2245 100644 --- a/tests/scanner/Regress-1.0-expected.gir +++ b/tests/scanner/Regress-1.0-expected.gir @@ -68,6 +68,26 @@ and/or use gtk-doc annotations. --> <member name="code2" value="2" c:identifier="REGRESS_ATEST_ERROR_CODE2"> </member> </enumeration> + <record name="AnAnonymousUnion" c:type="RegressAnAnonymousUnion"> + <field name="x" writable="1"> + <type name="gint" c:type="int"/> + </field> + <union> + <field name="a" writable="1"> + <array zero-terminated="0" + c:type="RegressLikeGnomeKeyringPasswordSchema" + fixed-size="2"> + <type name="LikeGnomeKeyringPasswordSchema" + c:type="RegressLikeGnomeKeyringPasswordSchema*"/> + </array> + </field> + <field name="padding" writable="1"> + <array zero-terminated="0" c:type="guint" fixed-size="4"> + <type name="guint" c:type="guint"/> + </array> + </field> + </union> + </record> <bitfield name="AnnotationBitfield" c:type="RegressAnnotationBitfield"> <member name="foo" value="1" c:identifier="ANN_FLAG_FOO"> </member> diff --git a/tests/scanner/regress.h b/tests/scanner/regress.h index 9c858840..079c6fee 100644 --- a/tests/scanner/regress.h +++ b/tests/scanner/regress.h @@ -962,4 +962,16 @@ typedef struct { #endif #endif +/* This struct is one pattern by which padding can be consumed, if + * you're willing to take a hard dependency on anonymous unions. */ +typedef struct { + int x; + + union { + RegressLikeGnomeKeyringPasswordSchema *a[2]; + + guint padding[4]; + }; +} RegressAnAnonymousUnion; + #endif /* __GITESTTYPES_H__ */ |