~ubuntu-branches/ubuntu/precise/gedit/precise

« back to all changes in this revision

Viewing changes to tests/smart-converter.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-04-14 16:41:13 UTC
  • mfrom: (1.1.78 upstream)
  • Revision ID: james.westby@ubuntu.com-20100414164113-0xgl3u73pcs0ngbc
Tags: 2.30.0git20100413-0ubuntu1
* Updating to git snaptshot since 2.30.1 will be after lucid
* debian/patches/90_autoconf.patch:
  - new version update

Show diffs side-by-side

added added

removed removed

Lines of Context:
193
193
        return out;
194
194
}
195
195
 
196
 
static void
197
 
do_test_roundtrip (const char *str, const char *charset)
 
196
static void
 
197
do_test_roundtrip (const char *str, const char *charset)
198
198
{
199
 
        gsize len;
200
 
        gchar *buf, *p;
201
 
        GInputStream *in, *tmp;
 
199
        gsize len;
 
200
        gchar *buf, *p;
 
201
        GInputStream *in, *tmp;
202
202
        GCharsetConverter *c1;
203
 
        GeditSmartCharsetConverter *c2;
 
203
        GeditSmartCharsetConverter *c2;
204
204
        gsize n, tot;
205
205
        GError *err;
206
 
        GSList *enc = NULL;
 
206
        GSList *enc = NULL;
207
207
 
208
208
        len = strlen(str);
209
209
        buf = g_new0 (char, len);
210
210
 
211
 
        in = g_memory_input_stream_new_from_data (str, -1, NULL);
 
211
        in = g_memory_input_stream_new_from_data (str, -1, NULL);
212
212
 
213
213
        c1 = g_charset_converter_new (charset, "UTF-8", NULL);
214
214
 
219
219
 
220
220
        enc = g_slist_prepend (enc, (gpointer)gedit_encoding_get_from_charset (charset));
221
221
        c2 = gedit_smart_charset_converter_new (enc);
222
 
        g_slist_free (enc);
 
222
        g_slist_free (enc);
223
223
 
224
224
        tmp = in;
225
225
        in = g_converter_input_stream_new (in, G_CONVERTER (c2));