[evolution-data-server/openismus-work-master: 6/8] Make the libebook tests use direct read access by default



commit d4d6b4a580d371302d83f69c6a77d0a18a70e952
Author: Tristan Van Berkom <tristanvb openismus com>
Date:   Tue Nov 6 16:18:56 2012 +0900

    Make the libebook tests use direct read access by default

 tests/libebook/client/Makefile.am                  |    1 +
 tests/libebook/client/client-test-utils.c          |    8 +++++++-
 tests/libebook/client/test-client-custom-summary.c |    2 +-
 3 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/tests/libebook/client/Makefile.am b/tests/libebook/client/Makefile.am
index 5e312d1..38db8dc 100644
--- a/tests/libebook/client/Makefile.am
+++ b/tests/libebook/client/Makefile.am
@@ -8,6 +8,7 @@ libclient_test_utils_la_CPPFLAGS =				\
 	-I$(top_builddir)					\
 	-I$(top_srcdir)/addressbook				\
 	-I$(top_builddir)/addressbook				\
+	-DBACKENDDIR=\"$(ebook_backenddir)\" 			\
 	-DSRCDIR=\""$(srcdir)"\"				\
 	$(EVOLUTION_ADDRESSBOOK_CFLAGS)				\
 	$(CAMEL_CFLAGS)						\
diff --git a/tests/libebook/client/client-test-utils.c b/tests/libebook/client/client-test-utils.c
index 26cce75..0e8cd27 100644
--- a/tests/libebook/client/client-test-utils.c
+++ b/tests/libebook/client/client-test-utils.c
@@ -7,6 +7,12 @@
 
 #include "client-test-utils.h"
 
+/* This forces the GType to be registered in a way that
+ * avoids a "statement with no effect" compiler warning.
+ * FIXME Use g_type_ensure() once we require GLib 2.34. */
+#define REGISTER_TYPE(type) \
+	(g_type_class_unref (g_type_class_ref (type)))
+
 void
 report_error (const gchar *operation,
               GError **error)
@@ -309,7 +315,7 @@ create_book_idle (CreateBookData *data)
 	if (!data->source)
 		g_error ("Unable to fetch newly created source uid '%s' from the registry", data->uid);
 
-	data->book = e_book_client_new (data->source, &error);
+	data->book = e_book_client_new_direct (data->registry, data->source, &error);
 	if (!data->book)
 		g_error ("Unable to create the book: %s", error->message);
 
diff --git a/tests/libebook/client/test-client-custom-summary.c b/tests/libebook/client/test-client-custom-summary.c
index d536239..ff46235 100644
--- a/tests/libebook/client/test-client-custom-summary.c
+++ b/tests/libebook/client/test-client-custom-summary.c
@@ -34,7 +34,7 @@ create_book_idle (CreateBookData *data)
 	if (!data->source)
 		g_error ("Unable to fetch newly created source uid '%s' from the registry", data->uid);
 
-	data->book = e_book_client_new (data->source, &error);
+	data->book = e_book_client_new_direct (data->registry, data->source, &error);
 	if (!data->book)
 		g_error ("Unable to create the book: %s", error->message);
 



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