[evolution-data-server] Removed obsolete test cases from tests/libebook



commit ac6233784e3683e5e8f9ae4cdfbecb8e162dc197
Author: Tristan Van Berkom <tristanvb openismus com>
Date:   Fri Mar 15 23:30:35 2013 +0900

    Removed obsolete test cases from tests/libebook
    
    Removed the following cases:
    
        deleted:    test-bulk-methods.c
        deleted:    test-changes.c
        deleted:    test-ebook-async.c
        deleted:    test-ebook-stress-factory--fifo.c
        deleted:    test-ebook-stress-factory--serial.c
        deleted:    test-ebook-stress-factory--single-book.c
        deleted:    test-ebook.c
        deleted:    test-nonexistent-id.c
        deleted:    test-search.c
        deleted:    test-self.c
        deleted:    test-stress-bookviews.c
    
    Many of these tests are covered by other cases, some of them are
    completely unsupported now (like test-changes.c).
    
    The ebook-test-utils.[ch] has been cleaned up to remove book
    creation / opening routines (which is now all covered by the
    test fixture).

 tests/libebook/Makefile.am                         |   37 ----
 tests/libebook/ebook-test-utils.c                  |  119 ------------
 tests/libebook/ebook-test-utils.h                  |   10 -
 tests/libebook/test-bulk-methods.c                 |  203 --------------------
 tests/libebook/test-changes.c                      |   66 -------
 tests/libebook/test-ebook-async.c                  |  121 ------------
 tests/libebook/test-ebook-stress-factory--fifo.c   |   30 ---
 tests/libebook/test-ebook-stress-factory--serial.c |   29 ---
 .../test-ebook-stress-factory--single-book.c       |   33 ----
 tests/libebook/test-ebook.c                        |  107 ----------
 tests/libebook/test-nonexistent-id.c               |   32 ---
 tests/libebook/test-search.c                       |   61 ------
 tests/libebook/test-self.c                         |   35 ----
 tests/libebook/test-stress-bookviews.c             |  115 -----------
 14 files changed, 0 insertions(+), 998 deletions(-)
---
diff --git a/tests/libebook/Makefile.am b/tests/libebook/Makefile.am
index 29770ea..05d2a3c 100644
--- a/tests/libebook/Makefile.am
+++ b/tests/libebook/Makefile.am
@@ -38,16 +38,6 @@ TEST_LIBS =                                  \
        libebook-test-utils.la                  \
        $(NULL)
 
-DEPRECATED_TESTS =                             \
-       test-changes                            \
-       test-ebook                              \
-       test-ebook-async                        \
-       test-nonexistent-id                     \
-       test-search                             \
-       test-self                               \
-       test-stress-bookviews                   \
-       test-bulk-methods
-
 ### EBookClient Tests ###
 
 # Should be kept ordered approximately from least to most difficult/complex
@@ -64,13 +54,8 @@ TESTS = \
        test-ebook-remove-contacts \
        test-ebook-get-book-view
 
-#      test-ebook-stress-factory--serial \
-#      test-ebook-stress-factory--fifo \
-#      test-ebook-stress-factory--single-book
-
 noinst_PROGRAMS = \
        $(TESTS)                                \
-       $(DEPRECATED_TESTS)                     \
        $(NULL)
 
 EXTRA_DIST = \
@@ -79,14 +64,6 @@ EXTRA_DIST = \
        $(srcdir)/data/vcards/simple-2.vcf      \
        $(NULL)
 
-test_bulk_methods_LDADD=$(TEST_LIBS)
-test_bulk_methods_CPPFLAGS=$(TEST_CPPFLAGS)
-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)
-test_ebook_async_CPPFLAGS=$(TEST_CPPFLAGS)
 test_ebook_commit_contact_LDADD=$(TEST_LIBS)
 test_ebook_commit_contact_CPPFLAGS=$(TEST_CPPFLAGS)
 test_ebook_get_book_view_LDADD=$(TEST_LIBS)
@@ -109,19 +86,5 @@ test_ebook_remove_contact_by_id_LDADD=$(TEST_LIBS)
 test_ebook_remove_contact_by_id_CPPFLAGS=$(TEST_CPPFLAGS)
 test_ebook_remove_contacts_LDADD=$(TEST_LIBS)
 test_ebook_remove_contacts_CPPFLAGS=$(TEST_CPPFLAGS)
-#test_ebook_stress_factory__fifo_LDADD=$(TEST_LIBS)
-test_ebook_stress_factory__fifo_CPPFLAGS=$(TEST_CPPFLAGS)
-#test_ebook_stress_factory__serial_LDADD=$(TEST_LIBS)
-test_ebook_stress_factory__serial_CPPFLAGS=$(TEST_CPPFLAGS)
-#test_ebook_stress_factory__single_book_LDADD=$(TEST_LIBS)
-test_ebook_stress_factory__single_book_CPPFLAGS=$(TEST_CPPFLAGS)
-test_changes_LDADD=$(TEST_LIBS)
-test_changes_CPPFLAGS=$(TEST_CPPFLAGS)
-test_nonexistent_id_LDADD=$(TEST_LIBS)
-test_nonexistent_id_CPPFLAGS=$(TEST_CPPFLAGS)
-test_self_LDADD=$(TEST_LIBS)
-test_self_CPPFLAGS=$(TEST_CPPFLAGS)
-test_stress_bookviews_LDADD=$(TEST_LIBS)
-test_stress_bookviews_CPPFLAGS=$(TEST_CPPFLAGS)
 
 -include $(top_srcdir)/git.mk
