diff options
author | Tomeu Vizoso <tomeu@sugarlabs.org> | 2010-04-22 15:11:29 +0200 |
---|---|---|
committer | Tomeu Vizoso <tomeu@sugarlabs.org> | 2010-04-22 15:11:29 +0200 |
commit | 781db9e3967604e234be28f178617ed275fa60aa (patch) | |
tree | 023c6011bef17d107a7c5784f425b5c89ef473c6 /gir | |
parent | 3fd2d6c421c1e2650c6c8ca7a5acae9dd4f3459c (diff) | |
download | gobject-introspection-781db9e3967604e234be28f178617ed275fa60aa.tar.gz |
Add tests for non-gtype Enum
Diffstat (limited to 'gir')
-rw-r--r-- | gir/gimarshallingtests.c | 44 | ||||
-rw-r--r-- | gir/gimarshallingtests.h | 26 |
2 files changed, 61 insertions, 9 deletions
diff --git a/gir/gimarshallingtests.c b/gir/gimarshallingtests.c index 25ce4846..5f09633b 100644 --- a/gir/gimarshallingtests.c +++ b/gir/gimarshallingtests.c @@ -2124,23 +2124,57 @@ g_i_marshalling_tests_pointer_in_return (gpointer pointer) } GType -g_i_marshalling_tests_enum_get_type (void) +g_i_marshalling_tests_genum_get_type (void) { static GType type = 0; if (G_UNLIKELY(type == 0)) { static const GEnumValue values[] = { - { G_I_MARSHALLING_TESTS_ENUM_VALUE1, "G_I_MARSHALLING_TESTS_ENUM_VALUE1", "value1" }, - { G_I_MARSHALLING_TESTS_ENUM_VALUE2, "G_I_MARSHALLING_TESTS_ENUM_VALUE2", "value2" }, - { G_I_MARSHALLING_TESTS_ENUM_VALUE3, "G_I_MARSHALLING_TESTS_ENUM_VALUE3", "value3" }, + { G_I_MARSHALLING_TESTS_GENUM_VALUE1, "G_I_MARSHALLING_TESTS_GENUM_VALUE1", "value1" }, + { G_I_MARSHALLING_TESTS_GENUM_VALUE2, "G_I_MARSHALLING_TESTS_GENUM_VALUE2", "value2" }, + { G_I_MARSHALLING_TESTS_GENUM_VALUE3, "G_I_MARSHALLING_TESTS_GENUM_VALUE3", "value3" }, { 0, NULL, NULL } }; - type = g_enum_register_static (g_intern_static_string ("GIMarshallingTestsEnum"), values); + type = g_enum_register_static (g_intern_static_string ("GIMarshallingTestsGEnum"), values); } return type; } GIMarshallingTestsEnum +g_i_marshalling_tests_genum_return (void) +{ + return G_I_MARSHALLING_TESTS_GENUM_VALUE3; +} + +void +g_i_marshalling_tests_genum_in (GIMarshallingTestsGEnum enum_) +{ + g_assert(enum_ == G_I_MARSHALLING_TESTS_GENUM_VALUE3); +} + +/** + * g_i_marshalling_tests_genum_out: + * @enum_: (out): + */ +void +g_i_marshalling_tests_genum_out (GIMarshallingTestsGEnum *enum_) +{ + *enum_ = G_I_MARSHALLING_TESTS_GENUM_VALUE3; +} + +/** + * g_i_marshalling_tests_genum_inout: + * @enum_: (inout): + */ +void +g_i_marshalling_tests_genum_inout (GIMarshallingTestsGEnum *enum_) +{ + g_assert(*enum_ == G_I_MARSHALLING_TESTS_GENUM_VALUE3); + *enum_ = G_I_MARSHALLING_TESTS_GENUM_VALUE1; +} + + +GIMarshallingTestsEnum g_i_marshalling_tests_enum_return (void) { return G_I_MARSHALLING_TESTS_ENUM_VALUE3; diff --git a/gir/gimarshallingtests.h b/gir/gimarshallingtests.h index 998fd27b..b38c9c9c 100644 --- a/gir/gimarshallingtests.h +++ b/gir/gimarshallingtests.h @@ -378,7 +378,7 @@ void g_i_marshalling_tests_gclosure_in (GClosure *closure); gpointer g_i_marshalling_tests_pointer_in_return (gpointer pointer); -/* GEnum */ +/* Enum */ typedef enum { @@ -387,9 +387,6 @@ typedef enum G_I_MARSHALLING_TESTS_ENUM_VALUE3 = 42 } GIMarshallingTestsEnum; -GType g_i_marshalling_tests_enum_get_type (void) G_GNUC_CONST; -#define G_I_MARSHALLING_TESTS_TYPE_ENUM (g_i_marshalling_tests_enum_get_type ()) - GIMarshallingTestsEnum g_i_marshalling_tests_enum_return (void); void g_i_marshalling_tests_enum_in (GIMarshallingTestsEnum enum_); @@ -399,6 +396,27 @@ void g_i_marshalling_tests_enum_out (GIMarshallingTestsEnum *enum_); void g_i_marshalling_tests_enum_inout (GIMarshallingTestsEnum *enum_); +/* GEnum */ + +typedef enum +{ + G_I_MARSHALLING_TESTS_GENUM_VALUE1, + G_I_MARSHALLING_TESTS_GENUM_VALUE2, + G_I_MARSHALLING_TESTS_GENUM_VALUE3 = 42 +} GIMarshallingTestsGEnum; + +GType g_i_marshalling_tests_genum_get_type (void) G_GNUC_CONST; +#define G_I_MARSHALLING_TESTS_TYPE_GENUM (g_i_marshalling_tests_genum_get_type ()) + +GIMarshallingTestsEnum g_i_marshalling_tests_genum_return (void); + +void g_i_marshalling_tests_genum_in (GIMarshallingTestsGEnum enum_); + +void g_i_marshalling_tests_genum_out (GIMarshallingTestsGEnum *enum_); + +void g_i_marshalling_tests_genum_inout (GIMarshallingTestsGEnum *enum_); + + /* GFlags */ typedef enum |