diff options
Diffstat (limited to 'tests/methods')
-rw-r--r-- | tests/methods/bug781061.c-expected | 25 | ||||
-rw-r--r-- | tests/methods/parameter-out-free-on-error.c-expected | 25 | ||||
-rw-r--r-- | tests/methods/params-array-with-throws.c-expected | 27 | ||||
-rw-r--r-- | tests/methods/print-attribute.c-expected | 25 |
4 files changed, 101 insertions, 1 deletions
diff --git a/tests/methods/bug781061.c-expected b/tests/methods/bug781061.c-expected index 91d787d5e..352fa1e2f 100644 --- a/tests/methods/bug781061.c-expected +++ b/tests/methods/bug781061.c-expected @@ -2,6 +2,7 @@ * generated from methods_bug781061.vala, do not modify */ #include <glib.h> +#include <glib-object.h> #include <stdlib.h> #include <string.h> #include <stdarg.h> @@ -16,12 +17,15 @@ #endif #endif +#define TYPE_FOO_ERROR (foo_error_get_type ()) + typedef enum { FOO_ERROR_FAILED } FooError; #define FOO_ERROR foo_error_quark () VALA_EXTERN GQuark foo_error_quark (void); +GType foo_error_get_type (void) G_GNUC_CONST ; VALA_EXTERN void print_something_throws (gboolean ok, const gchar* format, GError** error, @@ -46,6 +50,27 @@ foo_error_quark (void) return g_quark_from_static_string ("foo-error-quark"); } +static GType +foo_error_get_type_once (void) +{ + static const GEnumValue values[] = {{FOO_ERROR_FAILED, "FOO_ERROR_FAILED", "failed"}, {0, NULL, NULL}}; + GType foo_error_type_id; + foo_error_type_id = g_enum_register_static ("FooError", values); + return foo_error_type_id; +} + +GType +foo_error_get_type (void) +{ + static volatile gsize foo_error_type_id__once = 0; + if (g_once_init_enter (&foo_error_type_id__once)) { + GType foo_error_type_id; + foo_error_type_id = foo_error_get_type_once (); + g_once_init_leave (&foo_error_type_id__once, foo_error_type_id); + } + return foo_error_type_id__once; +} + void print_something_throws (gboolean ok, const gchar* format, diff --git a/tests/methods/parameter-out-free-on-error.c-expected b/tests/methods/parameter-out-free-on-error.c-expected index db888bd11..18e4fcc18 100644 --- a/tests/methods/parameter-out-free-on-error.c-expected +++ b/tests/methods/parameter-out-free-on-error.c-expected @@ -14,6 +14,8 @@ #endif #endif +#define TYPE_FOO_ERROR (foo_error_get_type ()) + #define TYPE_MANAM (manam_get_type ()) #define MANAM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MANAM, Manam)) #define MANAM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MANAM, ManamClass)) @@ -39,6 +41,7 @@ typedef enum { FOO_ERROR_FAIL } FooError; #define FOO_ERROR foo_error_quark () + struct _Manam { GObject parent_instance; ManamPrivate * priv; @@ -51,6 +54,7 @@ struct _ManamClass { static gpointer manam_parent_class = NULL; VALA_EXTERN GQuark foo_error_quark (void); +GType foo_error_get_type (void) G_GNUC_CONST ; VALA_EXTERN GType manam_get_type (void) G_GNUC_CONST ; G_DEFINE_AUTOPTR_CLEANUP_FUNC (Manam, g_object_unref) VALA_EXTERN Manam* manam_new (void); @@ -70,6 +74,27 @@ foo_error_quark (void) return g_quark_from_static_string ("foo-error-quark"); } +static GType +foo_error_get_type_once (void) +{ + static const GEnumValue values[] = {{FOO_ERROR_FAIL, "FOO_ERROR_FAIL", "fail"}, {0, NULL, NULL}}; + GType foo_error_type_id; + foo_error_type_id = g_enum_register_static ("FooError", values); + return foo_error_type_id; +} + +GType +foo_error_get_type (void) +{ + static volatile gsize foo_error_type_id__once = 0; + if (g_once_init_enter (&foo_error_type_id__once)) { + GType foo_error_type_id; + foo_error_type_id = foo_error_get_type_once (); + g_once_init_leave (&foo_error_type_id__once, foo_error_type_id); + } + return foo_error_type_id__once; +} + Manam* manam_construct (GType object_type) { diff --git a/tests/methods/params-array-with-throws.c-expected b/tests/methods/params-array-with-throws.c-expected index a456b3329..0d25797cc 100644 --- a/tests/methods/params-array-with-throws.c-expected +++ b/tests/methods/params-array-with-throws.c-expected @@ -2,9 +2,9 @@ * generated from methods_params_array_with_throws.vala, do not modify */ #include <glib.h> +#include <glib-object.h> #include <stdlib.h> #include <string.h> -#include <glib-object.h> #include <gobject/gvaluecollector.h> #if !defined(VALA_EXTERN) @@ -17,6 +17,8 @@ #endif #endif +#define TYPE_FOO_ERROR (foo_error_get_type ()) + #define TYPE_FOO (foo_get_type ()) #define FOO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FOO, Foo)) #define FOO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FOO, FooClass)) @@ -39,6 +41,7 @@ typedef enum { FOO_ERROR_WORSE } FooError; #define FOO_ERROR foo_error_quark () + struct _Foo { GTypeInstance parent_instance; volatile int ref_count; @@ -57,6 +60,7 @@ struct _ParamSpecFoo { static gpointer foo_parent_class = NULL; VALA_EXTERN GQuark foo_error_quark (void); +GType foo_error_get_type (void) G_GNUC_CONST ; VALA_EXTERN void foo (GError** error, const gchar* _first_array, ...); @@ -113,6 +117,27 @@ foo_error_quark (void) return g_quark_from_static_string ("foo-error-quark"); } +static GType +foo_error_get_type_once (void) +{ + static const GEnumValue values[] = {{FOO_ERROR_BAD, "FOO_ERROR_BAD", "bad"}, {FOO_ERROR_WORSE, "FOO_ERROR_WORSE", "worse"}, {0, NULL, NULL}}; + GType foo_error_type_id; + foo_error_type_id = g_enum_register_static ("FooError", values); + return foo_error_type_id; +} + +GType +foo_error_get_type (void) +{ + static volatile gsize foo_error_type_id__once = 0; + if (g_once_init_enter (&foo_error_type_id__once)) { + GType foo_error_type_id; + foo_error_type_id = foo_error_get_type_once (); + g_once_init_leave (&foo_error_type_id__once, foo_error_type_id); + } + return foo_error_type_id__once; +} + static void _vala_array_add1 (const gchar** * array, gint* length, diff --git a/tests/methods/print-attribute.c-expected b/tests/methods/print-attribute.c-expected index bd627c809..d3b9ae59e 100644 --- a/tests/methods/print-attribute.c-expected +++ b/tests/methods/print-attribute.c-expected @@ -17,6 +17,8 @@ #endif #endif +#define TYPE_FOO_ERROR (foo_error_get_type ()) + #define TYPE_FOO (foo_get_type ()) #define FOO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FOO, Foo)) #define FOO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FOO, FooClass)) @@ -39,6 +41,7 @@ typedef enum { FOO_ERROR_FAIL } FooError; #define FOO_ERROR foo_error_quark () + struct _Foo { GTypeInstance parent_instance; volatile int ref_count; @@ -57,6 +60,7 @@ struct _ParamSpecFoo { static gpointer foo_parent_class = NULL; VALA_EXTERN GQuark foo_error_quark (void); +GType foo_error_get_type (void) G_GNUC_CONST ; VALA_EXTERN gpointer foo_ref (gpointer instance); VALA_EXTERN void foo_unref (gpointer instance); VALA_EXTERN GParamSpec* param_spec_foo (const gchar* name, @@ -88,6 +92,27 @@ foo_error_quark (void) return g_quark_from_static_string ("foo-error-quark"); } +static GType +foo_error_get_type_once (void) +{ + static const GEnumValue values[] = {{FOO_ERROR_FAIL, "FOO_ERROR_FAIL", "fail"}, {0, NULL, NULL}}; + GType foo_error_type_id; + foo_error_type_id = g_enum_register_static ("FooError", values); + return foo_error_type_id; +} + +GType +foo_error_get_type (void) +{ + static volatile gsize foo_error_type_id__once = 0; + if (g_once_init_enter (&foo_error_type_id__once)) { + GType foo_error_type_id; + foo_error_type_id = foo_error_get_type_once (); + g_once_init_leave (&foo_error_type_id__once, foo_error_type_id); + } + return foo_error_type_id__once; +} + void foo_foo (Foo* self, const gchar* s) |