[evolution-ews/wip/get_server_time_zones: 5/6] Add e_ews_debug_get_server_version_from_string()



commit 2f1828da922aa2debf38f2a72f920f363b46b056
Author: Fabiano Fidêncio <fidencio redhat com>
Date:   Wed Jan 15 11:45:27 2014 +0100

    Add e_ews_debug_get_server_version_from_string()
    
    Convert the server version from a string to an EEwsServerVersion is
    (only) used in our tests, where we firstly set the server version as
    a string, before create the connection*, and we need to check which
    versions are supported or not by a specific test.
    
    *connection is created latter when we are running tests offline.

 src/server/e-ews-debug.c |   16 ++++++++++++++++
 src/server/e-ews-debug.h |    4 +++-
 2 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/src/server/e-ews-debug.c b/src/server/e-ews-debug.c
index 2bd0480..769ca07 100644
--- a/src/server/e-ews-debug.c
+++ b/src/server/e-ews-debug.c
@@ -63,3 +63,19 @@ e_ews_connection_get_server_version_string (EEwsConnection *cnc)
                        return NULL;
        }
 }
+
+EEwsServerVersion
+e_ews_debug_get_server_version_from_string (const gchar *version) {
+       if (g_strcmp0 (version, "Exchange2007") == 0)
+               return E_EWS_EXCHANGE_2007;
+       else if (g_strcmp0 (version, "Exchange2007_SP1") == 0)
+               return E_EWS_EXCHANGE_2007_SP1;
+       else if (g_strcmp0 (version, "Exchange2010") == 0)
+               return E_EWS_EXCHANGE_2010;
+       else if (g_strcmp0 (version, "Exchange2010_SP1") == 0)
+               return E_EWS_EXCHANGE_2010_SP1;
+       else if (g_strcmp0 (version, "Exchange2010_SP2") == 0)
+               return E_EWS_EXCHANGE_2010_SP2;
+       else
+               return E_EWS_EXCHANGE_FUTURE;
+}
diff --git a/src/server/e-ews-debug.h b/src/server/e-ews-debug.h
index b7782a8..cba0b42 100644
--- a/src/server/e-ews-debug.h
+++ b/src/server/e-ews-debug.h
@@ -27,7 +27,9 @@ G_BEGIN_DECLS
 gint           e_ews_debug_get_log_level               (void);
 const gchar *  e_ews_connection_get_server_version_string
                                                        (EEwsConnection *cnc);
-
+EEwsServerVersion
+               e_ews_debug_get_server_version_from_string
+                                                       (const gchar *version);
 
 G_END_DECLS
 


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