From 3e7a2cfda32d2a0b84aae899b00bed4199a58ad4 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Sun, 10 Nov 2013 16:51:02 +0100 Subject: [PATCH] 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 deletion(-) diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am index 5ac09d17d..4fe17835f 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 2da0513a5..3e978db5b 100644 --- a/gio/tests/converter-stream.c +++ b/gio/tests/converter-stream.c @@ -25,6 +25,8 @@ #include #include +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 769842976..325c2ce04 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 dc25e9540..51e3b0a7b 100644 --- a/gio/tests/gapplication-example-cmdline2.c +++ b/gio/tests/gapplication-example-cmdline2.c @@ -2,6 +2,8 @@ #include #include +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 e93cf0848..d5ab723a1 100644 --- a/gio/tests/gapplication-example-dbushooks.c +++ b/gio/tests/gapplication-example-dbushooks.c @@ -2,6 +2,8 @@ #include #include +G_CLEANUP_DEFINE; + static void activate (GApplication *application) { diff --git a/gio/tests/gapplication.c b/gio/tests/gapplication.c index b6f911e5a..7a38a4995 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 d3d8cacbd..ab2f0b7d5 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 a707e085a..5ee0a8376 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 b331e4b14..9d86fca73 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 a33269916..1dd03288e 100644 --- a/gio/tests/gdbus-daemon.c +++ b/gio/tests/gdbus-daemon.c @@ -3,6 +3,8 @@ #include "gdbusdaemon.h" #include +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 341ce60d3..5bb74d055 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 fb1a52879..5a8329872 100644 --- a/gio/tests/gdbus-example-proxy-subclass.c +++ b/gio/tests/gdbus-example-proxy-subclass.c @@ -1,6 +1,8 @@ #include +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 b28d9bde3..d50aeb571 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 7a19c7115..031b43d48 100644 --- a/gio/tests/gdbus-peer-object-manager.c +++ b/gio/tests/gdbus-peer-object-manager.c @@ -30,6 +30,8 @@ #include #include +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 d4d9c3602..ad2476c21 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 75c70cd6e..45be2a99a 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 18156d645..2b5ffd7b1 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 7e1ed49de..22e9e5154 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 59b1c2669..94ba5768c 100644 --- a/gio/tests/io-stream.c +++ b/gio/tests/io-stream.c @@ -25,6 +25,8 @@ #include #include +G_CLEANUP_DEFINE; + typedef struct { GIOStream parent; diff --git a/gio/tests/proxy-test.c b/gio/tests/proxy-test.c index ad2fcdf45..126720b5e 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 4d3ca1d27..68fd17f36 100644 --- a/gio/tests/sleepy-stream.c +++ b/gio/tests/sleepy-stream.c @@ -14,6 +14,8 @@ #include #include +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 07303cad6..02458c813 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 ce2aa88c8..95e86ce39 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 {