summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-06-14 08:51:15 +0200
committerMilan Crha <mcrha@redhat.com>2011-06-14 08:51:15 +0200
commitdf52a3fa652503a2b7c8eb25f0ce7a5ea77e45ba (patch)
tree57831c507cc706f9cf74324f88da49cd7c98b47a /tests
parent1709806a83de4ec927245b432bad2a03f17c2b09 (diff)
downloadevolution-data-server-df52a3fa652503a2b7c8eb25f0ce7a5ea77e45ba.tar.gz
Do not use deprecated EBook/ECal API
Diffstat (limited to 'tests')
-rw-r--r--tests/libebook/Makefile.am103
-rw-r--r--tests/libecal/Makefile.am20
-rw-r--r--tests/libedataserverui/test-client-examine-auth.c10
-rw-r--r--tests/libedataserverui/test-contact-store.c10
4 files changed, 89 insertions, 54 deletions
diff --git a/tests/libebook/Makefile.am b/tests/libebook/Makefile.am
index ac23d45ef..d425d8e34 100644
--- a/tests/libebook/Makefile.am
+++ b/tests/libebook/Makefile.am
@@ -1,5 +1,26 @@
SUBDIRS = vcard client
+if HAVE_E_BOOK_DISABLE_DEPRECATED
+
+TEST_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -I$(top_srcdir) \
+ -I$(top_builddir) \
+ -I$(top_srcdir)/addressbook \
+ -I$(top_builddir)/addressbook \
+ -DSRCDIR=\""$(srcdir)"\" \
+ $(EVOLUTION_ADDRESSBOOK_CFLAGS) \
+ $(NULL)
+
+TEST_LIBS = \
+ $(top_builddir)/addressbook/libebook/libebook-1.2.la \
+ $(EVOLUTION_ADDRESSBOOK_LIBS) \
+ $(NULL)
+
+DEPRECATED_TESTS = $(NULL)
+
+else
+
noinst_LTLIBRARIES = libebook-test-utils.la
libebook_test_utils_la_SOURCES = ebook-test-utils.c ebook-test-utils.h
@@ -19,11 +40,26 @@ libebook_test_utils_la_LIBADD = \
$(EVOLUTION_ADDRESSBOOK_LIBS) \
$(NULL)
-TEST_LIBS = \
- $(libebook_test_utils_la_LIBADD) \
- libebook-test-utils.la \
+TEST_CPPFLAGS = \
+ $(libebook_test_utils_la_CPPFLAGS) \
+ $(NULL)
+
+TEST_LIBS = \
+ $(libebook_test_utils_la_LIBADD) \
+ libebook-test-utils.la \
$(NULL)
+DEPRECATED_TESTS = \
+ test-changes \
+ test-ebook \
+ test-ebook-async \
+ test-nonexistent-id \
+ test-search \
+ test-self \
+ test-stress-bookviews
+
+endif
+
# Should be kept ordered approximately from least to most difficult/complex
TESTS = \
$(NULL)
@@ -50,25 +86,15 @@ TESTS = \
# test-ebook-stress-factory--single-book
noinst_PROGRAMS = \
- $(TESTS) \
- test-changes \
- test-categories \
- test-date \
- test-ebook \
- test-ebook-async \
- test-nonexistent-id \
- test-photo \
- test-query \
- test-self \
- test-string \
- test-undefinedfield \
- test-untyped-phones \
- test-search \
- test-stress-bookviews \
- $(NULL)
-
-TEST_CPPFLAGS= \
- $(libebook_test_utils_la_CPPFLAGS) \
+ $(TESTS) \
+ $(DEPRECATED_TESTS) \
+ test-categories \
+ test-date \
+ test-photo \
+ test-query \
+ test-string \
+ test-undefinedfield \
+ test-untyped-phones \
$(NULL)
EXTRA_DIST = \
@@ -77,10 +103,25 @@ EXTRA_DIST = \
$(srcdir)/data/vcards/simple-2.vcf \
$(NULL)
-test_search_LDADD=$(TEST_LIBS)
-test_search_CPPFLAGS=$(TEST_CPPFLAGS)
+test_categories_LDADD=$(TEST_LIBS)
+test_categories_CPPFLAGS=$(TEST_CPPFLAGS)
test_date_LDADD=$(TEST_LIBS)
test_date_CPPFLAGS=$(TEST_CPPFLAGS)
+test_photo_LDADD=$(TEST_LIBS)
+test_photo_CPPFLAGS=$(TEST_CPPFLAGS)
+test_query_LDADD=$(TEST_LIBS)
+test_query_CPPFLAGS=$(TEST_CPPFLAGS)
+test_string_LDADD=$(TEST_LIBS)
+test_string_CPPFLAGS=$(TEST_CPPFLAGS)
+test_undefinedfield_LDADD=$(TEST_LIBS)
+test_undefinedfield_CPPFLAGS=$(TEST_CPPFLAGS)
+test_untyped_phones_LDADD=$(TEST_LIBS)
+test_untyped_phones_CPPFLAGS=$(TEST_CPPFLAGS)
+
+if !HAVE_E_BOOK_DISABLE_DEPRECATED
+
+test_search_LDADD=$(TEST_LIBS)
+test_search_CPPFLAGS=$(TEST_CPPFLAGS)
test_ebook_LDADD=$(TEST_LIBS)
test_ebook_CPPFLAGS=$(TEST_CPPFLAGS)
test_ebook_async_LDADD=$(TEST_LIBS)
@@ -117,23 +158,13 @@ test_ebook_stress_factory__serial_CPPFLAGS=$(TEST_CPPFLAGS)
test_ebook_stress_factory__single_book_CPPFLAGS=$(TEST_CPPFLAGS)
test_changes_LDADD=$(TEST_LIBS)
test_changes_CPPFLAGS=$(TEST_CPPFLAGS)
-test_categories_LDADD=$(TEST_LIBS)
-test_categories_CPPFLAGS=$(TEST_CPPFLAGS)
test_nonexistent_id_LDADD=$(TEST_LIBS)
test_nonexistent_id_CPPFLAGS=$(TEST_CPPFLAGS)
-test_photo_LDADD=$(TEST_LIBS)
-test_photo_CPPFLAGS=$(TEST_CPPFLAGS)
-test_query_LDADD=$(TEST_LIBS)
-test_query_CPPFLAGS=$(TEST_CPPFLAGS)
test_self_LDADD=$(TEST_LIBS)
test_self_CPPFLAGS=$(TEST_CPPFLAGS)
-test_string_LDADD=$(TEST_LIBS)
-test_string_CPPFLAGS=$(TEST_CPPFLAGS)
-test_undefinedfield_LDADD=$(TEST_LIBS)
-test_undefinedfield_CPPFLAGS=$(TEST_CPPFLAGS)
-test_untyped_phones_LDADD=$(TEST_LIBS)
-test_untyped_phones_CPPFLAGS=$(TEST_CPPFLAGS)
test_stress_bookviews_LDADD=$(TEST_LIBS)
test_stress_bookviews_CPPFLAGS=$(TEST_CPPFLAGS)
+endif
+
-include $(top_srcdir)/git.mk
diff --git a/tests/libecal/Makefile.am b/tests/libecal/Makefile.am
index 4227613f0..0e38d3345 100644
--- a/tests/libecal/Makefile.am
+++ b/tests/libecal/Makefile.am
@@ -1,5 +1,7 @@
SUBDIRS = client
+if !HAVE_E_CAL_DISABLE_DEPRECATED
+
noinst_LTLIBRARIES = libecal-test-utils.la
libecal_test_utils_la_SOURCES = ecal-test-utils.c ecal-test-utils.h
@@ -24,14 +26,6 @@ TEST_ECAL_LIBS = \
libecal-test-utils.la \
$(NULL)
-EXTRA_DIST = \
- $(test_scripts) \
- testdata.ics
-
-test_scripts = \
- test-runner.sh \
- cleanup.sh
-
# ordered by relative complexity
TESTS = \
test-ecal-remove \
@@ -154,4 +148,14 @@ test_search_LDADD = \
$(LIBICAL_LIBS) \
$(EVOLUTION_CALENDAR_LIBS)
+endif
+
+EXTRA_DIST = \
+ $(test_scripts) \
+ testdata.ics
+
+test_scripts = \
+ test-runner.sh \
+ cleanup.sh
+
-include $(top_srcdir)/git.mk
diff --git a/tests/libedataserverui/test-client-examine-auth.c b/tests/libedataserverui/test-client-examine-auth.c
index d76bf7049..0ebe70d85 100644
--- a/tests/libedataserverui/test-client-examine-auth.c
+++ b/tests/libedataserverui/test-client-examine-auth.c
@@ -148,9 +148,9 @@ continue_next_source (gpointer async_data)
while (async_data && foreach_configured_source_async_next (&async_data, &source)) {
identify_source (source);
- e_client_utils_open_new (source, source_type, TRUE,
+ e_client_utils_open_new (source, source_type, TRUE, NULL,
e_client_utils_authenticate_handler, NULL,
- NULL, client_opened_async, async_data);
+ client_opened_async, async_data);
break;
}
@@ -236,7 +236,7 @@ client_opened_async (GObject *source_object, GAsyncResult *result, gpointer asyn
g_return_if_fail (source_object == NULL);
g_return_if_fail (async_data != NULL);
- if (!e_client_utils_open_new_finish (result, &client, &error)) {
+ if (!e_client_utils_open_new_finish (E_SOURCE (source_object), result, &client, &error)) {
report_error ("client utils open new finish", &error);
continue_next_source (async_data);
return;
@@ -265,9 +265,9 @@ foreach_async (void)
running_async++;
identify_source (source);
- e_client_utils_open_new (source, source_type, TRUE,
+ e_client_utils_open_new (source, source_type, TRUE, NULL,
e_client_utils_authenticate_handler, NULL,
- NULL, client_opened_async, async_data);
+ client_opened_async, async_data);
return TRUE;
}
diff --git a/tests/libedataserverui/test-contact-store.c b/tests/libedataserverui/test-contact-store.c
index 456080113..c986662fd 100644
--- a/tests/libedataserverui/test-contact-store.c
+++ b/tests/libedataserverui/test-contact-store.c
@@ -64,7 +64,7 @@ start_test (const gchar *gconf_path)
GtkWidget *box;
GtkWidget *entry;
GtkTreeViewColumn *column;
- EBook *book;
+ EBookClient *book_client;
EBookQuery *book_query;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
@@ -94,10 +94,10 @@ start_test (const gchar *gconf_path)
gtk_container_add (GTK_CONTAINER (scrolled_window), tree_view);
- book = e_book_new_default_addressbook (NULL);
- e_book_open (book, TRUE, NULL);
- e_contact_store_add_book (contact_store, book);
- g_object_unref (book);
+ book_client = e_book_client_new_default (NULL);
+ e_client_open_sync (E_CLIENT (book_client), TRUE, NULL, NULL);
+ e_contact_store_add_client (contact_store, book_client);
+ g_object_unref (book_client);
book_query = e_book_query_any_field_contains ("");
e_contact_store_set_query (contact_store, book_query);