[evolution-data-server/openismus-work] ECalClient test test-client-refresh: Only test the refresh APIs if it is supported.



commit 2bc9c42b0025ac8e10102e552a6e0acdc3b88b47
Author: Tristan Van Berkom <tristanvb openismus com>
Date:   Wed Jan 23 15:33:01 2013 +0900

    ECalClient test test-client-refresh: Only test the refresh APIs if it is supported.
    
    Newer versions of the local calendar backend dont support the explicit refresh,
    so failing the explicit refresh is not an error.

 tests/libecal/client/test-client-refresh.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/tests/libecal/client/test-client-refresh.c b/tests/libecal/client/test-client-refresh.c
index 3586822..0a9c50a 100644
--- a/tests/libecal/client/test-client-refresh.c
+++ b/tests/libecal/client/test-client-refresh.c
@@ -5,7 +5,6 @@
 #include <libecal/libecal.h>
 #include <libical/ical.h>
 
-#include "client-test-utils.h"
 #include "e-test-server-utils.h"
 
 static ETestServerClosure cal_closure =
@@ -39,13 +38,17 @@ test_refresh_sync (ETestServerFixture *fixture,
 {
 	ECalClient *cal;
 	GError *error = NULL;
+	gboolean supported;
 
 	cal = E_TEST_SERVER_UTILS_SERVICE (fixture, ECalClient);
 
-	setup_cal (cal);
+	supported = e_client_check_refresh_supported (E_CLIENT (cal));
 
-	g_print ("Refresh supported: %s\n", e_client_check_refresh_supported (E_CLIENT (cal)) ? "yes" : "no");
+	g_print ("Refresh supported: %s\n", supported ? "yes" : "no");
+	if (!supported)
+		return;
 
+	setup_cal (cal);
 	if (!e_client_refresh_sync (E_CLIENT (cal), NULL, &error))
 		g_error ("refresh sync: %s", error->message);
 }
@@ -72,11 +75,15 @@ test_refresh_async (ETestServerFixture *fixture,
 		    gconstpointer       user_data)
 {
 	ECalClient *cal;
+	gboolean supported;
 
 	cal = E_TEST_SERVER_UTILS_SERVICE (fixture, ECalClient);
 
-	setup_cal (cal);
+	supported = e_client_check_refresh_supported (E_CLIENT (cal));
+	if (!supported)
+		return;
 
+	setup_cal (cal);
 	e_client_refresh (E_CLIENT (cal), NULL, async_refresh_result_ready, fixture->loop);
 	g_main_loop_run (fixture->loop);
 }



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