mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-22 15:19:16 +02:00
tests: Add a missing const to a variable in the GConvert tests
Also rename it to make it clearer how it’s encoded (as UTF-8). Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=790698
This commit is contained in:
parent
19bc03ef65
commit
a19eed4691
@ -58,13 +58,13 @@ test_iconv_state (void)
|
|||||||
static void
|
static void
|
||||||
test_one_half (void)
|
test_one_half (void)
|
||||||
{
|
{
|
||||||
gchar *in = "\xc2\xbd";
|
const gchar *in_utf8 = "\xc2\xbd";
|
||||||
gchar *out;
|
gchar *out;
|
||||||
gsize bytes_read = 0;
|
gsize bytes_read = 0;
|
||||||
gsize bytes_written = 0;
|
gsize bytes_written = 0;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
out = g_convert (in, -1,
|
out = g_convert (in_utf8, -1,
|
||||||
"ISO-8859-1", "UTF-8",
|
"ISO-8859-1", "UTF-8",
|
||||||
&bytes_read, &bytes_written,
|
&bytes_read, &bytes_written,
|
||||||
&error);
|
&error);
|
||||||
@ -75,7 +75,7 @@ test_one_half (void)
|
|||||||
g_assert_cmpstr (out, ==, "\xbd");
|
g_assert_cmpstr (out, ==, "\xbd");
|
||||||
g_free (out);
|
g_free (out);
|
||||||
|
|
||||||
out = g_convert (in, -1,
|
out = g_convert (in_utf8, -1,
|
||||||
"ISO-8859-15", "UTF-8",
|
"ISO-8859-15", "UTF-8",
|
||||||
&bytes_read, &bytes_written,
|
&bytes_read, &bytes_written,
|
||||||
&error);
|
&error);
|
||||||
@ -87,7 +87,7 @@ test_one_half (void)
|
|||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
g_free (out);
|
g_free (out);
|
||||||
|
|
||||||
out = g_convert_with_fallback (in, -1,
|
out = g_convert_with_fallback (in_utf8, -1,
|
||||||
"ISO8859-15", "UTF-8",
|
"ISO8859-15", "UTF-8",
|
||||||
"a",
|
"a",
|
||||||
&bytes_read, &bytes_written,
|
&bytes_read, &bytes_written,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user