# HG changeset patch
# Node ID c33c29175a7fab86a0c8dc26b66411deec538c72
# Parent  42a6367d2154c455e079197905a5459dbb51e831
diff --git a/libpurple/tests/test_authorization_request.c b/libpurple/tests/test_authorization_request.c
--- a/libpurple/tests/test_authorization_request.c
+++ b/libpurple/tests/test_authorization_request.c
@@ -20,8 +20,6 @@
 
 #include <purple.h>
 
-#include "test_ui.h"
-
 /******************************************************************************
  * Callbacks
  *****************************************************************************/
@@ -29,27 +27,27 @@
 test_purple_authorization_request_accepted_counter_cb(G_GNUC_UNUSED PurpleAuthorizationRequest *request,
                                                       gpointer data)
 {
-	gint *counter = data;
+	guint *counter = data;
 
 	*counter = *counter + 1;
 }
 
 static void
 test_purple_authorization_request_denied_counter_cb(G_GNUC_UNUSED PurpleAuthorizationRequest *request,
-                                                    G_GNUC_UNUSED const gchar *message,
+                                                    G_GNUC_UNUSED const char *message,
                                                     gpointer data)
 {
-	gint *counter = data;
+	guint *counter = data;
 
 	*counter = *counter + 1;
 }
 
 static void
 test_purple_authorization_request_denied_message_cb(G_GNUC_UNUSED PurpleAuthorizationRequest *request,
-                                                    const gchar *message,
+                                                    const char *message,
                                                     gpointer data)
 {
-	gchar *expected = data;
+	char *expected = data;
 
 	g_assert_cmpstr(message, ==, expected);
 }
