summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaszlo Pandy <lpandy@src.gnome.org>2011-02-23 11:34:13 +0100
committerLaszlo Pandy <lpandy@src.gnome.org>2011-02-23 11:34:13 +0100
commitaecea30d7684694ca1679a925e5d2b4025bf74e7 (patch)
tree0b904d3e79b0e1f920f55d42224229be7e4edca9
parentc8e04058f412a1d8618e35589b738c92da017911 (diff)
downloadgobject-introspection-aecea30d7684694ca1679a925e5d2b4025bf74e7.tar.gz
Add mask flags to GIMarshallingTests to test for flags with the same value.
Glib uses flag aliases, multiple flag names with the same int value. For example G_IO_FLAG_MASK and G_IO_FLAG_GET_MASK. We need these flag values to test that gi bindings don't assume that all flags have the same value.
-rw-r--r--tests/gimarshallingtests.c2
-rw-r--r--tests/gimarshallingtests.h10
2 files changed, 10 insertions, 2 deletions
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c
index bbb6bd8d..bea65a40 100644
--- a/tests/gimarshallingtests.c
+++ b/tests/gimarshallingtests.c
@@ -2516,6 +2516,8 @@ gi_marshalling_tests_flags_get_type (void)
{ GI_MARSHALLING_TESTS_FLAGS_VALUE1, "GI_MARSHALLING_TESTS_FLAGS_VALUE1", "value1" },
{ GI_MARSHALLING_TESTS_FLAGS_VALUE2, "GI_MARSHALLING_TESTS_FLAGS_VALUE2", "value2" },
{ GI_MARSHALLING_TESTS_FLAGS_VALUE3, "GI_MARSHALLING_TESTS_FLAGS_VALUE3", "value3" },
+ { GI_MARSHALLING_TESTS_FLAGS_MASK, "GI_MARSHALLING_TESTS_FLAGS_MASK", "mask" },
+ { GI_MARSHALLING_TESTS_FLAGS_MASK2, "GI_MARSHALLING_TESTS_FLAGS_MASK2", "mask2" },
{ 0, NULL, NULL }
};
type = g_flags_register_static (g_intern_static_string ("GIMarshallingTestsFlags"), values);
diff --git a/tests/gimarshallingtests.h b/tests/gimarshallingtests.h
index 42215601..a604e2f8 100644
--- a/tests/gimarshallingtests.h
+++ b/tests/gimarshallingtests.h
@@ -467,7 +467,10 @@ typedef enum
{
GI_MARSHALLING_TESTS_FLAGS_VALUE1 = 1 << 0,
GI_MARSHALLING_TESTS_FLAGS_VALUE2 = 1 << 1,
- GI_MARSHALLING_TESTS_FLAGS_VALUE3 = 1 << 2
+ GI_MARSHALLING_TESTS_FLAGS_VALUE3 = 1 << 2,
+ GI_MARSHALLING_TESTS_FLAGS_MASK = GI_MARSHALLING_TESTS_FLAGS_VALUE1 |
+ GI_MARSHALLING_TESTS_FLAGS_VALUE2,
+ GI_MARSHALLING_TESTS_FLAGS_MASK2 = GI_MARSHALLING_TESTS_FLAGS_MASK
} GIMarshallingTestsFlags;
GType gi_marshalling_tests_flags_get_type (void) G_GNUC_CONST;
@@ -488,7 +491,10 @@ typedef enum
{
GI_MARSHALLING_TESTS_NO_TYPE_FLAGS_VALUE1 = 1 << 0,
GI_MARSHALLING_TESTS_NO_TYPE_FLAGS_VALUE2 = 1 << 1,
- GI_MARSHALLING_TESTS_NO_TYPE_FLAGS_VALUE3 = 1 << 2
+ GI_MARSHALLING_TESTS_NO_TYPE_FLAGS_VALUE3 = 1 << 2,
+ GI_MARSHALLING_TESTS_NO_TYPE_FLAGS_MASK = GI_MARSHALLING_TESTS_NO_TYPE_FLAGS_VALUE1 |
+ GI_MARSHALLING_TESTS_NO_TYPE_FLAGS_VALUE2,
+ GI_MARSHALLING_TESTS_NO_TYPE_FLAGS_MASK2 = GI_MARSHALLING_TESTS_FLAGS_MASK
} GIMarshallingTestsNoTypeFlags;
GIMarshallingTestsNoTypeFlags gi_marshalling_tests_no_type_flags_returnv (void);