From df3ac947ac5c9ecb55789f81e8770a44af92a31c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 24 Dec 2013 00:04:44 -0500 Subject: [PATCH] Improve converter test coverage --- gio/tests/converter-stream.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/gio/tests/converter-stream.c b/gio/tests/converter-stream.c index f2d45db70..c8672499e 100644 --- a/gio/tests/converter-stream.c +++ b/gio/tests/converter-stream.c @@ -1163,6 +1163,29 @@ test_truncation (gconstpointer data) g_free (data0); } +static void +test_converter_basics (void) +{ + GConverter *converter; + GError *error = NULL; + gchar *to; + gchar *from; + + converter = (GConverter *)g_charset_converter_new ("utf-8", "latin1", &error); + g_assert_no_error (error); + g_object_get (converter, + "to-charset", &to, + "from-charset", &from, + NULL); + + g_assert_cmpstr (to, ==, "utf-8"); + g_assert_cmpstr (from, ==, "latin1"); + + g_free (to); + g_free (from); + g_object_unref (converter); +} + int main (int argc, char *argv[]) @@ -1192,6 +1215,7 @@ main (int argc, g_test_bug_base ("http://bugzilla.gnome.org/"); + g_test_add_func ("/converter/basics", test_converter_basics); g_test_add_func ("/converter-input-stream/expander", test_expander); g_test_add_func ("/converter-input-stream/compressor", test_compressor);