summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndreas Rottmann <a.rottmann@gmx.at>2009-03-04 15:59:28 +0100
committerAndreas Rottmann <a.rottmann@gmx.at>2009-03-04 15:59:28 +0100
commitb8e3172424ba956a0d18eae8deb305310b2cab74 (patch)
tree50bf11870760c23d6734bc7fa65e10d30da10ef6 /tests
parent5b4df314f3c59530a930ab3b09cd44212603a771 (diff)
downloadgobject-introspection-b8e3172424ba956a0d18eae8deb305310b2cab74.tar.gz
Bug 573332 - Allow annotation of enums as bitfields
Add support for a `(type bitfield)' annotation for enums. Signed-off-by: Andreas Rottmann <a.rottmann@gmx.at>
Diffstat (limited to 'tests')
-rw-r--r--tests/scanner/utility-1.0-expected.gir10
-rw-r--r--tests/scanner/utility-1.0-expected.tgir10
-rw-r--r--tests/scanner/utility.c4
-rw-r--r--tests/scanner/utility.h6
4 files changed, 17 insertions, 13 deletions
diff --git a/tests/scanner/utility-1.0-expected.gir b/tests/scanner/utility-1.0-expected.gir
index 7ff6ca5a..0ca72cb8 100644
--- a/tests/scanner/utility-1.0-expected.gir
+++ b/tests/scanner/utility-1.0-expected.gir
@@ -42,11 +42,11 @@ and/or use gtk-doc annotations. -->
</parameter>
</parameters>
</callback>
- <enumeration name="FlagType" c:type="UtilityFlagType">
- <member name="a" value="0" c:identifier="UTILITY_FLAG_A"/>
- <member name="b" value="1" c:identifier="UTILITY_FLAG_B"/>
- <member name="c" value="2" c:identifier="UTILITY_FLAG_C"/>
- </enumeration>
+ <bitfield name="FlagType" c:type="UtilityFlagType">
+ <member name="a" value="1" c:identifier="UTILITY_FLAG_A"/>
+ <member name="b" value="2" c:identifier="UTILITY_FLAG_B"/>
+ <member name="c" value="4" c:identifier="UTILITY_FLAG_C"/>
+ </bitfield>
<class name="Object"
c:type="UtilityObject"
parent="GObject.Object"
diff --git a/tests/scanner/utility-1.0-expected.tgir b/tests/scanner/utility-1.0-expected.tgir
index 46ba2922..26535846 100644
--- a/tests/scanner/utility-1.0-expected.tgir
+++ b/tests/scanner/utility-1.0-expected.tgir
@@ -29,11 +29,11 @@
</parameter>
</parameters>
</callback>
- <enumeration name="FlagType">
- <member name="a" value="0"/>
- <member name="b" value="1"/>
- <member name="c" value="2"/>
- </enumeration>
+ <bitfield name="FlagType">
+ <member name="a" value="1"/>
+ <member name="b" value="2"/>
+ <member name="c" value="4"/>
+ </bitfield>
<class name="Object" parent="GObject.Object" glib:type-struct="ObjectClass" glib:type-name="UtilityObject" glib:get-type="utility_object_get_type">
<field name="parent_instance">
<type name="GObject.Object"/>
diff --git a/tests/scanner/utility.c b/tests/scanner/utility.c
index 756de178..a54afad9 100644
--- a/tests/scanner/utility.c
+++ b/tests/scanner/utility.c
@@ -2,6 +2,10 @@
G_DEFINE_TYPE (UtilityObject, utility_object, G_TYPE_OBJECT);
+/**
+ * UtilityFlagType: (type bitfield)
+ **/
+
static void
utility_object_class_init (UtilityObjectClass *klass)
{
diff --git a/tests/scanner/utility.h b/tests/scanner/utility.h
index b493a677..cad93ff5 100644
--- a/tests/scanner/utility.h
+++ b/tests/scanner/utility.h
@@ -62,9 +62,9 @@ typedef enum
typedef enum
{
- UTILITY_FLAG_A,
- UTILITY_FLAG_B,
- UTILITY_FLAG_C
+ UTILITY_FLAG_A = 1,
+ UTILITY_FLAG_B = 2,
+ UTILITY_FLAG_C = 4
} UtilityFlagType;
typedef struct