diff options
| author | Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> | 2010-02-15 14:16:44 +0000 |
|---|---|---|
| committer | Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> | 2010-02-15 15:28:04 +0000 |
| commit | 054615421b8c62504cc17989d8cace115ac5f216 (patch) | |
| tree | 805d07d41f7e9ba27cfab016c8e17c97d8768875 | |
| parent | ffe9fc4c94813082768eaeb8114739c5b12dba76 (diff) | |
testsuite enhancements
| -rw-r--r-- | tests/test-searches.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test-searches.c b/tests/test-searches.c index e1a73ed91..8c64450f0 100644 --- a/tests/test-searches.c +++ b/tests/test-searches.c @@ -1,9 +1,31 @@ #include "constants.h" +#include <glib.h> + #include <telepathy-logger/log-manager.h> #include <telepathy-logger/log-store.h> #include <telepathy-logger/log-store-empathy.h> + +static GMainLoop *loop = NULL; + +static void +got_dates_cb (GObject *obj, GAsyncResult *result, gpointer user_data) +{ + GList *ret = tpl_log_manager_async_operation_finish (result, NULL); + + for (; ret != NULL; ret = g_list_next (ret)) + { + gchar *date = ret->data; + /* g_assert (!tp_strdiff (date, "12345678")); */ + g_free (date); + } + g_list_free (ret); + g_main_loop_quit (loop); +} + + + int main (int argc, char *argv[]) { @@ -45,6 +67,7 @@ main (int argc, char *argv[]) g_list_foreach (ret, (GFunc) g_free, NULL); g_list_free (ret); + /* we do not want duplicates */ ret = tpl_log_manager_get_chats (manager, acc); ret = g_list_sort (ret, (GCompareFunc) tpl_log_manager_search_hit_compare); @@ -56,4 +79,8 @@ main (int argc, char *argv[]) g_list_free (ret); + tpl_log_manager_get_dates_async (manager, acc, ID, FALSE, got_dates_cb, NULL); + + loop = g_main_loop_new (NULL, FALSE); + g_main_loop_run (loop); } |