diff --git a/tests/libebook/ebook-test-utils.c b/tests/libebook/ebook-test-utils.c
index 23bec99..87d4697 100644
--- a/tests/libebook/ebook-test-utils.c
+++ b/tests/libebook/ebook-test-utils.c
@@ -660,125 +660,6 @@ ebook_test_utils_book_async_remove_contacts (EBook *book,
        }
 }
 
-typedef struct {
-       GMainLoop *loop;
-       const gchar *uid;
-       ESourceRegistry *registry;
-       ESource *scratch;
-       ESource *source;
-       EBook *book;
-} CreateBookData;
-
-static gboolean
-quit_idle (CreateBookData *data)
-{
-       g_main_loop_quit (data->loop);
-       return FALSE;
-}
-
-static gboolean
-create_book_idle (CreateBookData *data)
-{
-       GError *error = NULL;
-
-       data->source = e_source_registry_ref_source (data->registry, data->uid);
-       if (!data->source)
-               g_error ("Unable to fetch newly created source uid '%s' from the registry", data->uid);
-
-       data->book = e_book_new (data->source, &error);
-       if (!data->book)
-               g_error ("Unable to create the book: %s", error->message);
-
-       g_idle_add ((GSourceFunc) quit_idle, data);
-
-       return FALSE;
-}
-
-static gboolean
-register_source_idle (CreateBookData *data)
-{
-       GError *error = NULL;
-       ESourceBackend  *backend;
-
-       data->registry = e_source_registry_new_sync (NULL, &error);
-       if (!data->registry)
-               g_error ("Unable to create the registry: %s", error->message);
-
-       data->scratch = e_source_new_with_uid (data->uid, NULL, &error);
-       if (!data->scratch)
-               g_error ("Failed to create source with uid '%s': %s", data->uid, error->message);
-
-       backend = e_source_get_extension (data->scratch, E_SOURCE_EXTENSION_ADDRESS_BOOK);
-       e_source_backend_set_backend_name (backend, "local");
-
-       if (!e_source_registry_commit_source_sync (data->registry, data->scratch, NULL, &error))
-               g_error ("Unable to add new source to the registry for uid %s: %s", data->uid, 
error->message);
-
-       /* XXX e_source_registry_commit_source_sync isnt really sync... or else
-        * we could call e_source_registry_ref_source() immediately
-        */
-       g_timeout_add (20, (GSourceFunc) create_book_idle, data);
-
-       return FALSE;
-}
-
-static EBook *
-ebook_test_utils_book_with_uid (const gchar *uid)
-{
-       CreateBookData data = { 0, };
-
-       data.uid = uid;
-
-       data.loop = g_main_loop_new (NULL, FALSE);
-       g_idle_add ((GSourceFunc) register_source_idle, &data);
-       g_main_loop_run (data.loop);
-       g_main_loop_unref (data.loop);
-
-       g_object_unref (data.scratch);
-       g_object_unref (data.source);
-       g_object_unref (data.registry);
-
-       return data.book;
-}
-
-EBook *
-ebook_test_utils_book_new_temp (gchar **uri)
-{
-       EBook *book;
-       gchar *uid;
-       guint64 real_time = g_get_real_time ();
-
-       uid  = g_strdup_printf ("test-book-%" G_GINT64_FORMAT, real_time);
-       book = ebook_test_utils_book_with_uid (uid);
-
-       if (uri)
-               *uri = g_strdup (uid);
-
-       g_free (uid);
-
-       return book;
-}
-
-void
-ebook_test_utils_book_open (EBook *book,
-                            gboolean only_if_exists)
-{
-       GError *error = NULL;
-
-       if (!e_book_open (book, only_if_exists, &error)) {
-               ESource *source;
-               const gchar *name;
-
-               source = e_book_get_source (book);
-               name = e_source_get_display_name (source);
-
-               g_warning (
-                       "failed to open addressbook: `%s': %s", name,
-                       error->message);
-               exit (1);
-       }
-}
-
 void
 ebook_test_utils_book_get_book_view (EBook *book,
                                      EBookQuery *query,
diff --git a/tests/libebook/ebook-test-utils.h b/tests/libebook/ebook-test-utils.h
index d8d00cd..781771d 100644
--- a/tests/libebook/ebook-test-utils.h
+++ b/tests/libebook/ebook-test-utils.h
@@ -53,12 +53,6 @@ gboolean
 ebook_test_utils_contacts_are_equal_shallow (EContact *a,
                                              EContact *b);
 
-EBook *
-ebook_test_utils_book_new_from_uri (const gchar *uri);
-
-EBook *
-ebook_test_utils_book_new_temp (gchar **uri);
-
 const gchar *
 ebook_test_utils_book_add_contact (EBook    *book,
                                    EContact *contact);
@@ -134,10 +128,6 @@ ebook_test_utils_book_async_remove_contacts (EBook       *book,
                                              gpointer     user_data);
 
 void
-ebook_test_utils_book_open (EBook    *book,
-                            gboolean  only_if_exists);
-
-void
 ebook_test_utils_book_get_book_view (EBook       *book,
                                      EBookQuery  *query,
                                      EBookView  **view);


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