Predeclare more things in tests

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=687441
Reviewed-by: Colin Walters <walters@verbum.org>
This commit is contained in:
Simon McVittie 2012-11-02 15:19:20 +00:00
parent 85976cf91d
commit eb7dc2bcc6
8 changed files with 27 additions and 6 deletions

View File

@ -86,7 +86,7 @@ test_signal1_accumulator (GSignalInvocationHint *ihint,
return TRUE;
}
gchar*
static gchar *
test_object_signal1_callback_before (TestObject *tobject,
gint param,
gpointer data)
@ -94,14 +94,14 @@ test_object_signal1_callback_before (TestObject *tobject,
return g_strdup ("<before>");
}
gchar*
static gchar *
test_object_real_signal1 (TestObject *tobject,
gint param)
{
return g_strdup ("<default>");
}
gchar*
static gchar *
test_object_signal1_callback_after (TestObject *tobject,
gint param,
gpointer data)
@ -109,7 +109,7 @@ test_object_signal1_callback_after (TestObject *tobject,
return g_strdup ("<after>");
}
gboolean
static gboolean
test_object_signal2_callback_before (TestObject *tobject,
gint param)
{
@ -125,7 +125,7 @@ test_object_signal2_callback_before (TestObject *tobject,
return FALSE;
}
gboolean
static gboolean
test_object_real_signal2 (TestObject *tobject,
gint param)
{
@ -141,7 +141,7 @@ test_object_real_signal2 (TestObject *tobject,
return FALSE;
}
gboolean
static gboolean
test_object_signal2_callback_after (TestObject *tobject,
gint param)
{

View File

@ -48,6 +48,7 @@ struct _TestStaticIfaceClass
guint val;
};
GType test_static_iface_get_type (void);
#define TEST_TYPE_STATIC_IFACE (test_static_iface_get_type ())
static void

View File

@ -42,6 +42,8 @@ typedef struct _TypeNameClass {
GObjectClass parent_parent;
} TypeNameClass;
GType type_name_get_type (void);
MY_DEFINE_TYPE (TypeName, type_name, G_TYPE_OBJECT)
static void type_name_init (TypeName *self)

View File

@ -40,6 +40,7 @@ struct _TestIfaceClass
guint val;
};
static GType test_iface_get_type (void);
#define TEST_TYPE_IFACE (test_iface_get_type ())
#define TEST_IFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TEST_TYPE_IFACE, TestIfaceClass))
typedef struct _TestIface TestIface;
@ -61,6 +62,7 @@ test_iface_base_init (TestIfaceClass *iface)
{
}
GType dynamic_object_get_type (void);
#define DYNAMIC_OBJECT_TYPE (dynamic_object_get_type ())
typedef GObject DynamicObject;

View File

@ -99,6 +99,12 @@ struct _TestIfaceClass
guint val;
};
static GType test_iface1_get_type (void);
static GType test_iface2_get_type (void);
static GType test_iface3_get_type (void);
static GType test_iface4_get_type (void);
static GType test_iface5_get_type (void);
#define TEST_TYPE_IFACE1 (test_iface1_get_type ())
#define TEST_TYPE_IFACE2 (test_iface2_get_type ())
#define TEST_TYPE_IFACE3 (test_iface3_get_type ())

View File

@ -150,6 +150,7 @@ run_test (PerformanceTest *test)
* with no properties, no signals, implementing no interfaces
*************************************************************/
static GType simple_object_get_type (void);
#define SIMPLE_TYPE_OBJECT (simple_object_get_type ())
typedef struct _SimpleObject SimpleObject;
typedef struct _SimpleObjectClass SimpleObjectClass;
@ -201,6 +202,12 @@ struct _TestIfaceClass
void (*method) (TestIface *obj);
};
static GType test_iface1_get_type (void);
static GType test_iface2_get_type (void);
static GType test_iface3_get_type (void);
static GType test_iface4_get_type (void);
static GType test_iface5_get_type (void);
#define TEST_TYPE_IFACE1 (test_iface1_get_type ())
#define TEST_TYPE_IFACE2 (test_iface2_get_type ())
#define TEST_TYPE_IFACE3 (test_iface3_get_type ())
@ -218,6 +225,7 @@ static DEFINE_IFACE (TestIface5, test_iface5, NULL, NULL)
* construct properties, signals and implementing an interface.
*************************************************************/
static GType complex_object_get_type (void);
#define COMPLEX_TYPE_OBJECT (complex_object_get_type ())
typedef struct _ComplexObject ComplexObject;
typedef struct _ComplexObjectClass ComplexObjectClass;

View File

@ -44,6 +44,7 @@ static gboolean toggle_ref3_strengthened;
/*
* TestObject, a parent class for TestObject
*/
static GType test_object_get_type (void);
#define TEST_TYPE_OBJECT (test_object_get_type ())
typedef struct _TestObject TestObject;
typedef struct _TestObjectClass TestObjectClass;

View File

@ -29,6 +29,7 @@ typedef struct {
GObjectClass parent_class;
} MySingletonClass;
static GType my_singleton_get_type (void);
#define MY_TYPE_SINGLETON (my_singleton_get_type ())
#define MY_SINGLETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MY_TYPE_SINGLETON, MySingleton))
#define MY_IS_SINGLETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MY_TYPE_SINGLETON))