summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.co.uk>2011-03-22 13:59:39 -0400
committerNicolas Dufresne <nicolas.dufresne@collabora.co.uk>2011-03-25 14:03:04 -0400
commita46c03d7a4fb3abb002e73e62f5ed67ea5984f0c (patch)
tree8a10e2b8615f0aa01377536413fe0430b174ae5b
parent466b5191a7ded570b4abb407decb37ed7c0ba8f2 (diff)
Reorder test to match header order
-rw-r--r--tests/dbus/test-log-manager.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/tests/dbus/test-log-manager.c b/tests/dbus/test-log-manager.c
index 464537b..d0fdccf 100644
--- a/tests/dbus/test-log-manager.c
+++ b/tests/dbus/test-log-manager.c
@@ -300,15 +300,15 @@ test_get_dates (TestCaseFixture *fixture,
static void
-get_entities_cb (GObject *object,
+get_events_for_date_cb (GObject *object,
GAsyncResult *result,
gpointer user_data)
{
TestCaseFixture *fixture = user_data;
GError *error = NULL;
- tpl_log_manager_get_entities_finish (TPL_LOG_MANAGER (object), result,
- &fixture->ret, &error);
+ tpl_log_manager_get_events_for_date_finish (TPL_LOG_MANAGER (object),
+ result, &fixture->ret, &error);
g_assert_no_error (error);
g_main_loop_quit (fixture->main_loop);
@@ -316,22 +316,29 @@ get_entities_cb (GObject *object,
static void
-test_get_entities (TestCaseFixture *fixture,
+test_get_events_for_date (TestCaseFixture *fixture,
gconstpointer user_data)
{
- GList *loc;
+ TplEntity *entity;
+ GDate *date;
- tpl_log_manager_get_entities_async (fixture->manager, fixture->account,
- get_entities_cb, fixture);
+ entity = tpl_entity_new (ID, TPL_ENTITY_CONTACT, NULL, NULL);
+ date = g_date_new_dmy (13, 1, 2010);
+
+ tpl_log_manager_get_events_for_date_async (fixture->manager,
+ fixture->account,
+ entity,
+ TPL_EVENT_MASK_TEXT,
+ date,
+ get_events_for_date_cb,
+ fixture);
g_main_loop_run (fixture->main_loop);
- g_assert_cmpint (g_list_length (fixture->ret), ==, 2);
+ g_object_unref (entity);
+ g_date_free (date);
- /* we do not want duplicates */
- fixture->ret = g_list_sort (fixture->ret, (GCompareFunc) _tpl_entity_compare);
- for (loc = fixture->ret; loc != NULL; loc = g_list_next (loc))
- if (loc->next)
- g_assert (_tpl_entity_compare (loc->data, loc->next->data) != 0);
+ /* We got 6 events in old Empathy and 6 in new TpLogger storage */
+ g_assert_cmpint (g_list_length (fixture->ret), ==, 12);
g_list_foreach (fixture->ret, (GFunc) g_object_unref, NULL);
g_list_free (fixture->ret);
@@ -339,15 +346,15 @@ test_get_entities (TestCaseFixture *fixture,
static void
-get_events_for_date_cb (GObject *object,
+get_entities_cb (GObject *object,
GAsyncResult *result,
gpointer user_data)
{
TestCaseFixture *fixture = user_data;
GError *error = NULL;
- tpl_log_manager_get_events_for_date_finish (TPL_LOG_MANAGER (object),
- result, &fixture->ret, &error);
+ tpl_log_manager_get_entities_finish (TPL_LOG_MANAGER (object), result,
+ &fixture->ret, &error);
g_assert_no_error (error);
g_main_loop_quit (fixture->main_loop);
@@ -355,29 +362,22 @@ get_events_for_date_cb (GObject *object,
static void
-test_get_events_for_date (TestCaseFixture *fixture,
+test_get_entities (TestCaseFixture *fixture,
gconstpointer user_data)
{
- TplEntity *entity;
- GDate *date;
-
- entity = tpl_entity_new (ID, TPL_ENTITY_CONTACT, NULL, NULL);
- date = g_date_new_dmy (13, 1, 2010);
+ GList *loc;
- tpl_log_manager_get_events_for_date_async (fixture->manager,
- fixture->account,
- entity,
- TPL_EVENT_MASK_TEXT,
- date,
- get_events_for_date_cb,
- fixture);
+ tpl_log_manager_get_entities_async (fixture->manager, fixture->account,
+ get_entities_cb, fixture);
g_main_loop_run (fixture->main_loop);
- g_object_unref (entity);
- g_date_free (date);
+ g_assert_cmpint (g_list_length (fixture->ret), ==, 2);
- /* We got 6 events in old Empathy and 6 in new TpLogger storage */
- g_assert_cmpint (g_list_length (fixture->ret), ==, 12);
+ /* we do not want duplicates */
+ fixture->ret = g_list_sort (fixture->ret, (GCompareFunc) _tpl_entity_compare);
+ for (loc = fixture->ret; loc != NULL; loc = g_list_next (loc))
+ if (loc->next)
+ g_assert (_tpl_entity_compare (loc->data, loc->next->data) != 0);
g_list_foreach (fixture->ret, (GFunc) g_object_unref, NULL);
g_list_free (fixture->ret);
@@ -419,14 +419,14 @@ main (int argc, char **argv)
TestCaseFixture, params,
setup, test_get_dates, teardown);
- g_test_add ("/log-manager/get-entities",
- TestCaseFixture, params,
- setup, test_get_entities, teardown);
-
g_test_add ("/log-manager/get-events-for-date",
TestCaseFixture, params,
setup, test_get_events_for_date, teardown);
+ g_test_add ("/log-manager/get-entities",
+ TestCaseFixture, params,
+ setup, test_get_entities, teardown);
+
retval = g_test_run ();
g_list_foreach (l, (GFunc) g_hash_table_unref, NULL);