Extending test-client-custom-summary to try e_book_client_get_contacts_uids()
authorTristan Van Berkom <tristanvb@openismus.com>
Thu, 29 Nov 2012 11:32:15 +0000 (20:32 +0900)
committerTristan Van Berkom <tristanvb@openismus.com>
Thu, 29 Nov 2012 11:38:07 +0000 (20:38 +0900)
tests/libebook/client/test-client-custom-summary.c

index 6000223..d536239 100644 (file)
@@ -231,6 +231,20 @@ main (gint argc,
        e_book_query_unref (query);
        g_free (sexp);
 
+       /* Query email suffix... fetching uids */
+       query = e_book_query_field_test (E_CONTACT_EMAIL, E_BOOK_QUERY_ENDS_WITH, "jackson.com");
+       sexp = e_book_query_to_string (query);
+
+       if (!e_book_client_get_contacts_uids_sync (book_client, sexp, &results, NULL, &error)) {
+               report_error ("get contacts", &error);
+               g_object_unref (book_client);
+               return 1;
+       }
+       g_assert_cmpint (g_slist_length (results), ==, 2);
+       e_util_free_string_slist (results);
+       e_book_query_unref (query);
+       g_free (sexp);
+
        if (!e_client_remove_sync (E_CLIENT (book_client), NULL, &error)) {
                report_error ("client remove sync", &error);
                g_object_unref (book_client);