summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@sugarlabs.org>2010-04-22 14:57:35 +0200
committerTomeu Vizoso <tomeu@sugarlabs.org>2010-04-22 14:57:35 +0200
commit456d649e95131819c872f459fe1901fe5aa15fc8 (patch)
tree14591c0c340391e2a622235b019e1b60e5738c04
parent77e818f218b91310cfc5a092755594bd839ea24d (diff)
downloadgobject-introspection-456d649e95131819c872f459fe1901fe5aa15fc8.tar.gz
Add tests for GAsyncReadyCallback
-rw-r--r--gir/Makefile.am4
-rw-r--r--gir/everything.c9
-rw-r--r--gir/everything.h3
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 <string.h>
#include <stdlib.h>
#include "everything.h"
-#include <gio/gio.h>
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 <cairo/cairo.h>
#include <glib-object.h>
+#include <gio/gio.h>
#include <time.h>
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))