1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3
#include <libebook/e-book.h>
5
#include "ebook-test-utils.h"
8
main (gint argc, gchar **argv)
12
EContact *contact_final;
20
book = ebook_test_utils_book_new_temp (NULL);
21
ebook_test_utils_book_open (book, FALSE);
26
uid = ebook_test_utils_book_add_contact_from_test_case_verify (book, "simple-1", NULL);
27
ebook_test_utils_book_remove_contact (book, uid);
29
e_book_get_contact (book, uid, &contact_final, NULL);
31
g_assert (contact_final == NULL);
32
test_print ("successfully added and removed contact '%s'\n", uid);
34
ebook_test_utils_book_remove (book);
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 (book, contact_final,
50
ebook_test_utils_callback_quit, loop);
52
g_main_loop_run (loop);
54
ebook_test_utils_book_remove (book);
55
g_object_unref (contact_final);