[folks] dummy: Fix dummy test cases to allow more than one test to run



commit 7ee8118248cdd393797a282acfcaed45ed9bc336
Author: Renato Araujo Oliveira Filho <renato filho canonical com>
Date:   Thu Apr 3 10:08:12 2014 -0300

    dummy: Fix dummy test cases to allow more than one test to run
    
    https://bugzilla.gnome.org/show_bug.cgi?id=727405

 tests/dummy/individual-retrieval.vala |    4 +++-
 tests/lib/dummy/test-case.vala        |    4 ++++
 2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/tests/dummy/individual-retrieval.vala b/tests/dummy/individual-retrieval.vala
index cb6cd50..749a53f 100644
--- a/tests/dummy/individual-retrieval.vala
+++ b/tests/dummy/individual-retrieval.vala
@@ -115,7 +115,7 @@ public class IndividualRetrievalTests : DummyTest.TestCase
 
       /* Set up the aggregator */
       var aggregator = IndividualAggregator.dup ();
-      aggregator.individuals_changed_detailed.connect ((changes) =>
+      ulong handler_id = aggregator.individuals_changed_detailed.connect ((changes) =>
         {
           var added = changes.get_values ();
           var removed = changes.get_keys ();
@@ -160,6 +160,8 @@ public class IndividualRetrievalTests : DummyTest.TestCase
 
       /* We should have enumerated exactly the individuals in the set */
       assert (expected_individuals.size == 0);
+      aggregator.disconnect(handler_id);
+      aggregator = null;
     }
 }
 
diff --git a/tests/lib/dummy/test-case.vala b/tests/lib/dummy/test-case.vala
index 43ea8b2..c5e7ebe 100644
--- a/tests/lib/dummy/test-case.vala
+++ b/tests/lib/dummy/test-case.vala
@@ -133,6 +133,10 @@ public class DummyTest.TestCase : Folks.TestCase
    */
   public override void tear_down ()
     {
+      var persona_stores = new HashSet<PersonaStore> ();
+      persona_stores.add (this.dummy_persona_store);
+      this.dummy_backend.unregister_persona_stores (persona_stores);
+
       this.dummy_persona_store = null;
       this.dummy_backend = null;
       this._backend_store = null;


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