[evolution-data-server/treitter-test-suites] Use consistent style with the new tests.



commit 085cee94b3ad756bbaa52e154419c783ee5812ed
Author: Travis Reitter <treitter gmail com>
Date:   Tue Dec 29 12:37:03 2009 -0800

    Use consistent style with the new tests.

 addressbook/tests/ebook/test-ebook-add-contact.c |  108 +++++++++++-----------
 addressbook/tests/ebook/test-ebook-get-contact.c |   92 +++++++++---------
 addressbook/tests/ebook/test-ebook-remove.c      |   24 +++---
 3 files changed, 112 insertions(+), 112 deletions(-)
---
diff --git a/addressbook/tests/ebook/test-ebook-add-contact.c b/addressbook/tests/ebook/test-ebook-add-contact.c
index 1e3ac72..1bc289b 100644
--- a/addressbook/tests/ebook/test-ebook-add-contact.c
+++ b/addressbook/tests/ebook/test-ebook-add-contact.c
@@ -9,63 +9,63 @@ gint
 main (gint argc, gchar **argv)
 {
 	EBook *book;
-        GMainLoop *loop;
-        EContact *contact;
-        EContact *contact_final;
-        char *uid;
-        const char *contact_final_uid;
+	GMainLoop *loop;
+	EContact *contact;
+	EContact *contact_final;
+	char *uid;
+	const char *contact_final_uid;
 
 	g_type_init ();
 
-        /*
-         * Setup
-         */
-        book = ebook_test_utils_book_new_temp (NULL);
-        ebook_test_utils_book_open (book, FALSE);
-
-        contact = e_contact_new_from_vcard (EBOOK_TEST_UTILS_VCARD_SIMPLE);
-        uid = g_strdup (ebook_test_utils_book_add_contact (book, contact));
-
-        /*
-         * Sync version
-         */
-        contact_final = ebook_test_utils_book_get_contact (book, uid);
-        contact_final_uid = e_contact_get_const (contact_final, E_CONTACT_UID);
-
-        /* This is not a thorough comparison (which is difficult, assuming we
-         * give the back-ends leniency in implementation), since that's better
-         * suited to more advanced tests */
-        if (g_strcmp0 (uid, contact_final_uid)) {
-                const char *uri;
-
-                uri = e_book_get_uri (book);
-
-                g_warning ("retrieved contact uid '%s' does not match added "
-                                "contact uid '%s'", contact_final_uid, uid);
-                exit(1);
-        }
-
-        g_print ("successfully added and retrieved contact '%s'\n", uid);
-        g_object_unref (contact);
-        g_object_unref (contact_final);
-
-        ebook_test_utils_book_remove (book);
-
-        /*
-         * Async version
-         */
-        book = ebook_test_utils_book_new_temp (NULL);
-        ebook_test_utils_book_open (book, FALSE);
-        contact = e_contact_new_from_vcard (EBOOK_TEST_UTILS_VCARD_SIMPLE);
-        
-        loop = g_main_loop_new (NULL, TRUE);
-        ebook_test_utils_book_async_add_contact (book, contact,
-                        (GSourceFunc) g_main_loop_quit, loop);
-                        
-        g_free (uid);
-        g_main_loop_run (loop);
-
-        ebook_test_utils_book_remove (book);
+	/*
+	 * Setup
+	 */
+	book = ebook_test_utils_book_new_temp (NULL);
+	ebook_test_utils_book_open (book, FALSE);
+
+	contact = e_contact_new_from_vcard (EBOOK_TEST_UTILS_VCARD_SIMPLE);
+	uid = g_strdup (ebook_test_utils_book_add_contact (book, contact));
+
+	/*
+	 * Sync version
+	 */
+	contact_final = ebook_test_utils_book_get_contact (book, uid);
+	contact_final_uid = e_contact_get_const (contact_final, E_CONTACT_UID);
+
+	/* This is not a thorough comparison (which is difficult, assuming we
+	 * give the back-ends leniency in implementation), since that's better
+	 * suited to more advanced tests */
+	if (g_strcmp0 (uid, contact_final_uid)) {
+		const char *uri;
+
+		uri = e_book_get_uri (book);
+
+		g_warning ("retrieved contact uid '%s' does not match added "
+				"contact uid '%s'", contact_final_uid, uid);
+		exit(1);
+	}
+
+	g_print ("successfully added and retrieved contact '%s'\n", uid);
+	g_object_unref (contact);
+	g_object_unref (contact_final);
+
+	ebook_test_utils_book_remove (book);
+
+	/*
+	 * Async version
+	 */
+	book = ebook_test_utils_book_new_temp (NULL);
+	ebook_test_utils_book_open (book, FALSE);
+	contact = e_contact_new_from_vcard (EBOOK_TEST_UTILS_VCARD_SIMPLE);
+
+	loop = g_main_loop_new (NULL, TRUE);
+	ebook_test_utils_book_async_add_contact (book, contact,
+			(GSourceFunc) g_main_loop_quit, loop);
+
+	g_free (uid);
+	g_main_loop_run (loop);
+
+	ebook_test_utils_book_remove (book);
 
 	return 0;
 }
