diff options
Diffstat (limited to 'tests/dbus/test-log-manager.c')
-rw-r--r-- | tests/dbus/test-log-manager.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/dbus/test-log-manager.c b/tests/dbus/test-log-manager.c index 67a7768..b2c0748 100644 --- a/tests/dbus/test-log-manager.c +++ b/tests/dbus/test-log-manager.c @@ -453,6 +453,41 @@ test_get_entities (TestCaseFixture *fixture, } +static void +search_cb (GObject *object, + GAsyncResult *result, + gpointer user_data) +{ + TestCaseFixture *fixture = user_data; + GError *error = NULL; + + tpl_log_manager_search_finish (TPL_LOG_MANAGER (object), + result, &fixture->ret, &error); + + g_assert_no_error (error); + g_main_loop_quit (fixture->main_loop); +} + + +static void +test_search (TestCaseFixture *fixture, + gconstpointer user_data) +{ + tpl_log_manager_search_async (fixture->manager, + "user2@collabora.co.uk", + TPL_EVENT_MASK_TEXT, + search_cb, + fixture); + g_main_loop_run (fixture->main_loop); + + /* We got 6 events in old Empathy and 6 in new TpLogger storage */ + g_assert_cmpint (g_list_length (fixture->ret), ==, 10); + + tpl_log_manager_search_free (fixture->ret); + fixture->ret = NULL; +} + + int main (int argc, char **argv) { @@ -500,6 +535,10 @@ main (int argc, char **argv) TestCaseFixture, params, setup, test_get_entities, teardown); + g_test_add ("/log-manager/search", + TestCaseFixture, params, + setup, test_search, teardown); + retval = g_test_run (); g_list_foreach (l, (GFunc) g_hash_table_unref, NULL); |