[gobject-introspection] Add tests for GAsyncReadyCallback



commit 456d649e95131819c872f459fe1901fe5aa15fc8
Author: Tomeu Vizoso <tomeu sugarlabs org>
Date:   Thu Apr 22 14:57:35 2010 +0200

    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 0c6a2af..e22ea1c 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 8ebac9e..b4cfc75 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 75cee29..63b2ec1 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))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]