[glib/wip/gcleanup: 57/78] gio/tests: Prevent random gio modules from screwing up these tests



commit 0ba5cfb80302eb0234fb18cb170fa0e7d0d1cd10
Author: Stef Walter <stefw gnome org>
Date:   Fri Nov 8 14:27:27 2013 +0100

    gio/tests: Prevent random gio modules from screwing up these tests
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711799

 gio/tests/async-splice-output-stream.c |    3 +++
 gio/tests/contexts.c                   |    3 +++
 gio/tests/converter-stream.c           |    3 +++
 gio/tests/g-file.c                     |    2 ++
 gio/tests/g-icon.c                     |    3 +++
 gio/tests/monitor.c                    |    3 +++
 gio/tests/network-monitor.c            |    3 +++
 7 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/gio/tests/async-splice-output-stream.c b/gio/tests/async-splice-output-stream.c
index e69c4db..dff6507 100644
--- a/gio/tests/async-splice-output-stream.c
+++ b/gio/tests/async-splice-output-stream.c
@@ -193,6 +193,9 @@ main (int   argc,
 {
   g_test_init (&argc, &argv, NULL);
 
+  /* gvfs leaks like a sieve (mostly on purpose) */
+  g_setenv ("GIO_MODULE_DIR", "/non-existant", TRUE);
+
   g_test_add_func ("/async-splice/copy-chunks", test_copy_chunks);
   g_test_add_func ("/async-splice/copy-chunks-threaded-input",
                    test_copy_chunks_threaded_input);
diff --git a/gio/tests/contexts.c b/gio/tests/contexts.c
index 60b3d1f..1410a62 100644
--- a/gio/tests/contexts.c
+++ b/gio/tests/contexts.c
@@ -186,6 +186,9 @@ main (int argc, char **argv)
   GError *error = NULL;
   int ret;
 
+  /* gvfs leaks like a sieve (mostly on purpose) */
+  g_setenv ("GIO_MODULE_DIR", "/non-existant", TRUE);
+
   g_test_init (&argc, &argv, NULL);
 
   test_file = g_test_build_filename (G_TEST_DIST, "contexts.c", NULL);
diff --git a/gio/tests/converter-stream.c b/gio/tests/converter-stream.c
index f2d45db..2da0513 100644
--- a/gio/tests/converter-stream.c
+++ b/gio/tests/converter-stream.c
@@ -1188,6 +1188,9 @@ main (int   argc,
 
   gint i;
 
+  /* We're testing glib, not other (leaky) stuff */
+  g_setenv ("GIO_MODULE_DIR", "/non-existant", TRUE);
+
   g_test_init (&argc, &argv, NULL);
 
   g_test_bug_base ("http://bugzilla.gnome.org/";);
diff --git a/gio/tests/g-file.c b/gio/tests/g-file.c
index 9e3a633..1c8290e 100644
--- a/gio/tests/g-file.c
+++ b/gio/tests/g-file.c
@@ -508,6 +508,8 @@ main (int   argc,
 {
   g_test_init (&argc, &argv, NULL);
   
+  /* We're testing glib, not other (leaky) stuff */
+  g_setenv ("GIO_MODULE_DIR", "/non-existant", TRUE);
   
   /*  Testing whether g_file_new_for_path() or g_file_new_for_uri() always returns non-NULL result  */
   g_test_add_func ("/g-file/test_g_file_new_null", test_g_file_new_null);
diff --git a/gio/tests/g-icon.c b/gio/tests/g-icon.c
index 598ae94..e780613 100644
--- a/gio/tests/g-icon.c
+++ b/gio/tests/g-icon.c
@@ -586,6 +586,9 @@ int
 main (int   argc,
       char *argv[])
 {
+  /* We're testing glib, not other (leaky) stuff */
+  g_setenv ("GIO_MODULE_DIR", "/non-existant", TRUE);
+
   g_test_init (&argc, &argv, NULL);
 
   g_test_add_func ("/icons/to-string", test_g_icon_to_string);
diff --git a/gio/tests/monitor.c b/gio/tests/monitor.c
index 67be3a4..d65f777 100644
--- a/gio/tests/monitor.c
+++ b/gio/tests/monitor.c
@@ -176,6 +176,9 @@ test_directory_monitor (void)
 int
 main (int argc, char *argv[])
 {
+  /* We're testing glib, not other (leaky) stuff */
+  g_setenv ("GIO_MODULE_DIR", "/non-existant", TRUE);
+
   g_test_init (&argc, &argv, NULL);
 
   g_test_add_func ("/monitor/directory", test_directory_monitor);
diff --git a/gio/tests/network-monitor.c b/gio/tests/network-monitor.c
index 618b5e0..3674f39 100644
--- a/gio/tests/network-monitor.c
+++ b/gio/tests/network-monitor.c
@@ -520,6 +520,9 @@ main (int argc, char **argv)
       return 0;
     }
 
+  /* We're testing glib, not other (leaky) stuff */
+  g_setenv ("GIO_MODULE_DIR", "/non-existant", TRUE);
+
   g_test_init (&argc, &argv, NULL);
 
   init_test (&net127);


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