[evolution-data-server/cursor-staging: 9/26] ECalClient tests: Use async apis to open the client for every async test.



commit 6cbcf06080b7deab6ad7fd71c42d592e0faa7d8f
Author: Tristan Van Berkom <tristanvb openismus com>
Date:   Wed Apr 24 17:48:42 2013 +0900

    ECalClient tests: Use async apis to open the client for every async test.

 tests/libecal/client/test-client-add-timezone.c    |   10 ++++++----
 tests/libecal/client/test-client-create-object.c   |   10 ++++++----
 .../client/test-client-get-attachment-uris.c       |   10 ++++++----
 tests/libecal/client/test-client-get-object-list.c |   10 ++++++----
 tests/libecal/client/test-client-get-view.c        |   10 ++++++----
 tests/libecal/client/test-client-modify-object.c   |   10 ++++++----
 tests/libecal/client/test-client-receive-objects.c |   10 ++++++----
 tests/libecal/client/test-client-refresh.c         |   10 ++++++----
 tests/libecal/client/test-client-remove-object.c   |   12 +++++++-----
 tests/libecal/client/test-client-revision-view.c   |   10 ++++++----
 tests/libecal/client/test-client-send-objects.c    |   10 ++++++----
 11 files changed, 67 insertions(+), 45 deletions(-)
---
diff --git a/tests/libecal/client/test-client-add-timezone.c b/tests/libecal/client/test-client-add-timezone.c
index b450dc2..a3acec9 100644
--- a/tests/libecal/client/test-client-add-timezone.c
+++ b/tests/libecal/client/test-client-add-timezone.c
@@ -9,8 +9,10 @@
 #define TZID_NEW "XYZ"
 #define TZNAME_NEW "Ex Wye Zee"
 
-static ETestServerClosure cal_closure =
-       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS };
+static ETestServerClosure cal_closure_sync =
+       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, FALSE, NULL, FALSE };
+static ETestServerClosure cal_closure_async =
+       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, FALSE, NULL, TRUE };
 
 static void
 test_add_timezone_sync (ETestServerFixture *fixture,
@@ -134,14 +136,14 @@ main (gint argc,
        g_test_add (
                "/ECalClient/AddTimezone/Sync",
                ETestServerFixture,
-               &cal_closure,
+               &cal_closure_sync,
                e_test_server_utils_setup,
                test_add_timezone_sync,
                e_test_server_utils_teardown);
        g_test_add (
                "/ECalClient/AddTimezone/Async",
                ETestServerFixture,
-               &cal_closure,
+               &cal_closure_async,
                e_test_server_utils_setup,
                test_add_timezone_async,
                e_test_server_utils_teardown);
diff --git a/tests/libecal/client/test-client-create-object.c 
b/tests/libecal/client/test-client-create-object.c
index a7c5881..3ab3f67 100644
--- a/tests/libecal/client/test-client-create-object.c
+++ b/tests/libecal/client/test-client-create-object.c
@@ -6,8 +6,10 @@
 
 #include "e-test-server-utils.h"
 
-static ETestServerClosure cal_closure =
-       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS };
+static ETestServerClosure cal_closure_sync =
+       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, FALSE, NULL, FALSE };
+static ETestServerClosure cal_closure_async =
+       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, FALSE, NULL, TRUE };
 
 static void
 test_icalcomps (icalcomponent *icalcomp1,
@@ -212,14 +214,14 @@ main (gint argc,
        g_test_add (
                "/ECalClient/CreateObject/Sync",
                ETestServerFixture,
-               &cal_closure,
+               &cal_closure_sync,
                e_test_server_utils_setup,
                test_create_object_sync,
                e_test_server_utils_teardown);
        g_test_add (
                "/ECalClient/CreateObject/Async",
                ETestServerFixture,
-               &cal_closure,
+               &cal_closure_async,
                e_test_server_utils_setup,
                test_create_object_async,
                e_test_server_utils_teardown);
diff --git a/tests/libecal/client/test-client-get-attachment-uris.c 
b/tests/libecal/client/test-client-get-attachment-uris.c
index 7390267..8f1c497 100644
--- a/tests/libecal/client/test-client-get-attachment-uris.c
+++ b/tests/libecal/client/test-client-get-attachment-uris.c
@@ -11,8 +11,10 @@
 #define ATTACH2 "file:///tmp/file2"
 #define ATTACH3 "file:///tmp/dir/fileěščřžýáíé3"
 
-static ETestServerClosure cal_closure =
-       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS };
+static ETestServerClosure cal_closure_sync =
+       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, FALSE, NULL, FALSE };
+static ETestServerClosure cal_closure_async =
+       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, FALSE, NULL, TRUE };
 
 static void
 add_attach (icalcomponent *icalcomp,
@@ -149,14 +151,14 @@ main (gint argc,
        g_test_add (
                "/ECalClient/GetAttachmentUris/Sync",
                ETestServerFixture,
-               &cal_closure,
+               &cal_closure_sync,
                e_test_server_utils_setup,
                test_get_attachment_uris_sync,
                e_test_server_utils_teardown);
        g_test_add (
                "/ECalClient/GetAttachmentUris/Async",
                ETestServerFixture,
-               &cal_closure,
+               &cal_closure_async,
                e_test_server_utils_setup,
                test_get_attachment_uris_async,
                e_test_server_utils_teardown);
diff --git a/tests/libecal/client/test-client-get-object-list.c 
b/tests/libecal/client/test-client-get-object-list.c
index 45f296c..8fd0e81 100644
--- a/tests/libecal/client/test-client-get-object-list.c
+++ b/tests/libecal/client/test-client-get-object-list.c
@@ -9,8 +9,10 @@
 #define EVENT_SUMMARY "Creation of new test event"
 #define EVENT_QUERY "(contains? \"summary\" \"" EVENT_SUMMARY "\")"
 
-static ETestServerClosure cal_closure =
-       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS };
+static ETestServerClosure cal_closure_sync =
+       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, FALSE, NULL, FALSE };
+static ETestServerClosure cal_closure_async =
+       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, FALSE, NULL, TRUE };
 
 static void
 setup_cal (ECalClient *cal_client)
