# HG changeset patch
# Node ID 59ad12d9697d
# Parent  60e70ccf6681
diff --git a/libpurple/tests/test_credential_manager.c b/libpurple/tests/test_credential_manager.c
--- a/libpurple/tests/test_credential_manager.c
+++ b/libpurple/tests/test_credential_manager.c
@@ -40,13 +40,12 @@
 
 	g_warning("timed out waiting for the callback function to be called");
 
-	return FALSE;
+	return G_SOURCE_REMOVE;
 }
 
 /******************************************************************************
  * TestPurpleCredentialProvider Implementation
  *****************************************************************************/
-#define TEST_PURPLE_TYPE_CREDENTIAL_PROVIDER (test_purple_credential_provider_get_type())
 G_DECLARE_FINAL_TYPE(TestPurpleCredentialProvider,
                      test_purple_credential_provider,
                      TEST_PURPLE, CREDENTIAL_PROVIDER,
@@ -153,7 +152,7 @@
 static PurpleCredentialProvider *
 test_purple_credential_provider_new(void) {
 	return g_object_new(
-		TEST_PURPLE_TYPE_CREDENTIAL_PROVIDER,
+		test_purple_credential_provider_get_type(),
 		"id", "test-provider",
 		"name", "Test Provider",
 		NULL);
@@ -197,10 +196,11 @@
 
 	/* Register again and verify the error. */
 	r = purple_credential_manager_register(manager, provider, &error);
-	g_assert_false(r);
 	g_assert_error(error, PURPLE_CREDENTIAL_MANAGER_DOMAIN, 0);
 	g_clear_error(&error);
 
+	g_assert_false(r);
+
 	/* Unregister the provider. */
 	r = purple_credential_manager_unregister(manager, provider, &error);
 	g_assert_no_error(error);
@@ -208,10 +208,11 @@
 
 	/* Unregister the provider again and verify the error. */
 	r = purple_credential_manager_unregister(manager, provider, &error);
-	g_assert_false(r);
 	g_assert_error(error, PURPLE_CREDENTIAL_MANAGER_DOMAIN, 0);
 	g_clear_error(&error);
 
+	g_assert_false(r);
+
 	/* Final clean ups. */
 	g_clear_object(&provider);
 	g_clear_object(&manager);
@@ -246,10 +247,11 @@
 
 	ret = purple_credential_manager_set_active(manager, "foo", &error);
 
-	g_assert_false(ret);
 	g_assert_error(error, PURPLE_CREDENTIAL_MANAGER_DOMAIN, 0);
 	g_clear_error(&error);
 
+	g_assert_false(ret);
+
 	g_clear_object(&manager);
 }
 
@@ -276,9 +278,9 @@
 
 	/* Verify that unregistering the provider fails. */
 	r = purple_credential_manager_unregister(manager, provider, &error);
-	g_assert_false(r);
 	g_assert_error(error, PURPLE_CREDENTIAL_MANAGER_DOMAIN, 0);
 	g_clear_error(&error);
+	g_assert_false(r);
 
 	/* Now unset the active provider. */
 	r = purple_credential_manager_set_active(manager, NULL, &error);
@@ -331,7 +333,7 @@
 	                                              test_purple_credential_manager_no_provider_read_password_cb,
 	                                              account);
 
-	return FALSE;
+	return G_SOURCE_REMOVE;
 }
 
 static void
@@ -359,10 +361,11 @@
 	gboolean r = FALSE;
 
 	r = purple_credential_manager_write_password_finish(manager, res, &error);
-	g_assert_false(r);
 	g_assert_error(error, PURPLE_CREDENTIAL_MANAGER_DOMAIN, 0);
 	g_clear_error(&error);
 
+	g_assert_false(r);
+
 	g_clear_object(&account);
 
 	g_main_loop_quit(loop);
@@ -380,7 +383,7 @@
 	                                               test_purple_credential_manager_no_provider_write_password_cb,
 	                                               account);
 
-	return FALSE;
+	return G_SOURCE_REMOVE;
 }
 
 static void
@@ -409,10 +412,11 @@
 	gboolean r = FALSE;
 
 	r = purple_credential_manager_clear_password_finish(manager, res, &error);
-	g_assert_false(r);
 	g_assert_error(error, PURPLE_CREDENTIAL_MANAGER_DOMAIN, 0);
 	g_clear_error(&error);
 
+	g_assert_false(r);
+
 	g_clear_object(&account);
 
 	g_main_loop_quit(loop);
@@ -430,7 +434,7 @@
 	                                               test_purple_credential_manager_no_provider_clear_password_cb,
 	                                               account);
 
-	return FALSE;
+	return G_SOURCE_REMOVE;
 }
 
 static void
@@ -483,7 +487,7 @@
 	                                              test_purple_credential_manager_read_password_cb,
 	                                              account);
 
-	return FALSE;
+	return G_SOURCE_REMOVE;
 }
 
 static void
@@ -551,7 +555,7 @@
 	                                               test_purple_credential_manager_write_password_cb,
 	                                               account);
 
-	return FALSE;
+	return G_SOURCE_REMOVE;
 }
 
 static void
@@ -619,7 +623,7 @@
 	                                               test_purple_credential_manager_clear_password_cb,
 	                                               account);
 
-	return FALSE;
+	return G_SOURCE_REMOVE;
 }
 
 static void
