[glib/wip/gcleanup: 25/42] gio: Define cleanup scope and lists for gio tests



commit 3e7a2cfda32d2a0b84aae899b00bed4199a58ad4
Author: Stef Walter <stefw gnome org>
Date:   Sun Nov 10 16:51:02 2013 +0100

    gio: Define cleanup scope and lists for gio tests
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711799

 gio/tests/Makefile.am                      |    2 +-
 gio/tests/converter-stream.c               |    2 ++
 gio/tests/dbus-appinfo.c                   |    2 ++
 gio/tests/gapplication-example-cmdline2.c  |    2 ++
 gio/tests/gapplication-example-dbushooks.c |    2 ++
 gio/tests/gapplication.c                   |    2 ++
 gio/tests/gdbus-bz627724.c                 |    2 ++
 gio/tests/gdbus-close-pending.c            |    2 ++
 gio/tests/gdbus-connection-flush.c         |    2 ++
 gio/tests/gdbus-daemon.c                   |    2 ++
 gio/tests/gdbus-example-export.c           |    2 ++
 gio/tests/gdbus-example-proxy-subclass.c   |    2 ++
 gio/tests/gdbus-non-socket.c               |    2 ++
 gio/tests/gdbus-peer-object-manager.c      |    2 ++
 gio/tests/gdbus-test-codegen.c             |    2 ++
 gio/tests/gmenumodel.c                     |    2 ++
 gio/tests/gsettings.c                      |    2 ++
 gio/tests/gtlsconsoleinteraction.c         |    2 ++
 gio/tests/io-stream.c                      |    2 ++
 gio/tests/proxy-test.c                     |    2 ++
 gio/tests/sleepy-stream.c                  |    2 ++
 gio/tests/tls-certificate.c                |    2 ++
 gio/tests/tls-interaction.c                |    2 ++
 23 files changed, 45 insertions(+), 1 deletions(-)
---
diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am
index 5ac09d1..4fe1783 100644
--- a/gio/tests/Makefile.am
+++ b/gio/tests/Makefile.am
@@ -11,7 +11,7 @@ LDADD = \
        $(top_builddir)/gmodule/libgmodule-2.0.la       \
        $(top_builddir)/gio/libgio-2.0.la
 AM_CPPFLAGS = $(gio_INCLUDES) $(GLIB_DEBUG_FLAGS) -I$(top_builddir)/gio -I$(top_srcdir)/gio
-DEFS = -DG_LOG_DOMAIN=\"GLib-GIO\" -DTEST_SERVICES=\""$(abs_top_builddir)/gio/tests/services"\"
+DEFS = -DG_LOG_DOMAIN=\"GLib-GIO\" -DTEST_SERVICES=\""$(abs_top_builddir)/gio/tests/services"\" 
-DG_CLEANUP_SCOPE=gio_tests_cleanup
 AM_CFLAGS = $(GLIB_WARN_CFLAGS)
 
 # -----------------------------------------------------------------------------
diff --git a/gio/tests/converter-stream.c b/gio/tests/converter-stream.c
index 2da0513..3e978db 100644
--- a/gio/tests/converter-stream.c
+++ b/gio/tests/converter-stream.c
@@ -25,6 +25,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+G_CLEANUP_DEFINE;
+
 #define G_TYPE_EXPANDER_CONVERTER         (g_expander_converter_get_type ())
 #define G_EXPANDER_CONVERTER(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_EXPANDER_CONVERTER, 
GExpanderConverter))
 #define G_EXPANDER_CONVERTER_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_EXPANDER_CONVERTER, 
GExpanderConverterClass))
diff --git a/gio/tests/dbus-appinfo.c b/gio/tests/dbus-appinfo.c
index 7698429..325c2ce 100644
--- a/gio/tests/dbus-appinfo.c
+++ b/gio/tests/dbus-appinfo.c
@@ -24,6 +24,8 @@
 
 #include "gdbus-sessionbus.h"
 
+G_CLEANUP_DEFINE;
+
 static GDesktopAppInfo *appinfo;
 static int current_state;
 static gboolean saw_startup_id;
diff --git a/gio/tests/gapplication-example-cmdline2.c b/gio/tests/gapplication-example-cmdline2.c
index dc25e95..51e3b0a 100644
--- a/gio/tests/gapplication-example-cmdline2.c
+++ b/gio/tests/gapplication-example-cmdline2.c
@@ -2,6 +2,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+G_CLEANUP_DEFINE;
+
 static int
 command_line (GApplication            *application,
               GApplicationCommandLine *cmdline)
