summaryrefslogtreecommitdiff
path: root/tests/dbus/test-searches.c
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.co.uk>2011-02-22 16:20:24 -0500
committerNicolas Dufresne <nicolas.dufresne@collabora.co.uk>2011-02-22 16:20:24 -0500
commitbf0ddf5880de6677cc7ad69f040651b256afd70e (patch)
tree9ebb9e3bdeb5fd614bc4eb01bf8c4f876df90c89 /tests/dbus/test-searches.c
parentce34b27629ad00ebc5bf0e7ad7ec1df43e190f48 (diff)
Move away from id/type pair in favor of TplEntity
In the first rework step, TplEventSearchType was introduced with wrong assomption. This item was merging entity type and event type together. To make thing simple, this patch replace the pair with a TplEntity object that contain all the required information about the Entity. This enable for more complete logs in the future and fix bugs where get_entities() won't return chatrooms.
Diffstat (limited to 'tests/dbus/test-searches.c')
-rw-r--r--tests/dbus/test-searches.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/dbus/test-searches.c b/tests/dbus/test-searches.c
index 6193e5f..422619b 100644
--- a/tests/dbus/test-searches.c
+++ b/tests/dbus/test-searches.c
@@ -92,9 +92,14 @@ test_get_dates (TestCaseFixture *fixture,
gconstpointer user_data)
{
GList *ret, *loc;
+ TplEntity *entity;
+
+ entity = g_object_new (TPL_TYPE_ENTITY,
+ "identifier", ID,
+ "type", TPL_ENTITY_CONTACT);
+ ret = _tpl_log_manager_get_dates (fixture->manager, fixture->account, entity);
+ g_object_unref (entity);
- ret = _tpl_log_manager_get_dates (fixture->manager, fixture->account, ID,
- TPL_EVENT_SEARCH_TEXT);
/* it includes 1 date from libpurple logs, 5 from TpLogger. Empathy
* log-store date are the same of the TpLogger store, and wont' be present,
* being duplicates */
@@ -117,9 +122,8 @@ test_get_entities (TestCaseFixture *fixture,
GList *ret, *loc;
ret = _tpl_log_manager_get_entities (fixture->manager, fixture->account);
- /* only ID=user2@collabora.co.uk is currently present, among PidginStore,
- * EmpathyStore and XmlStore */
- g_assert_cmpint (g_list_length (ret), ==, 1);
+
+ g_assert_cmpint (g_list_length (ret), ==, 2);
/* we do not want duplicates */
ret = g_list_sort (ret, (GCompareFunc) _tpl_entity_compare);