pidgin: 87ba031c: Use assert_string_equal_free() instead o...

markdoliner at pidgin.im markdoliner at pidgin.im
Fri Jul 10 01:10:29 EDT 2009


-----------------------------------------------------------------
Revision: 87ba031ce46c56c3373f9607f3e3e6aa07eb9857
Ancestor: b0203e5c616e9908ea5b982d34dd21789e363e41
Author: markdoliner at pidgin.im
Date: 2009-07-10T05:05:51
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/87ba031ce46c56c3373f9607f3e3e6aa07eb9857

Modified files:
        libpurple/tests/test_util.c

ChangeLog: 

Use assert_string_equal_free() instead of just assert_string_equal()
What a great macro!

-------------- next part --------------
============================================================
--- libpurple/tests/test_util.c	e7d0b170b4990a5a4445a817d69f0aab55dde056
+++ libpurple/tests/test_util.c	7fdae89fabada1aa7d1304d2bea5eb9d392db094
@@ -14,8 +14,7 @@ START_TEST(test_util_base16_decode)
 	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 @@ START_TEST(test_util_base64_decode)
 	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 @@ START_TEST(test_markup_html_to_xhtml)
 	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
 


More information about the Commits mailing list