@@ -136,14 +138,14 @@ main (gint argc,
        g_test_add (
                "/ECalClient/GetObjectList/Sync",
                ETestServerFixture,
-               &cal_closure,
+               &cal_closure_sync,
                e_test_server_utils_setup,
                test_get_object_list_sync,
                e_test_server_utils_teardown);
        g_test_add (
                "/ECalClient/GetObjectList/Async",
                ETestServerFixture,
-               &cal_closure,
+               &cal_closure_async,
                e_test_server_utils_setup,
                test_get_object_list_async,
                e_test_server_utils_teardown);
diff --git a/tests/libecal/client/test-client-get-view.c b/tests/libecal/client/test-client-get-view.c
index 32d0783..1a79cb6 100644
--- a/tests/libecal/client/test-client-get-view.c
+++ b/tests/libecal/client/test-client-get-view.c
@@ -6,8 +6,10 @@
 
 #include "e-test-server-utils.h"
 
-static ETestServerClosure cal_closure =
-       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS };
+static ETestServerClosure cal_closure_sync =
+       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, FALSE, NULL, FALSE };
+static ETestServerClosure cal_closure_async =
+       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, FALSE, NULL, TRUE };
 
 typedef enum {
        SUBTEST_OBJECTS_ADDED,
@@ -213,14 +215,14 @@ main (gint argc,
        g_test_add (
                "/ECalClient/GetView/Sync",
                ETestServerFixture,
-               &cal_closure,
+               &cal_closure_sync,
                e_test_server_utils_setup,
                test_get_view_sync,
                e_test_server_utils_teardown);
        g_test_add (
                "/ECalClient/GetView/Async",
                ETestServerFixture,
-               &cal_closure,
+               &cal_closure_async,
                e_test_server_utils_setup,
                test_get_view_async,
                e_test_server_utils_teardown);
diff --git a/tests/libecal/client/test-client-modify-object.c 
b/tests/libecal/client/test-client-modify-object.c
index 44be09f..ff7a78f 100644
--- a/tests/libecal/client/test-client-modify-object.c
+++ b/tests/libecal/client/test-client-modify-object.c
@@ -6,8 +6,10 @@
 
 #include "e-test-server-utils.h"
 
-static ETestServerClosure cal_closure =
-       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS };
+static ETestServerClosure cal_closure_sync =
+       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, FALSE, NULL, FALSE };
+static ETestServerClosure cal_closure_async =
+       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, FALSE, NULL, TRUE };
 
 #define EVENT_SUMMARY "Creation of new test event"
 
