[folks] Don't use an extraneous main loop and watchdog for all tests.



commit 6731c20374281ac3b2502bf9c97f5f1f13e321cb
Author: Travis Reitter <travis reitter collabora co uk>
Date:   Mon Nov 1 17:48:19 2010 -0700

    Don't use an extraneous main loop and watchdog for all tests.

 tests/telepathy/individual-properties.vala      |   12 ------------
 tests/telepathy/individual-retrieval.vala       |   19 +++++++------------
 tests/telepathy/persona-store-capabilities.vala |   12 ------------
 3 files changed, 7 insertions(+), 36 deletions(-)
---
diff --git a/tests/telepathy/individual-properties.vala b/tests/telepathy/individual-properties.vala
index 2572591..a72cd5f 100644
--- a/tests/telepathy/individual-properties.vala
+++ b/tests/telepathy/individual-properties.vala
@@ -8,7 +8,6 @@ using Gee;
 public class IndividualPropertiesTests : Folks.TestCase
 {
   private TpTest.Backend tp_backend;
-  private MainLoop main_loop;
   private string individual_id_prefix = "telepathy:protocol:";
 
   public IndividualPropertiesTests ()
@@ -27,23 +26,12 @@ public class IndividualPropertiesTests : Folks.TestCase
 
   public override void set_up ()
     {
-      this.main_loop = new GLib.MainLoop (null, false);
       this.tp_backend.set_up ();
     }
 
   public override void tear_down ()
     {
       this.tp_backend.tear_down ();
-
-      Timeout.add_seconds (5, () =>
-        {
-          this.main_loop.quit ();
-          this.main_loop = null;
-          return false;
-        });
-
-      /* Run the main loop to process the carnage and destruction */
-      this.main_loop.run ();
     }
 
   public void test_individual_properties ()
diff --git a/tests/telepathy/individual-retrieval.vala b/tests/telepathy/individual-retrieval.vala
index 9417941..9dcae66 100644
--- a/tests/telepathy/individual-retrieval.vala
+++ b/tests/telepathy/individual-retrieval.vala
@@ -8,7 +8,6 @@ using Gee;
 public class IndividualRetrievalTests : Folks.TestCase
 {
   private TpTest.Backend tp_backend;
-  private MainLoop main_loop;
   private HashSet<string> default_individuals;
   private string individual_id_prefix = "telepathy:protocol:";
 
@@ -37,7 +36,13 @@ public class IndividualRetrievalTests : Folks.TestCase
 
   public override void set_up ()
     {
-      this.main_loop = new GLib.MainLoop (null, false);
+      /* Disable the key-file backend so it doesn't interfere with the tests */
+      BackendStore store = BackendStore.dup ();
+      store.prepare.begin ((o, r) =>
+        {
+          store.prepare.end (r);
+          store.disable_backend.begin ("key-file");
+        });
 
       this.tp_backend.set_up ();
     }
@@ -45,16 +50,6 @@ public class IndividualRetrievalTests : Folks.TestCase
   public override void tear_down ()
     {
       this.tp_backend.tear_down ();
-
-      Timeout.add_seconds (5, () =>
-        {
-          this.main_loop.quit ();
-          this.main_loop = null;
-          return false;
-        });
-
-      /* Run the main loop to process the carnage and destruction */
-      this.main_loop.run ();
     }
 
   public void test_aggregator ()
diff --git a/tests/telepathy/persona-store-capabilities.vala b/tests/telepathy/persona-store-capabilities.vala
index 61e6d53..2599679 100644
--- a/tests/telepathy/persona-store-capabilities.vala
+++ b/tests/telepathy/persona-store-capabilities.vala
@@ -8,7 +8,6 @@ using Gee;
 public class PersonaStoreCapabilitiesTests : Folks.TestCase
 {
   private TpTest.Backend tp_backend;
-  private MainLoop main_loop;
   private HashSet<string> group_flags_received;
 
   public PersonaStoreCapabilitiesTests ()
@@ -25,23 +24,12 @@ public class PersonaStoreCapabilitiesTests : Folks.TestCase
     {
       this.group_flags_received = new HashSet<string> (str_hash, str_equal);
 
-      this.main_loop = new GLib.MainLoop (null, false);
       this.tp_backend.set_up ();
     }
 
   public override void tear_down ()
     {
       this.tp_backend.tear_down ();
-
-      Timeout.add_seconds (5, () =>
-        {
-          this.main_loop.quit ();
-          this.main_loop = null;
-          return false;
-        });
-
-      /* Run the main loop to process the carnage and destruction */
-      this.main_loop.run ();
     }
 
   public void test_persona_store_capabilities ()



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