-g \
$(NULL)
-# FIXME: these tests have been removed temporarily due to bgo#668415
-# store-removed \
-# change-primary-store \
-# $(NULL)
-
# in order from least to most complex
noinst_PROGRAMS = \
persona-store-tests \
set-roles \
linkable-properties \
link-personas-diff-stores \
+ store-removed \
anti-linking \
enable-disable-stores \
create-remove-stores \
TESTS = $(noinst_PROGRAMS)
-# FIXME: temporarily removed due to bgo#668415
-#store_removed_SOURCES = \
-# store-removed.vala \
-# $(NULL)
-
anti_linking_SOURCES = \
anti-linking.vala \
$(NULL)
set-roles.vala \
$(NULL)
-# FIXME: temporarily removed due to bgo#668415
-#change_primary_store_SOURCES = \
-# change-primary-store.vala \
-# $(NULL)
-
link_personas_diff_stores_SOURCES = \
link-personas-diff-stores.vala \
$(NULL)
set-is-favourite.vala \
$(NULL)
+store_removed_SOURCES = \
+ store-removed.vala \
+ $(NULL)
+
CLEANFILES = \
*.pid \
*.address \
$(TESTS) \
$(NULL)
-# FIXME: temporarily removed due to bgo#668415
-# store_removed_vala.stamp \
-# change_primary_store_vala.stamp \
-# $(NULL)
-
MAINTAINERCLEANFILES = \
$(addsuffix .c,$(noinst_PROGRAMS)) \
$(addsuffix _vala.stamp,$(subst -,_,$(noinst_PROGRAMS))) \
+++ /dev/null
-/*
- * Copyright (C) 2011 Collabora Ltd.
- *
- * This library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library. If not, see <http://www.gnu.org/licenses/>.
- *
- * Authors: Raul Gutierrez Segales <raul.gutierrez.segales@collabora.co.uk>
- *
- */
-
-using Folks;
-using Gee;
-
-public class ChangePrimaryStoreTests : Folks.TestCase
-{
- private GLib.MainLoop _main_loop;
- private EdsTest.Backend _eds_backend;
- private EdsTest.Backend _eds_backend_other;
- private IndividualAggregator _aggregator;
- private Folks.PersonaStore _pstore1;
- private Folks.PersonaStore _pstore2;
- private bool _new_primary_store_found;
-
- public ChangePrimaryStoreTests ()
- {
- base ("ChangePrimaryStoreTests");
-
- this._eds_backend = new EdsTest.Backend ();
- this._eds_backend.address_book_uri = "system-address-book";
- this._eds_backend_other = new EdsTest.Backend ();
- this._eds_backend_other.address_book_uri = "other";
-
- this.add_test ("test primary store changes in the IndividualAggregator",
- this.test_change_primary_store);
- }
-
- public override void set_up ()
- {
- Environment.unset_variable ("FOLKS_PRIMARY_STORE");
- this._eds_backend.set_up (true);
- this._eds_backend_other.set_up ();
- }
-
- public override void tear_down ()
- {
- this._eds_backend.tear_down ();
- this._eds_backend_other.tear_down ();
- }
-
- public void test_change_primary_store ()
- {
- this._main_loop = new GLib.MainLoop (null, false);
- this._new_primary_store_found = false;
-
- this._test_change_primary_store ();
-
- var timer_id = Timeout.add_seconds (8, () =>
- {
- this._main_loop.quit ();
- assert_not_reached ();
- });
-
- this._main_loop.run ();
-
- assert (this._new_primary_store_found);
-
- GLib.Source.remove (timer_id);
- this._aggregator = null;
- this._main_loop = null;
- }
-
- private async void _test_change_primary_store ()
- {
- var store = BackendStore.dup ();
- yield store.prepare ();
- this._aggregator = new IndividualAggregator ();
- try
- {
- yield this._aggregator.prepare ();
-
- this._pstore1 = this._get_persona_store (store,
- this._eds_backend.address_book_uid);
- this._pstore2 = this._get_persona_store (store,
- this._eds_backend_other.address_book_uid);
-
- assert (this._pstore1 != null);
- assert (this._pstore2 != null);
-
- assert (this._aggregator.primary_store == this._pstore1);
-
- this._aggregator.notify["primary-store"].connect (
- this._primary_store_cb);
-
- this._eds_backend_other.set_as_default ();
- }
- catch (GLib.Error e)
- {
- GLib.warning ("Error when calling prepare: %s\n", e.message);
- }
- }
-
- private PersonaStore? _get_persona_store (BackendStore store, string store_id)
- {
- PersonaStore? pstore = null;
- foreach (var backend in store.enabled_backends.values)
- {
- pstore = backend.persona_stores.get (store_id);
- if (pstore != null)
- break;
- }
- return pstore;
- }
-
- private void _primary_store_cb (Object ia_obj, ParamSpec ps)
- {
- IndividualAggregator ia = (IndividualAggregator) ia_obj;
-
- if (ia.primary_store == this._pstore2)
- {
- this._new_primary_store_found = true;
- this._main_loop.quit ();
- }
- }
-}
-
-public int main (string[] args)
-{
- Test.init (ref args);
-
- TestSuite root = TestSuite.get_root ();
- root.add_suite (new ChangePrimaryStoreTests ().get_suite ());
-
- Test.run ();
-
- return 0;
-}
*/
using EdsTest;
+using E;
using Folks;
using Gee;
this._eds_backend.add_contact (c1);
/* Schedule the test to start with the main loop. */
- this._test_single_store_part1_async ();
+ this._test_single_store_part1_async.begin ();
var timeout_id = Timeout.add_seconds (5, () =>
{
/* We should have a single individual by now. */
assert (this._aggregator.individuals.size == 1);
- Source.remove (timeout_id);
+ GLib.Source.remove (timeout_id);
/* Part 2, where we remove the address book. */
- this._test_single_store_part2_async ();
+ this._test_single_store_part2_async.begin ();
timeout_id = Timeout.add_seconds (5, () =>
{
/* The individual should be gone. */
assert (this._aggregator.individuals.size == 0);
- Source.remove (timeout_id);
+ GLib.Source.remove (timeout_id);
}
private async void _test_single_store_part1_async ()
/* Tear down the backend. This should remove all individuals. We check
* for this above. */
- E.SourceList? source_list = null;
- try
- {
- E.BookClient.get_sources (out source_list);
- source_list.remove_source_by_uid (this._eds_backend.address_book_uid);
- }
- catch (GLib.Error e1)
- {
- critical ("Error getting source list: %s", e1.message);
- }
+ this._eds_backend.tear_down ();
}
}