@@ -133,14 +135,14 @@ main (gint argc,
        g_test_add (
                "/ECalClient/ModifyObject/Sync",
                ETestServerFixture,
-               &cal_closure,
+               &cal_closure_sync,
                e_test_server_utils_setup,
                test_modify_object_sync,
                e_test_server_utils_teardown);
        g_test_add (
                "/ECalClient/ModifyObject/Async",
                ETestServerFixture,
-               &cal_closure,
+               &cal_closure_async,
                e_test_server_utils_setup,
                test_modify_object_async,
                e_test_server_utils_teardown);
diff --git a/tests/libecal/client/test-client-receive-objects.c 
b/tests/libecal/client/test-client-receive-objects.c
index 2ba68fa..88a00d7 100644
--- a/tests/libecal/client/test-client-receive-objects.c
+++ b/tests/libecal/client/test-client-receive-objects.c
@@ -6,8 +6,10 @@
 
 #include "e-test-server-utils.h"
 
-static ETestServerClosure cal_closure =
-       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS };
+static ETestServerClosure cal_closure_sync =
+       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, FALSE, NULL, FALSE };
+static ETestServerClosure cal_closure_async =
+       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, FALSE, NULL, TRUE };
 
 static icalcomponent *
 create_object (void)
@@ -88,14 +90,14 @@ main (gint argc,
        g_test_add (
                "/ECalClient/ReceiveObjects/Sync",
                ETestServerFixture,
-               &cal_closure,
+               &cal_closure_sync,
                e_test_server_utils_setup,
                test_receive_objects_sync,
                e_test_server_utils_teardown);
        g_test_add (
                "/ECalClient/ReceiveObjects/Async",
                ETestServerFixture,
-               &cal_closure,
+               &cal_closure_async,
                e_test_server_utils_setup,
                test_receive_objects_async,
                e_test_server_utils_teardown);
diff --git a/tests/libecal/client/test-client-refresh.c b/tests/libecal/client/test-client-refresh.c
index 93cc1b4..7f60af2 100644
--- a/tests/libecal/client/test-client-refresh.c
+++ b/tests/libecal/client/test-client-refresh.c
@@ -7,8 +7,10 @@
 
 #include "e-test-server-utils.h"
 
-static ETestServerClosure cal_closure =
-       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS };
+static ETestServerClosure cal_closure_sync =
+       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, FALSE, NULL, FALSE };
+static ETestServerClosure cal_closure_async =
+       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, FALSE, NULL, TRUE };
 
 static void
 setup_cal (ECalClient *cal_client)
@@ -97,14 +99,14 @@ main (gint argc,
        g_test_add (
                "/ECalClient/Refresh/Sync",
                ETestServerFixture,
-               &cal_closure,
+               &cal_closure_sync,
                e_test_server_utils_setup,
                test_refresh_sync,
                e_test_server_utils_teardown);
        g_test_add (
                "/ECalClient/Refresh/Async",
                ETestServerFixture,
-               &cal_closure,
+               &cal_closure_async,
                e_test_server_utils_setup,
                test_refresh_async,
                e_test_server_utils_teardown);
diff --git a/tests/libecal/client/test-client-remove-object.c 
b/tests/libecal/client/test-client-remove-object.c
index 601209e..3220386 100644
--- a/tests/libecal/client/test-client-remove-object.c
+++ b/tests/libecal/client/test-client-remove-object.c
@@ -6,8 +6,10 @@
 
 #include "e-test-server-utils.h"
 
-static ETestServerClosure cal_closure =
-       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS };
+static ETestServerClosure cal_closure_sync =
+       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, FALSE, NULL, FALSE };
+static ETestServerClosure cal_closure_async =
+       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, FALSE, NULL, TRUE };
 
 static gchar *
 create_object (ECalClient *cal_client)
