test-client-uid-only-view: Fixed test
authorTristan Van Berkom <tristanvb@openismus.com>
Fri, 29 Nov 2013 12:48:58 +0000 (21:48 +0900)
committerTristan Van Berkom <tristanvb@openismus.com>
Fri, 29 Nov 2013 13:08:03 +0000 (22:08 +0900)
Now we aren't filtering by fields of interest for contact changes,
so disabled the part of the test which adds a contact.

This can be reverted if we so decide to filter it manually
in EDataBookView

tests/libebook/client/test-client-uid-only-view.c

index b1f973f..46f3f94 100644 (file)
@@ -35,25 +35,11 @@ static UIDOnlyClosure book_closure_uids_only_async = { { E_TEST_SERVER_ADDRESS_B
 #  define PRINT_TIMER(timer, activity)
 #endif
 
-static gboolean loading_view = FALSE;
 static gboolean uids_only    = FALSE;
 
 /****************************************************************
  *                     Modify/Setup the EBook                   *
  ****************************************************************/
-static void
-add_contact (EBookClient *client)
-{
-       EContact *contact = e_contact_new ();
-
-       e_contact_set (contact, E_CONTACT_FULL_NAME, "Micheal Jackson");
-
-       if (!add_contact_verify (client, contact))
-               g_error ("Failed to add Micheal Jackson");
-
-       g_object_unref (contact);
-}
-
 static gboolean
 setup_book (EBookClient *book_client)
 {
@@ -152,7 +138,6 @@ objects_added (EBookClientView *view,
                gpointer user_data)
 {
        const GSList *l;
-       GMainLoop *loop = (GMainLoop *) user_data;
 
        for (l = contacts; l; l = l->next) {
                EContact *contact = l->data;
@@ -168,10 +153,6 @@ objects_added (EBookClientView *view,
                else if (!uids_only && e_contact_get_const (contact, E_CONTACT_FULL_NAME) == NULL)
                        g_error ("expected contact name missing");
        }
-
-       if (!loading_view)
-               finish_test (view, loop);
-
 }
 
 static void
@@ -187,17 +168,12 @@ objects_removed (EBookClientView *view,
 
 static void
 complete (EBookClientView *view,
-          const GError *error)
+          const GError *error,
+         gpointer user_data)
 {
-       EBookClient *client;
-
-       client = e_book_client_view_ref_client (view);
-
-       /* Now add a contact and assert that we received notification */
-       loading_view = FALSE;
-       add_contact (client);
+       GMainLoop *loop = (GMainLoop *) user_data;
 
-       g_object_unref (client);
+       finish_test (view, loop);
 }
 
 static void
@@ -221,8 +197,6 @@ setup_and_start_view (EBookClientView *view,
        if (error)
                g_error ("set fields of interest: %s", error->message);
 
-       loading_view = TRUE;
-
        e_book_client_view_start (view, &error);
        if (error)
                g_error ("start view: %s", error->message);