summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.co.uk>2011-03-22 13:44:10 -0400
committerNicolas Dufresne <nicolas.dufresne@collabora.co.uk>2011-03-25 14:03:04 -0400
commit466b5191a7ded570b4abb407decb37ed7c0ba8f2 (patch)
treea01aa47868e8989e2083f3971f75fb1c633b31e2
parentb06952cc726ad4d06cd11442591f94a987b9a04a (diff)
Add tpl_log_manager_exists() test coverage
-rw-r--r--tests/dbus/test-log-manager.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/dbus/test-log-manager.c b/tests/dbus/test-log-manager.c
index 36736da..464537b 100644
--- a/tests/dbus/test-log-manager.c
+++ b/tests/dbus/test-log-manager.c
@@ -232,6 +232,27 @@ setup_debug (void)
static void
+test_exists (TestCaseFixture *fixture,
+ gconstpointer user_data)
+{
+ TplEntity *entity;
+ TplEntity *no_entity;
+
+ entity = tpl_entity_new (ID, TPL_ENTITY_CONTACT, NULL, NULL);
+ no_entity = tpl_entity_new ("unknown", TPL_ENTITY_CONTACT, NULL, NULL);
+
+ g_assert (tpl_log_manager_exists (fixture->manager, fixture->account,
+ entity, TPL_EVENT_MASK_ANY));
+
+ g_assert (!tpl_log_manager_exists (fixture->manager, fixture->account,
+ no_entity, TPL_EVENT_MASK_ANY));
+
+ g_object_unref (entity);
+ g_object_unref (no_entity);
+}
+
+
+static void
get_dates_async_cb (GObject *object,
GAsyncResult *result,
gpointer user_data)
@@ -390,6 +411,10 @@ main (int argc, char **argv)
g_hash_table_insert (params, "account-path",
tp_g_value_slice_new_static_string (ACCOUNT_PATH_JABBER));
+ g_test_add ("/log-manager/exists",
+ TestCaseFixture, params,
+ setup, test_exists, teardown);
+
g_test_add ("/log-manager/get-dates",
TestCaseFixture, params,
setup, test_get_dates, teardown);