changeset 27526:7bdad85c5fed

Use assert_string_equal_free() instead of just assert_string_equal() What a great macro!
author Mark Doliner <mark@kingant.net>
date Fri, 10 Jul 2009 05:05:51 +0000
parents 91b8a957776a
children 962ce369fc35
files libpurple/tests/test_util.c
diffstat 1 files changed, 5 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/tests/test_util.c	Fri Jul 10 03:14:31 2009 +0000
+++ b/libpurple/tests/test_util.c	Fri Jul 10 05:05:51 2009 +0000
@@ -14,8 +14,7 @@
 	gsize sz = 0;
 	guchar *out = purple_base16_decode("21646c726f77202c6f6c6c656800", &sz);
 	fail_unless(sz == 14, NULL);
-	assert_string_equal("!dlrow ,olleh", (const char *)out);
-	g_free(out);
+	assert_string_equal_free("!dlrow ,olleh", (char *)out);
 }
 END_TEST
 
@@ -30,8 +29,7 @@
 	gsize sz;
 	guchar *out = purple_base64_decode("b3d0LXl0cm9mAA==", &sz);
 	fail_unless(sz == 10, NULL);
-	assert_string_equal("owt-ytrof", (const char *)out);
-	g_free(out);
+	assert_string_equal_free("owt-ytrof", (char *)out);
 }
 END_TEST
 
@@ -94,18 +92,15 @@
 	gchar *xhtml = NULL;
 	gchar *plaintext = NULL;
 	purple_markup_html_to_xhtml("<a>", &xhtml, &plaintext);
-	assert_string_equal("<a href=\"\"></a>", xhtml);
-	g_free(xhtml);
-	assert_string_equal("", plaintext);
-	g_free(plaintext);
+	assert_string_equal_free("<a href=\"\"></a>", xhtml);
+	assert_string_equal_free("", plaintext);
 }
 END_TEST
 
 START_TEST(test_mime_decode_field)
 {
 	gchar *result = purple_mime_decode_field("=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?=");
-	assert_string_equal("Keld Jørn Simonsen", result);
-	g_free(result);
+	assert_string_equal_free("Keld Jørn Simonsen", result);
 }
 END_TEST