[evolution-data-server/openismus-work-master: 4/7] client-test-utils.c: Optionally use direct access if DEBUG_DIRECT env var is set



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

    client-test-utils.c: Optionally use direct access if DEBUG_DIRECT env var is set

 tests/libebook/client/client-test-utils.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/tests/libebook/client/client-test-utils.c b/tests/libebook/client/client-test-utils.c
index f9bda66..1da94dc 100644
--- a/tests/libebook/client/client-test-utils.c
+++ b/tests/libebook/client/client-test-utils.c
@@ -29,6 +29,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)
@@ -331,7 +337,11 @@ 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);
+       if (g_getenv ("DEBUG_DIRECT") != NULL)
+               data->book = e_book_client_new_direct (data->registry, data->source, &error);
+       else
+               data->book = e_book_client_new (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]