@@ -61,7 +59,7 @@
 test_purple_authorization_request_new(void) {
 	PurpleAccount *account1 = NULL, *account2 = NULL;
 	PurpleAuthorizationRequest *request = NULL;
-	const gchar *username = NULL;
+	const char *username = NULL;
 
 	account1 = purple_account_new("test", "test");
 
@@ -120,7 +118,7 @@
 	if(g_test_subprocess()) {
 		PurpleAccount *account = NULL;
 		PurpleAuthorizationRequest *request = NULL;
-		gint counter = 0;
+		guint counter = 0;
 
 		account = purple_account_new("test", "test");
 		request = purple_authorization_request_new(account, "username");
@@ -133,11 +131,11 @@
 
 		/* Accept the request and verify that the callback was called. */
 		purple_authorization_request_accept(request);
-		g_assert_cmpint(counter, ==, 1);
+		g_assert_cmpuint(counter, ==, 1);
 
 		/* Accept the request again to trigger the critical. */
 		purple_authorization_request_accept(request);
-		g_assert_cmpint(counter, ==, 1);
+		g_assert_cmpuint(counter, ==, 1);
 
 		/* Cleanup. */
 		g_clear_object(&account);
@@ -153,7 +151,7 @@
 	if(g_test_subprocess()) {
 		PurpleAccount *account = NULL;
 		PurpleAuthorizationRequest *request = NULL;
-		gint counter = 0;
+		guint counter = 0;
 
 		account = purple_account_new("test", "test");
 		request = purple_authorization_request_new(account, "username");
@@ -169,11 +167,11 @@
 
 		/* Accept the request and verify that the callback was called. */
 		purple_authorization_request_accept(request);
-		g_assert_cmpint(counter, ==, 1);
+		g_assert_cmpuint(counter, ==, 1);
 
 		/* Deny the request to trigger the critical. */
 		purple_authorization_request_deny(request, NULL);
-		g_assert_cmpint(counter, ==, 1);
+		g_assert_cmpuint(counter, ==, 1);
 
 		/* Cleanup. */
 		g_clear_object(&account);
@@ -189,7 +187,7 @@
 	if(g_test_subprocess()) {
 		PurpleAccount *account = NULL;
 		PurpleAuthorizationRequest *request = NULL;
-		gint counter = 0;
+		guint counter = 0;
 
 		account = purple_account_new("test", "test");
 		request = purple_authorization_request_new(account, "username");
@@ -202,11 +200,11 @@
 
 		/* Deny the request and verify that the callback was called. */
 		purple_authorization_request_deny(request, NULL);
-		g_assert_cmpint(counter, ==, 1);
+		g_assert_cmpuint(counter, ==, 1);
 
 		/* Deny the request again to trigger the critical. */
 		purple_authorization_request_deny(request, NULL);
-		g_assert_cmpint(counter, ==, 1);
+		g_assert_cmpuint(counter, ==, 1);
 
 		/* Cleanup. */
 		g_clear_object(&account);
@@ -222,7 +220,7 @@
 	if(g_test_subprocess()) {
 		PurpleAccount *account = NULL;
 		PurpleAuthorizationRequest *request = NULL;
-		gint counter = 0;
+		guint counter = 0;
 
 		account = purple_account_new("test", "test");
 		request = purple_authorization_request_new(account, "username");
@@ -238,11 +236,11 @@
 
 		/* Deny the request and verify that the callback was called. */
 		purple_authorization_request_deny(request, NULL);
-		g_assert_cmpint(counter, ==, 1);
+		g_assert_cmpuint(counter, ==, 1);
 
 		/* Deny the request again to trigger the critical. */
 		purple_authorization_request_accept(request);
-		g_assert_cmpint(counter, ==, 1);
+		g_assert_cmpuint(counter, ==, 1);
 
 		/* Cleanup. */
 		g_clear_object(&account);
@@ -300,13 +298,10 @@
 /******************************************************************************
  * Main
  *****************************************************************************/
-gint
-main(gint argc, gchar *argv[]) {
-	gint ret = 0;
-
+int
+main(int argc, char *argv[]) {
 	g_test_init(&argc, &argv, NULL);
-
-	test_ui_purple_init();
+	g_test_set_nonfatal_assertions();
 
 	g_test_add_func("/request-authorization/new",
 	                test_purple_authorization_request_new);
@@ -327,9 +322,5 @@
 	g_test_add_func("/request-authorization/deny-message/non-null",
 	                test_purple_authorization_request_deny_message_non_null);
 
-	ret = g_test_run();
-
-	test_ui_purple_uninit();
-
-	return ret;
+	return g_test_run();
 }
diff --git a/libpurple/tests/test_contact.c b/libpurple/tests/test_contact.c
--- a/libpurple/tests/test_contact.c
+++ b/libpurple/tests/test_contact.c
@@ -20,8 +20,6 @@
 
 #include <purple.h>
 
-#include "test_ui.h"
-
 /******************************************************************************
  * Tests
  *****************************************************************************/
@@ -81,22 +79,15 @@
 /******************************************************************************
  * Main
  *****************************************************************************/
-gint
-main(gint argc, gchar *argv[]) {
-	gint ret = 0;
-
+int
+main(int argc, char *argv[]) {
 	g_test_init(&argc, &argv, NULL);
-
-	test_ui_purple_init();
+	g_test_set_nonfatal_assertions();
 
 	g_test_add_func("/contact/new",
 	                test_purple_contact_new);
 	g_test_add_func("/contact/properties",
 	                test_purple_contact_properties);
 
-	ret = g_test_run();
-
-	test_ui_purple_uninit();
-
-	return ret;
+	return g_test_run();
 }
diff --git a/libpurple/tests/test_contact_info.c b/libpurple/tests/test_contact_info.c
--- a/libpurple/tests/test_contact_info.c
+++ b/libpurple/tests/test_contact_info.c
@@ -22,8 +22,6 @@
 
 #include <purple.h>
 
-#include "test_ui.h"
-
 /******************************************************************************
  * Tests
  *****************************************************************************/
@@ -525,13 +523,10 @@
 /******************************************************************************
  * Main
  *****************************************************************************/
-gint
-main(gint argc, gchar *argv[]) {
-	gint ret = 0;
-
+int
+main(int argc, char *argv[]) {
 	g_test_init(&argc, &argv, NULL);
-
-	test_ui_purple_init();
+	g_test_set_nonfatal_assertions();
 
 	g_test_add_func("/contact-info/new",
 	                test_purple_contact_info_new);
@@ -581,9 +576,5 @@
 	g_test_add_func("/contact-info/get_menu",
 	                test_purple_contact_info_get_menu);
 
-	ret = g_test_run();
-
-	test_ui_purple_uninit();
-
-	return ret;
+	return g_test_run();
 }
diff --git a/libpurple/tests/test_contact_manager.c b/libpurple/tests/test_contact_manager.c
--- a/libpurple/tests/test_contact_manager.c
+++ b/libpurple/tests/test_contact_manager.c
@@ -22,8 +22,6 @@
 
 #include <birb.h>
 
-#include "test_ui.h"
-
 /******************************************************************************
  * Callbacks
  *****************************************************************************/
@@ -41,19 +39,6 @@
  * Tests
  *****************************************************************************/
 static void
-test_purple_contact_manager_get_default(void) {
-	PurpleContactManager *manager1 = NULL, *manager2 = NULL;
-
-	manager1 = purple_contact_manager_get_default();
-	g_assert_true(PURPLE_IS_CONTACT_MANAGER(manager1));
-
-	manager2 = purple_contact_manager_get_default();
-	g_assert_true(PURPLE_IS_CONTACT_MANAGER(manager2));
-
-	g_assert_true(manager1 == manager2);
-}
-
-static void
 test_purple_contact_manager_add_remove(void) {
 	PurpleAccount *account = NULL;
 	PurpleContactManager *manager = NULL;
@@ -439,16 +424,11 @@
 /******************************************************************************
  * Main
  *****************************************************************************/
-gint
-main(gint argc, gchar *argv[]) {
-	gint ret = 0;
-
+int
+main(int argc, char *argv[]) {
 	g_test_init(&argc, &argv, NULL);
-
-	test_ui_purple_init();
+	g_test_set_nonfatal_assertions();
 
-	g_test_add_func("/contact-manager/get-default",
-	                test_purple_contact_manager_get_default);
 	g_test_add_func("/contact-manager/add-remove",
 	                test_purple_contact_manager_add_remove);
 	g_test_add_func("/contact-manager/double-add",
@@ -472,9 +452,5 @@
 	g_test_add_func("/contact-manager/propagate-populate-menu",
 	                test_purple_contact_manager_propagate_populate_menu);
 
-	ret = g_test_run();
-
-	test_ui_purple_uninit();
-
-	return ret;
+	return g_test_run();
 }
diff --git a/libpurple/tests/test_conversation_manager.c b/libpurple/tests/test_conversation_manager.c
--- a/libpurple/tests/test_conversation_manager.c
+++ b/libpurple/tests/test_conversation_manager.c
@@ -20,8 +20,6 @@
 
 #include <purple.h>
 
-#include "test_ui.h"
-
 /******************************************************************************
  * Callbacks
  *****************************************************************************/
@@ -366,13 +364,10 @@
 /******************************************************************************
  * Main
  *****************************************************************************/
-gint
-main(gint argc, gchar *argv[]) {
-	gint ret = 0;
-
+int
+main(int argc, char *argv[]) {
 	g_test_init(&argc, &argv, NULL);
-
-	test_ui_purple_init();
+	g_test_set_nonfatal_assertions();
 
 	g_test_add_func("/conversation-manager/new/null",
 	                test_purple_conversation_manager_new_null);
@@ -394,9 +389,5 @@
 	g_test_add_func("/conversation-manager/find-dm/does-not-exist",
 	                test_purple_conversation_manager_find_dm_does_not_exist);
 
-	ret = g_test_run();
-
-	test_ui_purple_uninit();
-
-	return ret;
+	return g_test_run();
 }
diff --git a/libpurple/tests/test_conversation_member.c b/libpurple/tests/test_conversation_member.c
--- a/libpurple/tests/test_conversation_member.c
+++ b/libpurple/tests/test_conversation_member.c
@@ -225,9 +225,10 @@
 /******************************************************************************
  * Main
  *****************************************************************************/
-gint
-main(gint argc, gchar *argv[]) {
+int
+main(int argc, char *argv[]) {
 	g_test_init(&argc, &argv, NULL);
+	g_test_set_nonfatal_assertions();
 
 	g_test_add_func("/conversation-member/new",
 	                test_purple_conversation_member_new);
diff --git a/libpurple/tests/test_create_conversation_details.c b/libpurple/tests/test_create_conversation_details.c
--- a/libpurple/tests/test_create_conversation_details.c
+++ b/libpurple/tests/test_create_conversation_details.c
@@ -76,6 +76,7 @@
 int
 main(int argc, char *argv[]) {
 	g_test_init(&argc, &argv, NULL);
+	g_test_set_nonfatal_assertions();
 
 	g_test_add_func("/create-conversation-details/new",
 	                test_purple_create_conversation_details_new);
diff --git a/libpurple/tests/test_file_transfer.c b/libpurple/tests/test_file_transfer.c
--- a/libpurple/tests/test_file_transfer.c
+++ b/libpurple/tests/test_file_transfer.c
@@ -21,8 +21,6 @@
 
 #include <purple.h>
 
-#include "test_ui.h"
-
 /******************************************************************************
  * Tests
  *****************************************************************************/
@@ -176,13 +174,10 @@
 /******************************************************************************
  * Main
  *****************************************************************************/
-gint
-main(gint argc, gchar *argv[]) {
-	gint ret = 0;
-
+int
+main(int argc, char *argv[]) {
 	g_test_init(&argc, &argv, NULL);
-
-	test_ui_purple_init();
+	g_test_set_nonfatal_assertions();
 
 	g_test_add_data_func("/file-transfer/new/send", argv[0],
 	                     test_purple_file_transfer_new_send);
@@ -191,9 +186,5 @@
 	g_test_add_data_func("/file-transfer/properties", argv[0],
 	                     test_file_transfer_properties);
 
-	ret = g_test_run();
-
-	test_ui_purple_uninit();
-
-	return ret;
+	return g_test_run();
 }
diff --git a/libpurple/tests/test_file_transfer_manager.c b/libpurple/tests/test_file_transfer_manager.c
--- a/libpurple/tests/test_file_transfer_manager.c
+++ b/libpurple/tests/test_file_transfer_manager.c
@@ -20,8 +20,6 @@
 
 #include <purple.h>
 
-#include "test_ui.h"
-
 /******************************************************************************
  * Add/Remove Test
  *****************************************************************************/
@@ -153,25 +151,16 @@
 /******************************************************************************
  * Main
  *****************************************************************************/
-gint
-main(gint argc, gchar *argv[]) {
-	gint ret = 0;
-
+int
+main(int argc, char *argv[]) {
 	g_test_init(&argc, &argv, NULL);
-
 	g_test_set_nonfatal_assertions();
 
-	test_ui_purple_init();
-
 	g_test_add_func("/file-transfer-manager/add-remove",
 	                test_purple_file_transfer_manager_add_remove);
 
 	g_test_add_func("/file-transfer-manager/propagates-notify",
 	                test_purple_file_transfer_manager_propagates_notify);
 
-	ret = g_test_run();
-
-	test_ui_purple_uninit();
-
-	return ret;
+	return g_test_run();
 }
diff --git a/libpurple/tests/test_idle_manager.c b/libpurple/tests/test_idle_manager.c
--- a/libpurple/tests/test_idle_manager.c
+++ b/libpurple/tests/test_idle_manager.c
@@ -176,9 +176,10 @@
 /******************************************************************************
  * Main
  *****************************************************************************/
-gint
+int
 main(int argc, char **argv) {
 	g_test_init(&argc, &argv, NULL);
+	g_test_set_nonfatal_assertions();
 
 	g_test_add_func("/idle-manager/new", test_purple_idle_manager_new);
 	g_test_add_func("/idle-manager/single-source",
diff --git a/libpurple/tests/test_image.c b/libpurple/tests/test_image.c
--- a/libpurple/tests/test_image.c
+++ b/libpurple/tests/test_image.c
@@ -58,9 +58,9 @@
 _test_image(PurpleImage *image,
             const guint8 *edata,
             gsize elen,
-            const gchar *path,
-            const gchar *ext,
-            const gchar *mimetype)
+            const char *path,
+            const char *ext,
+            const char *mimetype)
 {
 	GBytes *bytes = NULL;
 	const guint8 *adata = NULL;
@@ -79,7 +79,7 @@
 	if(path != NULL) {
 		g_assert_cmpstr(purple_image_get_path(image), ==, path);
 	} else {
-		const gchar *apath = purple_image_get_path(image);
+		const char *apath = purple_image_get_path(image);
 
 		g_assert(apath);
 		g_assert_cmpstr(apath, !=, "");
@@ -133,8 +133,8 @@
 test_image_new_from_file(void) {
 	PurpleImage *image = NULL;
 	GError *error = NULL;
-	gchar *path = NULL;
-	gchar *edata = NULL;
+	char *path = NULL;
+	char *edata = NULL;
 	gsize elen;
 
 	path = g_build_filename(TEST_DATA_DIR, "test-image.png", NULL);
@@ -160,10 +160,9 @@
 /******************************************************************************
  * Main
  *****************************************************************************/
-gint
-main(gint argc, gchar **argv) {
+int
+main(int argc, char **argv) {
 	g_test_init(&argc, &argv, NULL);
-
 	g_test_set_nonfatal_assertions();
 
 	g_test_add_func("/image/new-from-bytes", test_image_new_from_bytes);
diff --git a/libpurple/tests/test_keyvaluepair.c b/libpurple/tests/test_keyvaluepair.c
--- a/libpurple/tests/test_keyvaluepair.c
+++ b/libpurple/tests/test_keyvaluepair.c
@@ -95,18 +95,14 @@
 /******************************************************************************
  * Main
  *****************************************************************************/
-gint
-main(gint argc, gchar **argv) {
+int
+main(int argc, char **argv) {
 	g_test_init(&argc, &argv, NULL);
-
 	g_test_set_nonfatal_assertions();
 
-	g_test_add_func("/key-value-pair/new",
-	                test_key_value_pair_new);
-	g_test_add_func("/key-value-pair/new-full",
-	                test_key_value_pair_new_full);
-	g_test_add_func("/key-value-pair/copy",
-	                test_key_value_pair_copy);
+	g_test_add_func("/key-value-pair/new", test_key_value_pair_new);
+	g_test_add_func("/key-value-pair/new-full", test_key_value_pair_new_full);
+	g_test_add_func("/key-value-pair/copy", test_key_value_pair_copy);
 	g_test_add_func("/key-value-pair/copy-allocated",
 	                test_key_value_pair_copy_allocated);
 	g_test_add_func("/key-value-pair/copy-allocated/subprocess",
diff --git a/libpurple/tests/test_markup.c b/libpurple/tests/test_markup.c
--- a/libpurple/tests/test_markup.c
+++ b/libpurple/tests/test_markup.c
@@ -25,14 +25,14 @@
 #include <purple.h>
 
 typedef struct {
-	gchar *markup;
-	gchar *xhtml;
-	gchar *plaintext;
+	char *markup;
+	char *xhtml;
+	char *plaintext;
 } MarkupTestData;
 
 static void
 test_purple_markup_html_to_xhtml(void) {
-	gint i;
+	int i;
 	MarkupTestData data[] = {
 		{
 			"<a>",
@@ -208,7 +208,7 @@
 	};
 
 	for(i = 0; data[i].markup; i++) {
-		gchar *xhtml = NULL, *plaintext = NULL;
+		char *xhtml = NULL, *plaintext = NULL;
 
 		purple_markup_html_to_xhtml(data[i].markup, &xhtml, &plaintext);
 
@@ -279,9 +279,10 @@
 /******************************************************************************
  * Main
  *****************************************************************************/
-gint
-main(gint argc, gchar **argv) {
+int
+main(int argc, char **argv) {
 	g_test_init(&argc, &argv, NULL);
+	g_test_set_nonfatal_assertions();
 
 	g_test_add_func("/util/markup/html-to-xhtml",
 	                test_purple_markup_html_to_xhtml);
diff --git a/libpurple/tests/test_menu.c b/libpurple/tests/test_menu.c
--- a/libpurple/tests/test_menu.c
+++ b/libpurple/tests/test_menu.c
@@ -21,8 +21,8 @@
 #include <purple.h>
 
 typedef struct {
-	const gchar *dynamic_target;
-	const gchar *target;
+	const char *dynamic_target;
+	const char *target;
 } TestPurpleMenuItemData;
 
 typedef struct {
@@ -33,7 +33,7 @@
  * Helpers
  *****************************************************************************/
 static TestPurpleMenuItemData *
-test_purple_menu_item_new(const gchar *dynamic_target, const gchar *target) {
+test_purple_menu_item_new(const char *dynamic_target, const char *target) {
 	TestPurpleMenuItemData *data = g_new(TestPurpleMenuItemData, 1);
 
 	data->dynamic_target = dynamic_target;
@@ -43,10 +43,10 @@
 }
 
 static void
-test_purple_menu_items_func(GMenuModel *model, gint index, gpointer data) {
+test_purple_menu_items_func(GMenuModel *model, int index, gpointer data) {
 	TestPurpleMenuItemData *item = NULL;
 	TestPurpleMenuWalkData *walk_data = data;
-	gchar *actual = NULL;
+	char *actual = NULL;
 	gboolean found = FALSE;
 
 	/* Set item to the first item in the list. */
@@ -240,9 +240,10 @@
 /******************************************************************************
  * Main
  *****************************************************************************/
-gint
-main(gint argc, gchar *argv[]) {
+int
+main(int argc, char *argv[]) {
 	g_test_init(&argc, &argv, NULL);
+	g_test_set_nonfatal_assertions();
 
 	g_test_add_func("/menu/single/no-dynamic-target",
 	                test_purple_menu_single_no_dynamic_target);
@@ -260,4 +261,4 @@
 	                test_purple_menu_multiple_mixed);
 
 	return g_test_run();
-}
\ No newline at end of file
+}
diff --git a/libpurple/tests/test_message.c b/libpurple/tests/test_message.c
--- a/libpurple/tests/test_message.c
+++ b/libpurple/tests/test_message.c
@@ -305,9 +305,10 @@
 /******************************************************************************
  * Main
  *****************************************************************************/
-gint
-main(gint argc, gchar *argv[]) {
+int
+main(int argc, char *argv[]) {
 	g_test_init(&argc, &argv, NULL);
+	g_test_set_nonfatal_assertions();
 
 	g_test_add_func("/message/properties",
 	                test_purple_message_properties);
diff --git a/libpurple/tests/test_notification.c b/libpurple/tests/test_notification.c
--- a/libpurple/tests/test_notification.c
+++ b/libpurple/tests/test_notification.c
@@ -41,7 +41,7 @@
 	PurpleNotification *notification = NULL;
 	PurpleNotificationType type = PURPLE_NOTIFICATION_TYPE_UNKNOWN;
 	GDateTime *created_timestamp = NULL;
-	const gchar *id = NULL;
+	const char *id = NULL;
 
 	account1 = purple_account_new("test", "test");
 
@@ -161,11 +161,8 @@
  *****************************************************************************/
 int
 main(int argc, char *argv[]) {
-	int ret = 0;
-
 	g_test_init(&argc, &argv, NULL);
-
-	test_ui_purple_init();
+	g_test_set_nonfatal_assertions();
 
 	g_test_add_func("/notification/new",
 	                test_purple_notification_new);
@@ -174,9 +171,5 @@
 	g_test_add_func("/notification/properties",
 	                test_purple_notification_properties);
 
-	ret = g_test_run();
-
-	test_ui_purple_uninit();
-
-	return ret;
+	return g_test_run();
 }
diff --git a/libpurple/tests/test_notification_authorization_request.c b/libpurple/tests/test_notification_authorization_request.c
--- a/libpurple/tests/test_notification_authorization_request.c
+++ b/libpurple/tests/test_notification_authorization_request.c
@@ -20,8 +20,6 @@
 
 #include <purple.h>
 
-#include "test_ui.h"
-
 /******************************************************************************
  * Callbacks
  *****************************************************************************/
@@ -119,13 +117,10 @@
 /******************************************************************************
  * Main
  *****************************************************************************/
-gint
-main(gint argc, gchar *argv[]) {
-	gint ret = 0;
-
+int
+main(int argc, char *argv[]) {
 	g_test_init(&argc, &argv, NULL);
-
-	test_ui_purple_init();
+	g_test_set_nonfatal_assertions();
 
 	g_test_add_func("/notification-request-authorization/new",
 	                test_purple_notification_authorization_request_new);
@@ -134,9 +129,5 @@
 	g_test_add_func("/notification-request-authorization/updates-title",
 	                test_purple_notification_authorization_request_updates_title);
 
-	ret = g_test_run();
-
-	test_ui_purple_uninit();
-
-	return ret;
+	return g_test_run();
 }
diff --git a/libpurple/tests/test_person.c b/libpurple/tests/test_person.c
--- a/libpurple/tests/test_person.c
+++ b/libpurple/tests/test_person.c
@@ -20,8 +20,6 @@
 
 #include <purple.h>
 
-#include "test_ui.h"
-
 /******************************************************************************
  * Callbacks
  *****************************************************************************/
@@ -353,7 +351,7 @@
 	PurplePerson *person = NULL;
 	GPtrArray *infos = NULL;
 	guint n_items = 0;
-	const gint n_infos = 5;
+	const int n_infos = 5;
 	gboolean changed = FALSE;
 
 	person = purple_person_new();
@@ -361,9 +359,9 @@
 	                 G_CALLBACK(test_purple_person_items_changed_cb), &changed);
 
 	infos = g_ptr_array_new_full(n_infos, g_object_unref);
-	for(gint i = 0; i < n_infos; i++) {
+	for(int i = 0; i < n_infos; i++) {
 		PurpleContactInfo *info = NULL;
-		gchar *username = NULL;
+		char *username = NULL;
 
 		changed = FALSE;
 
@@ -387,7 +385,7 @@
 		g_assert_true(changed);
 	}
 
-	for(gint i = 0; i < n_infos; i++) {
+	for(int i = 0; i < n_infos; i++) {
 		PurpleContactInfo *info = g_ptr_array_index(infos, i);
 		gboolean removed = FALSE;
 
@@ -455,7 +453,7 @@
 	PurplePerson *person = NULL;
 	PurplePresence *sorted_presence = NULL;
 	guint called = 0;
-	gint n_infos = 5;
+	int n_infos = 5;
 	guint n_items = 0;
 
 	/* This unit test is a bit complicated, but it adds 5 contact infos to a
@@ -476,9 +474,9 @@
 	g_assert_null(priority);
 
 	/* Create and add all contact infos. */
-	for(gint i = 0; i < n_infos; i++) {
+	for(int i = 0; i < n_infos; i++) {
 		PurpleContactInfo *info = NULL;
-		gchar *username = NULL;
+		char *username = NULL;
 
 		/* Set called to 0 as it shouldn't be called as the priority contact
 		 * info shouldn't change except for the first index.
@@ -589,13 +587,10 @@
 /******************************************************************************
  * Main
  *****************************************************************************/
-gint
-main(gint argc, gchar *argv[]) {
-	gint ret = 0;
-
+int
+main(int argc, char *argv[]) {
 	g_test_init(&argc, &argv, NULL);
-
-	test_ui_purple_init();
+	g_test_set_nonfatal_assertions();
 
 	g_test_add_func("/person/new",
 	                test_purple_person_new);
@@ -636,9 +631,5 @@
 	g_test_add_func("/person/matches/contact_info",
 	                test_purple_person_matches_contact_info);
 
-	ret = g_test_run();
-
-	test_ui_purple_uninit();
-
-	return ret;
+	return g_test_run();
 }
diff --git a/libpurple/tests/test_request_field.c b/libpurple/tests/test_request_field.c
--- a/libpurple/tests/test_request_field.c
+++ b/libpurple/tests/test_request_field.c
@@ -152,7 +152,7 @@
                                      G_GNUC_UNUSED gpointer data)
 {
 	gboolean *called = data;
-	gint value;
+	int value;
 
 	*called = TRUE;
 	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD_INT(field), FALSE);
@@ -235,9 +235,10 @@
 /******************************************************************************
  * Main
  *****************************************************************************/
-gint
-main(gint argc, gchar *argv[]) {
+int
+main(int argc, char *argv[]) {
 	g_test_init(&argc, &argv, NULL);
+	g_test_set_nonfatal_assertions();
 
 	g_test_add_func("/request-field/filled-string",
 	                test_request_field_filled_string);
diff --git a/libpurple/tests/test_request_group.c b/libpurple/tests/test_request_group.c
--- a/libpurple/tests/test_request_group.c
+++ b/libpurple/tests/test_request_group.c
@@ -28,16 +28,16 @@
                                     G_GNUC_UNUSED GParamSpec *pspec,
                                     gpointer data)
 {
-	gint *called = data;
+	guint *called = data;
 
-	*called += 1;
+	*called = *called + 1;
 }
 
 static void
 test_request_group_valid(void) {
 	PurpleRequestGroup *group = NULL;
 	PurpleRequestField *field1 = NULL, *field2 = NULL, *field3 = NULL;
-	gint called = 0;
+	guint called = 0;
 
 	group = purple_request_group_new("test-group");
 	g_signal_connect(group, "notify::valid",
@@ -51,20 +51,20 @@
 	field1 = purple_request_field_int_new("test-int", "Test int", 50, 0, 100);
 	purple_request_group_add_field(group, field1);
 	g_assert_true(purple_request_group_is_valid(group));
-	g_assert_cmpint(called, ==, 0);
+	g_assert_cmpuint(called, ==, 0);
 
 	/* Making the field invalid makes the group invalid. */
 	called = 0;
 	purple_request_field_int_set_value(PURPLE_REQUEST_FIELD_INT(field1), -42);
 	g_assert_false(purple_request_group_is_valid(group));
-	g_assert_cmpint(called, ==, 1);
+	g_assert_cmpuint(called, ==, 1);
 
 	/* Adding an invalid field keeps the group invalid. */
 	called = 0;
 	field2 = purple_request_field_int_new("invalid", "Invalid", -42, 0, 100);
 	purple_request_group_add_field(group, field2);
 	g_assert_false(purple_request_group_is_valid(group));
-	g_assert_cmpint(called, ==, 0);
+	g_assert_cmpuint(called, ==, 0);
 
 	/* Adding a valid field to an already invalid group does not change it to
 	 * valid accidentally. */
@@ -72,20 +72,20 @@
 	field3 = purple_request_field_int_new("valid", "Valid", 42, 0, 100);
 	purple_request_group_add_field(group, field3);
 	g_assert_false(purple_request_group_is_valid(group));
-	g_assert_cmpint(called, ==, 0);
+	g_assert_cmpuint(called, ==, 0);
 
 	/* Making one field valid while others are still invalid keeps the group
 	 * invalid. */
 	called = 0;
 	purple_request_field_int_set_value(PURPLE_REQUEST_FIELD_INT(field1), 42);
 	g_assert_false(purple_request_group_is_valid(group));
-	g_assert_cmpint(called, ==, 0);
+	g_assert_cmpuint(called, ==, 0);
 
 	/* Making last invalid field valid makes the group valid again. */
 	called = 0;
 	purple_request_field_int_set_value(PURPLE_REQUEST_FIELD_INT(field2), 42);
 	g_assert_true(purple_request_group_is_valid(group));
-	g_assert_cmpint(called, ==, 1);
+	g_assert_cmpuint(called, ==, 1);
 
 	g_object_unref(group);
 }
@@ -93,9 +93,10 @@
 /******************************************************************************
  * Main
  *****************************************************************************/
-gint
-main(gint argc, gchar *argv[]) {
+int
+main(int argc, char *argv[]) {
 	g_test_init(&argc, &argv, NULL);
+	g_test_set_nonfatal_assertions();
 
 	g_test_add_func("/request-group/valid", test_request_group_valid);
 
diff --git a/libpurple/tests/test_request_page.c b/libpurple/tests/test_request_page.c
--- a/libpurple/tests/test_request_page.c
+++ b/libpurple/tests/test_request_page.c
@@ -119,16 +119,16 @@
                                    G_GNUC_UNUSED GParamSpec *pspec,
                                    gpointer data)
 {
-	gint *called = data;
+	guint *called = data;
 
-	*called += 1;
+	*called = *called + 1;
 }
 
 static void
 test_request_page_valid(void) {
 	PurpleRequestPage *page = NULL;
 	PurpleRequestGroup *group1 = NULL, *group2 = NULL, *group3 = NULL;
-	gint called = FALSE;
+	guint called = 0;
 
 	page = purple_request_page_new();
 	g_signal_connect(page, "notify::valid",
@@ -142,20 +142,20 @@
 	group1 = test_request_page_new_valid_group("group1");
 	purple_request_page_add_group(page, group1);
 	g_assert_true(purple_request_page_is_valid(page));
-	g_assert_cmpint(called, ==, 0);
+	g_assert_cmpuint(called, ==, 0);
 
 	/* Making the group invalid makes the page invalid. */
 	called = 0;
 	test_request_page_make_group_invalid(group1);
 	g_assert_false(purple_request_page_is_valid(page));
-	g_assert_cmpint(called, ==, 1);
+	g_assert_cmpuint(called, ==, 1);
 
 	/* Adding an invalid group keeps the page invalid. */
 	called = 0;
 	group2 = test_request_page_new_invalid_group("group2");
 	purple_request_page_add_group(page, group2);
 	g_assert_false(purple_request_page_is_valid(page));
-	g_assert_cmpint(called, ==, 0);
+	g_assert_cmpuint(called, ==, 0);
 
 	/* Adding a valid group to an already invalid page does not change it to
 	 * valid accidentally. */
@@ -163,20 +163,20 @@
 	group3 = test_request_page_new_valid_group("group3");
 	purple_request_page_add_group(page, group3);
 	g_assert_false(purple_request_page_is_valid(page));
-	g_assert_cmpint(called, ==, 0);
+	g_assert_cmpuint(called, ==, 0);
 
 	/* Making one group valid while others are still invalid keeps the group
 	 * invalid. */
 	called = 0;
 	test_request_page_make_group_valid(group1);
 	g_assert_false(purple_request_page_is_valid(page));
-	g_assert_cmpint(called, ==, 0);
+	g_assert_cmpuint(called, ==, 0);
 
 	/* Making last invalid group valid makes the page valid again. */
 	called = 0;
 	test_request_page_make_group_valid(group2);
 	g_assert_true(purple_request_page_is_valid(page));
-	g_assert_cmpint(called, ==, 1);
+	g_assert_cmpuint(called, ==, 1);
 
 	g_object_unref(page);
 }
@@ -184,9 +184,10 @@
 /******************************************************************************
  * Main
  *****************************************************************************/
-gint
-main(gint argc, gchar *argv[]) {
+int
+main(int argc, char *argv[]) {
 	g_test_init(&argc, &argv, NULL);
+	g_test_set_nonfatal_assertions();
 
 	g_test_add_func("/request-page/valid", test_request_page_valid);
 
diff --git a/libpurple/tests/test_saved_presence.c b/libpurple/tests/test_saved_presence.c
--- a/libpurple/tests/test_saved_presence.c
+++ b/libpurple/tests/test_saved_presence.c
@@ -472,9 +472,10 @@
 /******************************************************************************
  * Main
  *****************************************************************************/
-gint
-main(gint argc, gchar *argv[]) {
+int
+main(int argc, char *argv[]) {
 	g_test_init(&argc, &argv, NULL);
+	g_test_set_nonfatal_assertions();
 
 	g_test_add_func("/saved-presence/properties",
 	                test_purple_saved_presence_properties);
diff --git a/libpurple/tests/test_str.c b/libpurple/tests/test_str.c
--- a/libpurple/tests/test_str.c
+++ b/libpurple/tests/test_str.c
@@ -62,9 +62,10 @@
 /******************************************************************************
  * Public API
  *****************************************************************************/
-gint
-main(gint argc, gchar **argv) {
+int
+main(int argc, char **argv) {
 	g_test_init(&argc, &argv, NULL);
+	g_test_set_nonfatal_assertions();
 
 	g_test_add_func("/strmatches/null", test_purple_strmatches_null);
 	g_test_add_func("/strmatches/adjacent", test_purple_strmatches_adjacent);
diff --git a/libpurple/tests/test_tags.c b/libpurple/tests/test_tags.c
--- a/libpurple/tests/test_tags.c
+++ b/libpurple/tests/test_tags.c
@@ -66,7 +66,7 @@
 test_purple_tags_lookup_exists(void) {
 	PurpleTags *tags = NULL;
 	gboolean found = FALSE;
-	const gchar *value = NULL;
+	const char *value = NULL;
 	guint counter = 0;
 
 	tags = purple_tags_new();
@@ -102,7 +102,7 @@
 test_purple_tags_lookup_non_existent(void) {
 	PurpleTags *tags = purple_tags_new();
 	gboolean found = FALSE;
-	const gchar *value;
+	const char *value;
 
 	value = purple_tags_lookup(tags, "foo", &found);
 	g_assert_null(value);
@@ -393,7 +393,7 @@
 static void
 test_purple_tags_get_single(void) {
 	PurpleTags *tags = purple_tags_new();
-	const gchar *value = NULL;
+	const char *value = NULL;
 
 	purple_tags_add(tags, "tag1:purple");
 	value = purple_tags_get(tags, "tag1");
@@ -406,7 +406,7 @@
 static void
 test_purple_tags_get_multiple(void) {
 	PurpleTags *tags = purple_tags_new();
-	const gchar *value = NULL;
+	const char *value = NULL;
 
 	purple_tags_add(tags, "tag1:purple");
 	purple_tags_add(tags, "tag1:pink");
@@ -422,9 +422,9 @@
 test_purple_tags_get_all(void) {
 	PurpleTags *tags = purple_tags_new();
 	GList *all_tags = NULL;
-	const gchar *values[] = {"foo", "bar", "baz", "qux", "quux", NULL};
-	gint i = 0;
-	gint len = 0;
+	const char *values[] = {"foo", "bar", "baz", "qux", "quux", NULL};
+	int i = 0;
+	int len = 0;
 
 	for(i = 0; values[i] != NULL; i++) {
 		purple_tags_add(tags, values[i]);
@@ -435,7 +435,7 @@
 	i = 0;
 
 	for(GList *l = all_tags; l != NULL; l = l->next) {
-		const gchar *value = l->data;
+		const char *value = l->data;
 
 		g_assert_cmpint(i, <, len);
 		g_assert_cmpstr(value, ==, values[i]);
@@ -492,7 +492,7 @@
 static void
 test_purple_tags_to_string_single(void) {
 	PurpleTags *tags = purple_tags_new();
-	gchar *value = NULL;
+	char *value = NULL;
 
 	purple_tags_add(tags, "foo");
 	value = purple_tags_to_string(tags, NULL);
@@ -507,7 +507,7 @@
 static void
 test_purple_tags_to_string_multiple_with_separator(void) {
 	PurpleTags *tags = purple_tags_new();
-	gchar *value = NULL;
+	char *value = NULL;
 
 	purple_tags_add(tags, "foo");
 	purple_tags_add(tags, "bar");
@@ -524,7 +524,7 @@
 static void
 test_purple_tags_to_string_multiple_with_null_separator(void) {
 	PurpleTags *tags = purple_tags_new();
-	gchar *value = NULL;
+	char *value = NULL;
 
 	purple_tags_add(tags, "foo");
 	purple_tags_add(tags, "bar");
@@ -641,9 +641,10 @@
 /******************************************************************************
  * Public API
  *****************************************************************************/
-gint
-main(gint argc, gchar **argv) {
+int
+main(int argc, char **argv) {
 	g_test_init(&argc, &argv, NULL);
+	g_test_set_nonfatal_assertions();
 
 	g_test_add_func("/tags/exists", test_purple_tags_exists);
 
diff --git a/libpurple/tests/test_util.c b/libpurple/tests/test_util.c
--- a/libpurple/tests/test_util.c
+++ b/libpurple/tests/test_util.c
@@ -46,7 +46,7 @@
  * Many of the valid and invalid email addresses lised below are from
  * http://fightingforalostcause.net/misc/2006/compare-email-regex.php
  */
-const gchar *valid_emails[] = {
+const char *valid_emails[] = {
 	"purple-devel@lists.sf.net",
 	"l3tt3rsAndNumb3rs@domain.com",
 	"has-dash@domain.com",
@@ -79,7 +79,7 @@
 		g_assert_true(purple_email_is_valid(valid_emails[i]));
 }
 
-const gchar *invalid_emails[] = {
+const char *invalid_emails[] = {
 	"purple-devel@@lists.sf.net",
 	"purple@devel@lists.sf.net",
 	"purple-devel@list..sf.net",
@@ -118,9 +118,10 @@
 /******************************************************************************
  * MAIN
  *****************************************************************************/
-gint
-main(gint argc, gchar **argv) {
+int
+main(int argc, char **argv) {
 	g_test_init(&argc, &argv, NULL);
+	g_test_set_nonfatal_assertions();
 
 	g_test_add_func("/util/filename/escape",
 	                test_util_filename_escape);
diff --git a/libpurple/tests/test_xmlnode.c b/libpurple/tests/test_xmlnode.c
--- a/libpurple/tests/test_xmlnode.c
+++ b/libpurple/tests/test_xmlnode.c
@@ -134,9 +134,10 @@
 	purple_xmlnode_free(xml);
 }
 
-gint
-main(gint argc, gchar **argv) {
+int
+main(int argc, char **argv) {
 	g_test_init(&argc, &argv, NULL);
+	g_test_set_nonfatal_assertions();
 
 	g_test_add_func("/xmlnode/billion_laughs_attack",
 	                test_xmlnode_billion_laughs_attack);
