[folks/folks-0-10] tests: Fix EDS set-avatar test



commit 5627e89639e78cf7ae33dc7ae9e3e1f50c9cab25
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Thu Jan 22 17:32:02 2015 +0000

    tests: Fix EDS set-avatar test
    
    The same address book database was being re-used between unit tests,
    causing the second one to fail with a duplicate contact UID.

 tests/eds/set-avatar.vala |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/tests/eds/set-avatar.vala b/tests/eds/set-avatar.vala
index e317e2f..9afba0e 100644
--- a/tests/eds/set-avatar.vala
+++ b/tests/eds/set-avatar.vala
@@ -39,6 +39,15 @@ public class SetAvatarTests : EdsTest.TestCase
           this.test_set_individual_avatar);
     }
 
+  private uint _test_num = 0;
+
+  public override void create_backend ()
+    {
+      /* Use a unique EDS book for each test. */
+      this.eds_backend = new EdsTest.Backend ();
+      ((!) this.eds_backend).set_up (true, "test%u".printf (this._test_num++));
+    }
+
   void test_set_avatar ()
     {
       Gee.HashMap<string, Value?> c1 = new Gee.HashMap<string, Value?> ();


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