[gobject-introspection] Add mask flags to GIMarshallingTests to test for flags with the same value.



commit aecea30d7684694ca1679a925e5d2b4025bf74e7
Author: Laszlo Pandy <lpandy src gnome org>
Date:   Wed Feb 23 11:34:13 2011 +0100

    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.

 tests/gimarshallingtests.c |    2 ++
 tests/gimarshallingtests.h |   10 ++++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c
index bbb6bd8..bea65a4 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 4221560..a604e2f 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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]