[evolution-kolab] tests/integration: fixes for libekolab http/xfb tests
- From: Christian Hilberg <chilberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-kolab] tests/integration: fixes for libekolab http/xfb tests
- Date: Thu, 10 May 2012 15:39:50 +0000 (UTC)
commit 5f98e91db20a85a3895fcd6f19c191cabf9db843
Author: Christian Hilberg <hilberg kernelconcepts de>
Date: Thu May 10 17:35:34 2012 +0200
tests/integration: fixes for libekolab http/xfb tests
* added missing E-D-S libs to build target for
XFB test
* get passwd for HTTP basic auth not from CamelURL
(which does not support auth creds any longer),
but from KolabUtilHttpJob now for both, HTTP test
and XFB test
* in test_kolab_util_http(), print error message
from HTTP getter, if it has one
src/tests/integration/libekolab/Makefile.am | 1 +
.../libekolab/test-kolab-util-cal-freebusy.c | 8 ++------
.../integration/libekolab/test-kolab-util-http.c | 16 +++++++++-------
3 files changed, 12 insertions(+), 13 deletions(-)
---
diff --git a/src/tests/integration/libekolab/Makefile.am b/src/tests/integration/libekolab/Makefile.am
index 16c6f0b..1b6fb1f 100644
--- a/src/tests/integration/libekolab/Makefile.am
+++ b/src/tests/integration/libekolab/Makefile.am
@@ -48,6 +48,7 @@ test_kolab_util_cal_freebusy_SOURCES = \
test_kolab_util_cal_freebusy_LDADD = \
$(CAMEL_LIBS) \
+ $(EDS_LIBS) \
$(GLIB_LIBS) \
$(KOLAB_LIB_CAMEL) \
$(KOLAB_LIB_EKOLABUTIL)
diff --git a/src/tests/integration/libekolab/test-kolab-util-cal-freebusy.c b/src/tests/integration/libekolab/test-kolab-util-cal-freebusy.c
index f8c65d9..ce9b4b2 100644
--- a/src/tests/integration/libekolab/test-kolab-util-cal-freebusy.c
+++ b/src/tests/integration/libekolab/test-kolab-util-cal-freebusy.c
@@ -183,22 +183,18 @@ test_kolab_util_cal_freebusy (void)
/* create KolabUtilHttpJob */
job = kolab_util_http_job_new ();
+ job->passwd = password;
job->pkcs11pin = pkcs11pin;
/* create CamelURL object */
job->url = camel_url_new (url_string, 0);
g_assert (job->url != NULL);
- /* FIXME rewrite this for CamelSettings */
- g_error ("%s: FIXME rewrite this for CamelSettings", __func__);
-#if 0
+ /* set username for basic auth */
camel_url_set_user (job->url, username);
- camel_url_set_passwd (job->url, password);
-#endif
g_free (url_string);
g_free (username);
- g_free (password);
/* job.buffer must be initialized NULL (no storage allocated!) */
job->buffer = NULL;
diff --git a/src/tests/integration/libekolab/test-kolab-util-http.c b/src/tests/integration/libekolab/test-kolab-util-http.c
index db854e9..01e01fd 100644
--- a/src/tests/integration/libekolab/test-kolab-util-http.c
+++ b/src/tests/integration/libekolab/test-kolab-util-http.c
@@ -108,22 +108,18 @@ test_kolab_util_http (void)
/* create KolabHttpJob */
job = kolab_util_http_job_new ();
+ job->passwd = password;
job->pkcs11pin = pkcs11pin;
/* create CamelURL object */
job->url = camel_url_new (url_string, 0);
g_assert (job->url != NULL);
- /* FIXME rewrite this for CamelSettings */
- g_error ("%s: FIXME rewrite this for CamelSettings", __func__);
-#if 0
+ /* set username for basic auth */
camel_url_set_user (job->url, username);
- camel_url_set_passwd (job->url, password);
-#endif
g_free (url_string);
g_free (username);
- g_free (password);
/* open filestream */
file_stream = camel_kolab_stream_new_filestream (outfilename,
@@ -141,7 +137,13 @@ test_kolab_util_http (void)
job->buffer = g_byte_array_new ();
/* issue HTTP GET request */
- nbytes = kolab_util_http_get (job, NULL);
+ nbytes = kolab_util_http_get (job, &tmp_err);
+ if (tmp_err != NULL) {
+ g_warning ("%s: %s",
+ __func__, tmp_err->message);
+ g_error_free (tmp_err);
+ tmp_err = NULL;
+ }
g_debug ("%s: %d bytes read", __func__, nbytes);
/* write data to file */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]