@@ -114,21 +116,21 @@ main (gint argc,
        g_test_add (
                "/ECalClient/RemoveObject/Sync",
                ETestServerFixture,
-               &cal_closure,
+               &cal_closure_sync,
                e_test_server_utils_setup,
                test_remove_object_sync,
                e_test_server_utils_teardown);
        g_test_add (
                "/ECalClient/RemoveObject/Async",
                ETestServerFixture,
-               &cal_closure,
+               &cal_closure_async,
                e_test_server_utils_setup,
                test_remove_object_async,
                e_test_server_utils_teardown);
        g_test_add (
                "/ECalClient/RemoveObject/EmptyUid",
                ETestServerFixture,
-               &cal_closure,
+               &cal_closure_sync,
                e_test_server_utils_setup,
                test_remove_object_empty_uid,
                e_test_server_utils_teardown);
diff --git a/tests/libecal/client/test-client-revision-view.c 
b/tests/libecal/client/test-client-revision-view.c
index 663d867..2148ab2 100644
--- a/tests/libecal/client/test-client-revision-view.c
+++ b/tests/libecal/client/test-client-revision-view.c
@@ -6,8 +6,10 @@
 
 #include "e-test-server-utils.h"
 
-static ETestServerClosure cal_closure =
-       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS };
+static ETestServerClosure cal_closure_sync =
+       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, FALSE, NULL, FALSE };
+static ETestServerClosure cal_closure_async =
+       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, FALSE, NULL, TRUE };
 
 typedef enum {
        SUBTEST_OBJECTS_ADDED,
@@ -263,14 +265,14 @@ main (gint argc,
        g_test_add (
                "/ECalClient/GetRevisionView/Sync",
                ETestServerFixture,
-               &cal_closure,
+               &cal_closure_sync,
                e_test_server_utils_setup,
                test_get_revision_view_sync,
                e_test_server_utils_teardown);
        g_test_add (
                "/ECalClient/GetRevisionView/Async",
                ETestServerFixture,
-               &cal_closure,
+               &cal_closure_async,
                e_test_server_utils_setup,
                test_get_revision_view_async,
                e_test_server_utils_teardown);
diff --git a/tests/libecal/client/test-client-send-objects.c b/tests/libecal/client/test-client-send-objects.c
index 2d85f73..c279df2 100644
--- a/tests/libecal/client/test-client-send-objects.c
+++ b/tests/libecal/client/test-client-send-objects.c
@@ -6,8 +6,10 @@
 
 #include "e-test-server-utils.h"
 
-static ETestServerClosure cal_closure =
-       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS };
+static ETestServerClosure cal_closure_sync =
+       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, FALSE, NULL, FALSE };
+static ETestServerClosure cal_closure_async =
+       { E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, FALSE, NULL, TRUE };
 
 static void
 print_ecomp (ECalComponent *ecalcomp)
@@ -155,14 +157,14 @@ main (gint argc,
        g_test_add (
                "/ECalClient/SendObjects/Sync",
                ETestServerFixture,
-               &cal_closure,
+               &cal_closure_sync,
                e_test_server_utils_setup,
                test_send_objects_sync,
                e_test_server_utils_teardown);
        g_test_add (
                "/ECalClient/SendObjects/Async",
                ETestServerFixture,
-               &cal_closure,
+               &cal_closure_async,
                e_test_server_utils_setup,
                test_send_objects_async,
                e_test_server_utils_teardown);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]