diff --git a/addressbook/tests/ebook/test-ebook-get-contact.c b/addressbook/tests/ebook/test-ebook-get-contact.c
index f71fdeb..4ffd1d8 100644
--- a/addressbook/tests/ebook/test-ebook-get-contact.c
+++ b/addressbook/tests/ebook/test-ebook-get-contact.c
@@ -9,55 +9,55 @@ gint
 main (gint argc, gchar **argv)
 {
 	EBook *book;
-        GMainLoop *loop;
-        EContact *contact;
-        EContact *contact_final;
-        const char *uid;
-        const char *contact_final_uid;
+	GMainLoop *loop;
+	EContact *contact;
+	EContact *contact_final;
+	const char *uid;
+	const char *contact_final_uid;
 
 	g_type_init ();
 
-        /*
-         * Setup
-         */
-        book = ebook_test_utils_book_new_temp (NULL);
-        ebook_test_utils_book_open (book, FALSE);
-
-        contact = e_contact_new_from_vcard (EBOOK_TEST_UTILS_VCARD_SIMPLE);
-        uid = ebook_test_utils_book_add_contact (book, contact);
-
-        /*
-         * Sync version
-         */
-        contact_final = ebook_test_utils_book_get_contact (book, uid);
-        contact_final_uid = e_contact_get_const (contact_final, E_CONTACT_UID);
-
-        /* This is not a thorough comparison (which is difficult, assuming we
-         * give the back-ends leniency in implementation), since that's better
-         * suited to more advanced tests */
-        if (g_strcmp0 (uid, contact_final_uid)) {
-                const char *uri;
-
-                uri = e_book_get_uri (book);
-
-                g_warning ("retrieved contact uid '%s' does not match added "
-                                "contact uid '%s'", contact_final_uid, uid);
-                exit(1);
-        }
-
-        g_print ("successfully added and retrieved contact '%s'\n", uid);
-        g_object_unref (contact);
-        g_object_unref (contact_final);
-
-        /*
-         * Async version
-         */
-        loop = g_main_loop_new (NULL, TRUE);
-        ebook_test_utils_book_async_get_contact (book, uid,
-                        (GSourceFunc) g_main_loop_quit, loop);
-        g_main_loop_run (loop);
-
-        ebook_test_utils_book_remove (book);
+	/*
+	 * Setup
+	 */
+	book = ebook_test_utils_book_new_temp (NULL);
+	ebook_test_utils_book_open (book, FALSE);
+
+	contact = e_contact_new_from_vcard (EBOOK_TEST_UTILS_VCARD_SIMPLE);
+	uid = ebook_test_utils_book_add_contact (book, contact);
+
+	/*
+	 * Sync version
+	 */
+	contact_final = ebook_test_utils_book_get_contact (book, uid);
+	contact_final_uid = e_contact_get_const (contact_final, E_CONTACT_UID);
+
+	/* This is not a thorough comparison (which is difficult, assuming we
+	 * give the back-ends leniency in implementation), since that's better
+	 * suited to more advanced tests */
+	if (g_strcmp0 (uid, contact_final_uid)) {
+		const char *uri;
+
+		uri = e_book_get_uri (book);
+
+		g_warning ("retrieved contact uid '%s' does not match added "
+				"contact uid '%s'", contact_final_uid, uid);
+		exit(1);
+	}
+
+	g_print ("successfully added and retrieved contact '%s'\n", uid);
+	g_object_unref (contact);
+	g_object_unref (contact_final);
+
+	/*
+	 * Async version
+	 */
+	loop = g_main_loop_new (NULL, TRUE);
+	ebook_test_utils_book_async_get_contact (book, uid,
+			(GSourceFunc) g_main_loop_quit, loop);
+	g_main_loop_run (loop);
+
+	ebook_test_utils_book_remove (book);
 
 	return 0;
 }
diff --git a/addressbook/tests/ebook/test-ebook-remove.c b/addressbook/tests/ebook/test-ebook-remove.c
index 8d5d5c6..5011490 100644
--- a/addressbook/tests/ebook/test-ebook-remove.c
+++ b/addressbook/tests/ebook/test-ebook-remove.c
@@ -9,25 +9,25 @@ gint
 main (gint argc, gchar **argv)
 {
 	EBook *book;
-        char *uri = NULL;
-        GMainLoop *loop;
+	char *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);
+	/* 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);
+	/* Async version */
+	book = ebook_test_utils_book_new_temp (&uri);
+	ebook_test_utils_book_open (book, FALSE);
 
-        loop = g_main_loop_new (NULL, TRUE);
+	loop = g_main_loop_new (NULL, TRUE);
 	ebook_test_utils_book_async_remove (book,
-                        (GSourceFunc) g_main_loop_quit, loop);
+			(GSourceFunc) g_main_loop_quit, loop);
 
-        g_main_loop_run (loop);
+	g_main_loop_run (loop);
 
 	return 0;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]