1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 #include <libebook/libebook.h>
5 #include "ebook-test-utils.h"
13 EContact *contact_final;
21 book = ebook_test_utils_book_new_temp (NULL);
22 ebook_test_utils_book_open (book, FALSE);
27 uid = ebook_test_utils_book_add_contact_from_test_case_verify (book, "simple-1", NULL);
28 ebook_test_utils_book_remove_contact (book, uid);
30 e_book_get_contact (book, uid, &contact_final, NULL);
32 g_assert (contact_final == NULL);
33 test_print ("successfully added and removed contact '%s'\n", uid);
40 book = ebook_test_utils_book_new_temp (NULL);
41 ebook_test_utils_book_open (book, FALSE);
44 /* contact_final has 2 refs by the end of this */
45 uid = ebook_test_utils_book_add_contact_from_test_case_verify (book, "simple-1", &contact_final);
47 loop = g_main_loop_new (NULL, TRUE);
48 /* contact_final is unref'd by e_book_remove_contact() here */
49 ebook_test_utils_book_async_remove_contact (
50 book, contact_final, ebook_test_utils_callback_quit, loop);
52 g_main_loop_run (loop);
54 g_object_unref (contact_final);