[evolution-kolab/account-mgmt] test-kolab-mail-access.c: Assign "tls-variant" to CamelSettings.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-kolab/account-mgmt] test-kolab-mail-access.c: Assign "tls-variant" to CamelSettings.
- Date: Mon, 2 Jul 2012 13:34:23 +0000 (UTC)
commit 5df963f7e72c3f6a080b7a8f909b1633fade19b4
Author: Matthew Barnes <mbarnes redhat com>
Date: Mon Jul 2 09:30:24 2012 -0400
test-kolab-mail-access.c: Assign "tls-variant" to CamelSettings.
.../integration/libekolab/test-kolab-mail-access.c | 23 +++++++++----------
1 files changed, 11 insertions(+), 12 deletions(-)
---
diff --git a/src/tests/integration/libekolab/test-kolab-mail-access.c b/src/tests/integration/libekolab/test-kolab-mail-access.c
index 23552f8..4c5a2ab 100644
--- a/src/tests/integration/libekolab/test-kolab-mail-access.c
+++ b/src/tests/integration/libekolab/test-kolab-mail-access.c
@@ -58,6 +58,8 @@ static gboolean
kolab_itest_koma_ksettings_envset (KolabSettingsHandler *ksettings,
GError **err)
{
+ CamelKolabIMAPXSettings *camel_settings;
+ CamelNetworkSecurityMethod security;
GKeyFile *key_file = NULL;
gchar *config = NULL;
gboolean ok = FALSE;
@@ -68,11 +70,12 @@ kolab_itest_koma_ksettings_envset (KolabSettingsHandler *ksettings,
gchar *username = NULL;
gchar *userpass = NULL;
gchar *pkcs11pin = NULL;
- gint tls_variant = -1;
g_assert (KOLAB_IS_SETTINGS_HANDLER (ksettings));
g_return_val_if_fail (err == NULL || *err == NULL, FALSE);
+ camel_settings = kolab_settings_handler_get_camel_settings (ksettings);
+
key_file = g_key_file_new ();
config = g_strdup (TESTCASE ".conf");
@@ -84,7 +87,10 @@ kolab_itest_koma_ksettings_envset (KolabSettingsHandler *ksettings,
username = g_key_file_get_string (key_file, AUTH, "username", NULL);
userpass = g_key_file_get_string (key_file, AUTH, "password", NULL);
pkcs11pin = g_key_file_get_string (key_file, SECURITY, "pkcs11pin", NULL);
- tls_variant = g_key_file_get_integer (key_file, SECURITY, "tls_variant", NULL);
+
+ /* CamelNetworkSecurityMethod enum values match up exactly with
+ * KolabTLSVariantID enum values, so no translation necessary. */
+ security = g_key_file_get_integer (key_file, SECURITY, "tls_variant", NULL);
g_key_file_free (key_file);
@@ -93,8 +99,7 @@ kolab_itest_koma_ksettings_envset (KolabSettingsHandler *ksettings,
g_assert (username != NULL);
g_assert (userpass != NULL);
g_assert (pkcs11pin != NULL);
- g_assert ((tls_variant >= KOLAB_TLS_VARIANT_NONE) &&
- (tls_variant < KOLAB_TLS_LAST_VARIANT));
+ g_assert (security < CAMEL_NETWORK_SECURITY_METHOD_STARTTLS_ON_STANDARD_PORT);
ok = kolab_settings_handler_set_char_field (ksettings,
KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_SERVER_NAME,
@@ -141,14 +146,8 @@ kolab_itest_koma_ksettings_envset (KolabSettingsHandler *ksettings,
return FALSE;
}
- ok = kolab_settings_handler_set_uint_field (ksettings,
- KOLAB_SETTINGS_HANDLER_UINT_FIELD_TLS_VARIANT,
- (guint)tls_variant,
- &tmp_err);
- if (! ok) {
- g_propagate_error (err, tmp_err);
- return FALSE;
- }
+ camel_network_settings_set_security_method (CAMEL_NETWORK_SETTINGS (camel_settings),
+ security);
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]