# HG changeset patch
# Node ID 87e156c6d050dc9369eb40f3371a099ac4a37d64
# Parent  9e89897451b4cb7fa8f1d01bb83d2f9dc6f7e93d
diff --git a/xeme/tests/testmessage.c b/xeme/tests/testmessage.c
--- a/xeme/tests/testmessage.c
+++ b/xeme/tests/testmessage.c
@@ -34,7 +34,7 @@
 	message = xeme_message_new();
 	g_assert_true(XEME_IS_MESSAGE(message));
 
-	g_clear_object(&message);
+	g_assert_finalize_object(message);
 }
 
 static void
@@ -63,7 +63,7 @@
 	g_assert_cmpstr(thread_parent, ==, "thread-parent1");
 	g_clear_pointer(&thread_parent, g_free);
 
-	g_clear_object(&message);
+	g_assert_finalize_object(message);
 }
 
 static void
@@ -73,14 +73,14 @@
 	char *data = NULL;
 
 	message = xeme_message_new();
+
 	data = xeme_stanza_marshal(message, &error);
-
 	g_assert_no_error(error);
 
 	g_assert_cmpstr(data, ==, "<message></message>");
 	g_clear_pointer(&data, g_free);
 
-	g_clear_object(&message);
+	g_assert_finalize_object(message);
 }
 
 static void
@@ -100,13 +100,12 @@
 	xeme_stanza_set_xml_lang(message, "en_TESTING");
 
 	data = xeme_stanza_marshal(message, &error);
-
 	g_assert_no_error(error);
 
 	g_assert_cmpstr(data, ==, expected);
 	g_clear_pointer(&data, g_free);
 
-	g_clear_object(&message);
+	g_assert_finalize_object(message);
 }
 
 static void
@@ -120,14 +119,13 @@
 	xeme_message_add_subject(XEME_MESSAGE(message), NULL, "xeme");
 
 	data = xeme_stanza_marshal(message, &error);
-
 	g_assert_no_error(error);
 
 	g_assert_cmpstr(data, ==,
 	                "<message><subject>xeme</subject></message>");
 	g_free(data);
 
-	g_clear_object(&message);
+	g_assert_finalize_object(message);
 }
 
 static void
@@ -142,13 +140,12 @@
 	xeme_message_add_subject(XEME_MESSAGE(message), NULL, "two");
 
 	data = xeme_stanza_marshal(message, &error);
-
 	g_assert_no_error(error);
 
 	g_assert_cmpstr(data, ==, expected);
 	g_free(data);
 
-	g_clear_object(&message);
+	g_assert_finalize_object(message);
 }
 
 static void
@@ -167,13 +164,12 @@
 	xeme_message_add_subject(XEME_MESSAGE(message), "fr", "Salutations!");
 
 	data = xeme_stanza_marshal(message, &error);
-
 	g_assert_no_error(error);
 
 	g_assert_cmpstr(data, ==, expected);
 	g_free(data);
 
-	g_clear_object(&message);
+	g_assert_finalize_object(message);
 }
 
 static void
@@ -187,14 +183,13 @@
 	xeme_message_add_body(XEME_MESSAGE(message), NULL, "this is the body");
 
 	data = xeme_stanza_marshal(message, &error);
-
 	g_assert_no_error(error);
 
 	g_assert_cmpstr(data, ==,
 	                "<message><body>this is the body</body></message>");
 	g_free(data);
 
-	g_clear_object(&message);
+	g_assert_finalize_object(message);
 }
 
 static void
@@ -209,13 +204,12 @@
 	xeme_message_add_body(XEME_MESSAGE(message), NULL, "two");
 
 	data = xeme_stanza_marshal(message, &error);
-
 	g_assert_no_error(error);
 
 	g_assert_cmpstr(data, ==, expected);
 	g_free(data);
 
-	g_clear_object(&message);
+	g_assert_finalize_object(message);
 }
 
 static void
@@ -234,13 +228,12 @@
 	xeme_message_add_body(XEME_MESSAGE(message), "fr", "Bonjour le monde!");
 
 	data = xeme_stanza_marshal(message, &error);
-
 	g_assert_no_error(error);
 
 	g_assert_cmpstr(data, ==, expected);
 	g_free(data);
 
-	g_clear_object(&message);
+	g_assert_finalize_object(message);
 }
 
 static void
@@ -254,13 +247,12 @@
 	xeme_message_set_thread(XEME_MESSAGE(message), "thread1");
 
 	data = xeme_stanza_marshal(message, &error);
-
 	g_assert_no_error(error);
 
 	g_assert_cmpstr(data, ==, expected);
 	g_free(data);
 
-	g_clear_object(&message);
+	g_assert_finalize_object(message);
 }
 
 static void
@@ -276,13 +268,12 @@
 	xeme_message_set_thread_parent(XEME_MESSAGE(message), "parent1");
 
 	data = xeme_stanza_marshal(message, &error);
-
 	g_assert_no_error(error);
 
 	g_assert_cmpstr(data, ==, expected);
 	g_free(data);
 
-	g_clear_object(&message);
+	g_assert_finalize_object(message);
 }
 
 static void
@@ -296,13 +287,12 @@
 	xeme_message_set_thread_parent(XEME_MESSAGE(message), "parent1");
 
 	data = xeme_stanza_marshal(message, &error);
-
 	g_assert_no_error(error);
 
 	g_assert_cmpstr(data, ==, expected);
 	g_free(data);
 
-	g_clear_object(&message);
+	g_assert_finalize_object(message);
 }
 
 /******************************************************************************
diff --git a/xeme/tests/teststanza.c b/xeme/tests/teststanza.c
--- a/xeme/tests/teststanza.c
+++ b/xeme/tests/teststanza.c
@@ -69,7 +69,7 @@
 	g_assert_cmpstr(xml_lang, ==, "xml_lang1");
 	g_clear_pointer(&xml_lang, g_free);
 
-	g_clear_object(&stanza);
+	g_assert_finalize_object(stanza);
 }
 
 /******************************************************************************
diff --git a/xeme/tests/teststream.c b/xeme/tests/teststream.c
--- a/xeme/tests/teststream.c
+++ b/xeme/tests/teststream.c
@@ -80,8 +80,8 @@
 	g_assert_cmpstr(version, ==, "version1");
 	g_clear_pointer(&version, g_free);
 
-	g_clear_object(&cancellable);
-	g_clear_object(&stream);
+	g_assert_finalize_object(stream);
+	g_assert_finalize_object(cancellable);
 }
 
 static void
@@ -92,7 +92,7 @@
 	version = xeme_stream_get_version(stream);
 	g_assert_cmpstr(version, ==, XEME_STREAM_VERSION);
 
-	g_clear_object(&stream);
+	g_assert_finalize_object(stream);
 }
 
 /******************************************************************************