diff --git a/gio/tests/gapplication-example-dbushooks.c b/gio/tests/gapplication-example-dbushooks.c
index e93cf08..d5ab723 100644
--- a/gio/tests/gapplication-example-dbushooks.c
+++ b/gio/tests/gapplication-example-dbushooks.c
@@ -2,6 +2,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+G_CLEANUP_DEFINE;
+
 static void
 activate (GApplication *application)
 {
diff --git a/gio/tests/gapplication.c b/gio/tests/gapplication.c
index b6f911e..7a38a49 100644
--- a/gio/tests/gapplication.c
+++ b/gio/tests/gapplication.c
@@ -6,6 +6,8 @@
 #include "gdbus-tests.h"
 #include "gdbus-sessionbus.h"
 
+G_CLEANUP_DEFINE;
+
 static gint outstanding_watches;
 static GMainLoop *main_loop;
 
diff --git a/gio/tests/gdbus-bz627724.c b/gio/tests/gdbus-bz627724.c
index d3d8cac..ab2f0b7 100644
--- a/gio/tests/gdbus-bz627724.c
+++ b/gio/tests/gdbus-bz627724.c
@@ -26,6 +26,8 @@
 
 #include "gdbus-tests.h"
 
+G_CLEANUP_DEFINE;
+
 static GDBusConnection *the_connection = NULL;
 
 #define MY_TYPE_OBJECT   (my_object_get_type ())
diff --git a/gio/tests/gdbus-close-pending.c b/gio/tests/gdbus-close-pending.c
index a707e08..5ee0a83 100644
--- a/gio/tests/gdbus-close-pending.c
+++ b/gio/tests/gdbus-close-pending.c
@@ -41,6 +41,8 @@
 
 #include "gdbus-tests.h"
 
+G_CLEANUP_DEFINE;
+
 #define CLOSE_TIME_MS 1
 #define N_REPEATS_SLOW 5000
 #define N_REPEATS 100
diff --git a/gio/tests/gdbus-connection-flush.c b/gio/tests/gdbus-connection-flush.c
index b331e4b..9d86fca 100644
--- a/gio/tests/gdbus-connection-flush.c
+++ b/gio/tests/gdbus-connection-flush.c
@@ -31,6 +31,8 @@
 #include "test-io-stream.h"
 #include "test-pipe-unix.h"
 
+G_CLEANUP_DEFINE;
+
 #define MY_TYPE_OUTPUT_STREAM \
         (my_output_stream_get_type ())
 #define MY_OUTPUT_STREAM(o) \
diff --git a/gio/tests/gdbus-daemon.c b/gio/tests/gdbus-daemon.c
index a332699..1dd0328 100644
--- a/gio/tests/gdbus-daemon.c
+++ b/gio/tests/gdbus-daemon.c
@@ -3,6 +3,8 @@
 #include "gdbusdaemon.h"
 #include <glib/gi18n.h>
 
+G_CLEANUP_DEFINE;
+
 int
 main (int argc, char *argv[])
 {
diff --git a/gio/tests/gdbus-example-export.c b/gio/tests/gdbus-example-export.c
index 341ce60..5bb74d0 100644
--- a/gio/tests/gdbus-example-export.c
+++ b/gio/tests/gdbus-example-export.c
@@ -3,6 +3,8 @@
 
 /* ---------------------------------------------------------------------------------------------------- */
 
+G_CLEANUP_DEFINE;
+
 /* The object we want to export */
 typedef struct _MyObjectClass MyObjectClass;
 typedef struct _MyObject MyObject;
diff --git a/gio/tests/gdbus-example-proxy-subclass.c b/gio/tests/gdbus-example-proxy-subclass.c
index fb1a528..5a83298 100644
--- a/gio/tests/gdbus-example-proxy-subclass.c
+++ b/gio/tests/gdbus-example-proxy-subclass.c
@@ -1,6 +1,8 @@
 
 #include <gio/gio.h>
 
+G_CLEANUP_DEFINE;
+
 /* ---------------------------------------------------------------------------------------------------- */
 /* The D-Bus interface definition we want to create a GDBusProxy-derived type for: */
 /* ---------------------------------------------------------------------------------------------------- */
diff --git a/gio/tests/gdbus-non-socket.c b/gio/tests/gdbus-non-socket.c
index b28d9bd..d50aeb5 100644
--- a/gio/tests/gdbus-non-socket.c
+++ b/gio/tests/gdbus-non-socket.c
@@ -34,6 +34,8 @@
 
 #include "gdbus-tests.h"
 
+G_CLEANUP_DEFINE;
+
 static GMainLoop *loop = NULL;
 
 /* ---------------------------------------------------------------------------------------------------- */
diff --git a/gio/tests/gdbus-peer-object-manager.c b/gio/tests/gdbus-peer-object-manager.c
index 7a19c71..031b43d 100644
--- a/gio/tests/gdbus-peer-object-manager.c
+++ b/gio/tests/gdbus-peer-object-manager.c
@@ -30,6 +30,8 @@
 #include <string.h>
 #include <unistd.h>
 
+G_CLEANUP_DEFINE;
+
 typedef struct {
   GDBusInterfaceSkeleton parent;
   gint number;
diff --git a/gio/tests/gdbus-test-codegen.c b/gio/tests/gdbus-test-codegen.c
index d4d9c36..ad2476c 100644
--- a/gio/tests/gdbus-test-codegen.c
+++ b/gio/tests/gdbus-test-codegen.c
@@ -29,6 +29,8 @@
 
 #include "gdbus-test-codegen-generated.h"
 
+G_CLEANUP_DEFINE;
+
 /* ---------------------------------------------------------------------------------------------------- */
 
 static guint
diff --git a/gio/tests/gmenumodel.c b/gio/tests/gmenumodel.c
index 75c70cd..45be2a9 100644
--- a/gio/tests/gmenumodel.c
+++ b/gio/tests/gmenumodel.c
@@ -2,6 +2,8 @@
 
 #include "gdbus-sessionbus.h"
 
+G_CLEANUP_DEFINE;
+
 /* Markup printing {{{1 */
 
 /* This used to be part of GLib, but it was removed before the stable
diff --git a/gio/tests/gsettings.c b/gio/tests/gsettings.c
index 18156d6..2b5ffd7 100644
--- a/gio/tests/gsettings.c
+++ b/gio/tests/gsettings.c
@@ -8,6 +8,8 @@
 
 #include "testenum.h"
 
+G_CLEANUP_DEFINE;
+
 static gboolean backend_set;
 
 /* These tests rely on the schemas in org.gtk.test.gschema.xml
diff --git a/gio/tests/gtlsconsoleinteraction.c b/gio/tests/gtlsconsoleinteraction.c
index 7e1ed49..22e9e51 100644
--- a/gio/tests/gtlsconsoleinteraction.c
+++ b/gio/tests/gtlsconsoleinteraction.c
@@ -32,6 +32,8 @@
 
 #include "gtlsconsoleinteraction.h"
 
+G_CLEANUP_DEFINE;
+
 /*
  * WARNING: This is not the example you're looking for [slow hand wave]. This
  * is not industrial strength, it's just for testing. It uses embarassing
diff --git a/gio/tests/io-stream.c b/gio/tests/io-stream.c
index 59b1c26..94ba576 100644
--- a/gio/tests/io-stream.c
+++ b/gio/tests/io-stream.c
@@ -25,6 +25,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+G_CLEANUP_DEFINE;
+
 typedef struct
 {
   GIOStream parent;
diff --git a/gio/tests/proxy-test.c b/gio/tests/proxy-test.c
index ad2fcdf..126720b 100644
--- a/gio/tests/proxy-test.c
+++ b/gio/tests/proxy-test.c
@@ -48,6 +48,8 @@
  * (GTestAltProxyResolver) always returns [ proxy_a.uri ].
  */
 
+G_CLEANUP_DEFINE;
+
 typedef struct {
   gchar *proxy_command;
   gchar *supported_protocol;
diff --git a/gio/tests/sleepy-stream.c b/gio/tests/sleepy-stream.c
index 4d3ca1d..68fd17f 100644
--- a/gio/tests/sleepy-stream.c
+++ b/gio/tests/sleepy-stream.c
@@ -14,6 +14,8 @@
 #include <gio/gio.h>
 #include <string.h>
 
+G_CLEANUP_DEFINE;
+
 #define MAX_PIECE_SIZE  100
 #define MAX_PIECES       60
 
diff --git a/gio/tests/tls-certificate.c b/gio/tests/tls-certificate.c
index 07303ca..02458c8 100644
--- a/gio/tests/tls-certificate.c
+++ b/gio/tests/tls-certificate.c
@@ -26,6 +26,8 @@
 
 #include "gtesttlsbackend.h"
 
+G_CLEANUP_DEFINE;
+
 typedef struct
 {
   gchar *cert_pems[3];
diff --git a/gio/tests/tls-interaction.c b/gio/tests/tls-interaction.c
index ce2aa88..95e86ce 100644
--- a/gio/tests/tls-interaction.c
+++ b/gio/tests/tls-interaction.c
@@ -26,6 +26,8 @@
 
 #include "gtesttlsbackend.h"
 
+G_CLEANUP_DEFINE;
+
 static GPtrArray *fixtures = NULL;
 
 typedef struct {


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