From 456d649e95131819c872f459fe1901fe5aa15fc8 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Thu, 22 Apr 2010 14:57:35 +0200 Subject: Add tests for GAsyncReadyCallback --- gir/Makefile.am | 4 ++-- gir/everything.c | 9 ++++++++- gir/everything.h | 3 +++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gir/Makefile.am b/gir/Makefile.am index 0c6a2aff..e22ea1c9 100644 --- a/gir/Makefile.am +++ b/gir/Makefile.am @@ -172,8 +172,8 @@ if BUILD_TESTS Everything-1.0.gir: Gio-2.0.gir libgirepository-everything-1.0.la Everything_1_0_gir_LIBS = libgirepository-everything-1.0.la -Everything_1_0_gir_PACKAGES = gobject-2.0 cairo -Everything_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0 +Everything_1_0_gir_PACKAGES = gobject-2.0 cairo gio-2.0 +Everything_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0 Gio-2.0 Everything_1_0_gir_FILES = $(srcdir)/everything.h $(srcdir)/everything.c if HAVE_CAIRO diff --git a/gir/everything.c b/gir/everything.c index 8ebac9e4..b4cfc759 100644 --- a/gir/everything.c +++ b/gir/everything.c @@ -1,7 +1,6 @@ #include #include #include "everything.h" -#include static gboolean abort_on_error = TRUE; @@ -1997,6 +1996,14 @@ test_callback_infinite (TestCallbackUserData callback, return callback(user_data); } +void +test_async_ready_callback (GAsyncReadyCallback callback) +{ + GSimpleAsyncResult *result = g_simple_async_result_new (NULL, callback, NULL, + test_async_ready_callback); + g_simple_async_result_complete_in_idle (result); +} + /* interface */ static void diff --git a/gir/everything.h b/gir/everything.h index 75cee29e..63b2ec1e 100644 --- a/gir/everything.h +++ b/gir/everything.h @@ -3,6 +3,7 @@ #include #include +#include #include void set_abort_on_error (gboolean abort_on_error); @@ -349,6 +350,8 @@ int test_callback_thaw_async (void); int test_callback_infinite (TestCallbackUserData callback, gpointer user_data); +void test_async_ready_callback (GAsyncReadyCallback callback); + /* interface */ #define TEST_TYPE_INTERFACE (test_interface_get_type ()) #define TEST_INTERFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TEST_TYPE_INTERFACE, TestInterface)) -- cgit v1.2.1