gint
main (gint argc, gchar **argv)
{
	gchar *uri = NULL;
	EBook *book;
	gint i;

	g_type_init ();

	book = ebook_test_utils_book_new_temp (&uri);
	g_object_unref (book);

	/* open and close the same book repeatedly */
	for (i = 0; i < NUM_OPENS-1; i++) {
		book = ebook_test_utils_book_new_from_uri (uri);
		ebook_test_utils_book_open (book, FALSE);
		g_object_unref (book);
	}

	book = ebook_test_utils_book_new_from_uri (uri);
	ebook_test_utils_book_remove (book);

	g_free (uri);

	return 0;
}
コード例 #2
0
gint
main (gint argc,
      gchar **argv)
{
	EBook *book;
	gchar *uri = NULL;
	GMainLoop *loop;

	g_type_init ();

	/* Sync version */
	book = ebook_test_utils_book_new_temp (&uri);
	ebook_test_utils_book_open (book, FALSE);
	ebook_test_utils_book_remove (book);

	/* Async version */
	book = ebook_test_utils_book_new_temp (&uri);
	ebook_test_utils_book_open (book, FALSE);

	loop = g_main_loop_new (NULL, TRUE);
	ebook_test_utils_book_async_remove (book,
			ebook_test_utils_callback_quit, loop);

	g_main_loop_run (loop);

	return 0;
}
コード例 #3
0
gint
main (gint argc,
      gchar **argv)
{
	EBook *book;
	GMainLoop *loop;
	gchar *uid;

	g_type_init ();

        /*
         * Async version
         */
	book = ebook_test_utils_book_new_temp (NULL);
	ebook_test_utils_book_open (book, FALSE);

	uid = ebook_test_utils_book_add_contact_from_test_case_verify (book, "simple-1", NULL);

	loop = g_main_loop_new (NULL, TRUE);
	ebook_test_utils_book_async_remove_contact_by_id (book, uid,
			ebook_test_utils_callback_quit, loop);

	g_main_loop_run (loop);

	ebook_test_utils_book_remove (book);
	g_free (uid);

	return 0;
}
コード例 #4
0
gint
main (gint argc,
      gchar **argv)
{
	EBook *book;
	EBookQuery *query;
	EBookView *view;

	g_type_init ();

	/*
	 * Sync version
	 */
	setup_book (&book);
	query = e_book_query_any_field_contains ("");
	ebook_test_utils_book_get_book_view (book, query, &view);
	setup_and_start_view (view);

	test_print ("successfully set up the book view\n");

	loop = g_main_loop_new (NULL, TRUE);
	g_main_loop_run (loop);

	e_book_query_unref (query);
	ebook_test_utils_book_remove (book);

	/*
	 * Async version
	 */
	setup_book (&book);
	query = e_book_query_any_field_contains ("");

	loop = g_main_loop_new (NULL, TRUE);
	ebook_test_utils_book_async_get_book_view (book, query,
			(GSourceFunc) get_book_view_cb, loop);

	g_main_loop_run (loop);

	e_book_query_unref (query);
	ebook_test_utils_book_remove (book);

	return 0;
}