summaryrefslogtreecommitdiff
path: root/lib/util/charset/tests/convert_string.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-09-10 15:41:14 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-09-10 14:18:06 +0200
commit142f871cef8f1b239d01d65dfeba3331cff0e166 (patch)
treeb95cca607845dc3bb6ab6a2e1df1097930c98d78 /lib/util/charset/tests/convert_string.c
parent0022296349ef95896b0e83a5ac496edba043a98c (diff)
downloadsamba-142f871cef8f1b239d01d65dfeba3331cff0e166.tar.gz
samba-142f871cef8f1b239d01d65dfeba3331cff0e166.tar.bz2
samba-142f871cef8f1b239d01d65dfeba3331cff0e166.zip
lib/util/charset Use name of ISO-8859-1 that matches our internal implementation
Diffstat (limited to 'lib/util/charset/tests/convert_string.c')
-rw-r--r--lib/util/charset/tests/convert_string.c88
1 files changed, 44 insertions, 44 deletions
diff --git a/lib/util/charset/tests/convert_string.c b/lib/util/charset/tests/convert_string.c
index ff19a579bd..2c0fe9fc8f 100644
--- a/lib/util/charset/tests/convert_string.c
+++ b/lib/util/charset/tests/convert_string.c
@@ -106,7 +106,7 @@ static bool test_gd_iso8859_cp850_handle(struct torture_context *tctx)
talloc_steal(tctx, gd_iso8859_1.data);
talloc_steal(tctx, gd_utf16le.data);
- iconv_handle = get_iconv_testing_handle(tctx, "ISO8859-1", "CP850",
+ iconv_handle = get_iconv_testing_handle(tctx, "ISO-8859-1", "CP850",
lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true));
torture_assert(tctx, iconv_handle, "getting iconv handle");
@@ -114,16 +114,16 @@ static bool test_gd_iso8859_cp850_handle(struct torture_context *tctx)
CH_UTF8, CH_DOS,
gd_utf8.data, gd_utf8.length,
(void *)&gd_output.data, &gd_output.length),
- "conversion from UTF8 to (dos charset) ISO8859-1");
- torture_assert_data_blob_equal(tctx, gd_output, gd_iso8859_1, "conversion from UTF8 to (dos charset) ISO8859-1 incorrect");
+ "conversion from UTF8 to (dos charset) ISO-8859-1");
+ torture_assert_data_blob_equal(tctx, gd_output, gd_iso8859_1, "conversion from UTF8 to (dos charset) ISO-8859-1 incorrect");
torture_assert(tctx, convert_string_error_handle(iconv_handle,
CH_UTF8, CH_DOS,
gd_utf8.data, gd_utf8.length,
(void *)gd_output.data, gd_output.length,
&gd_output.length),
- "conversion from UTF8 to (dos charset) ISO8859-1");
- torture_assert_data_blob_equal(tctx, gd_output, gd_iso8859_1, "conversion from UTF8 to (dos charset) ISO8859-1 incorrect");
+ "conversion from UTF8 to (dos charset) ISO-8859-1");
+ torture_assert_data_blob_equal(tctx, gd_output, gd_iso8859_1, "conversion from UTF8 to (dos charset) ISO-8859-1 incorrect");
/* Short output handling confirmation */
gd_output.length = 1;
@@ -132,10 +132,10 @@ static bool test_gd_iso8859_cp850_handle(struct torture_context *tctx)
gd_utf8.data, gd_utf8.length,
(void *)gd_output.data, gd_output.length,
&gd_output.length) == false,
- "conversion from UTF8 to (dos charset) ISO8859-1 should fail due to too short");
- torture_assert_errno_equal(tctx, E2BIG, "conversion from UTF8 to (dos charset) ISO8859-1 should fail E2BIG");
+ "conversion from UTF8 to (dos charset) ISO-8859-1 should fail due to too short");
+ torture_assert_errno_equal(tctx, E2BIG, "conversion from UTF8 to (dos charset) ISO-8859-1 should fail E2BIG");
torture_assert_int_equal(tctx, gd_output.length, 1, "Should only get 1 char of output");
- torture_assert_data_blob_equal(tctx, gd_output, data_blob_string_const("G"), "conversion from UTF8 to (dos charset) ISO8859-1 incorrect");
+ torture_assert_data_blob_equal(tctx, gd_output, data_blob_string_const("G"), "conversion from UTF8 to (dos charset) ISO-8859-1 incorrect");
/* Short output handling confirmation */
gd_output.length = 2;
@@ -144,8 +144,8 @@ static bool test_gd_iso8859_cp850_handle(struct torture_context *tctx)
gd_utf8.data, gd_utf8.length,
(void *)gd_output.data, gd_output.length,
&gd_output.length) == false,
- "conversion from UTF8 to (dos charset) ISO8859-1 should fail due to too short");
- torture_assert_errno_equal(tctx, E2BIG, "conversion from UTF8 to (dos charset) ISO8859-1 should fail E2BIG");
+ "conversion from UTF8 to (dos charset) ISO-8859-1 should fail due to too short");
+ torture_assert_errno_equal(tctx, E2BIG, "conversion from UTF8 to (dos charset) ISO-8859-1 should fail E2BIG");
torture_assert_int_equal(tctx, gd_output.length, 2, "Should only get 2 char of output");
/* Short input handling confirmation */
@@ -155,8 +155,8 @@ static bool test_gd_iso8859_cp850_handle(struct torture_context *tctx)
gd_utf8.data, 2,
(void *)gd_output.data, gd_output.length,
&gd_output.length) == false,
- "conversion from UTF8 to (dos charset) ISO8859-1 should fail due to too short");
- torture_assert_errno_equal(tctx, EILSEQ, "conversion from short UTF8 to (dos charset) ISO8859-1 should fail EINVAL");
+ "conversion from UTF8 to (dos charset) ISO-8859-1 should fail due to too short");
+ torture_assert_errno_equal(tctx, EILSEQ, "conversion from short UTF8 to (dos charset) ISO-8859-1 should fail EINVAL");
torture_assert_int_equal(tctx, gd_output.length, 1, "Should only get 1 char of output");
/* Short output handling confirmation */
@@ -167,7 +167,7 @@ static bool test_gd_iso8859_cp850_handle(struct torture_context *tctx)
(void *)gd_output.data, gd_output.length,
&gd_output.length) == false,
"conversion from UTF16 to UTF8 should fail due to too short");
- torture_assert_errno_equal(tctx, E2BIG, "conversion from UTF16 to (utf8 charset) ISO8859-1 should fail E2BIG");
+ torture_assert_errno_equal(tctx, E2BIG, "conversion from UTF16 to (utf8 charset) ISO-8859-1 should fail E2BIG");
torture_assert_int_equal(tctx, gd_output.length, 1, "Should only get 1 char of output");
torture_assert_data_blob_equal(tctx, gd_output, data_blob_string_const("G"), "conversion from UTF16 to UTF8 incorrect");
@@ -179,7 +179,7 @@ static bool test_gd_iso8859_cp850_handle(struct torture_context *tctx)
(void *)gd_output.data, gd_output.length,
&gd_output.length) == false,
"conversion from UTF16 to UTF8 should fail due to too short");
- torture_assert_errno_equal(tctx, E2BIG, "conversion from UTF16 to (utf8 charset) ISO8859-1 should fail E2BIG");
+ torture_assert_errno_equal(tctx, E2BIG, "conversion from UTF16 to (utf8 charset) ISO-8859-1 should fail E2BIG");
torture_assert_int_equal(tctx, gd_output.length, 3, "Should get 3 bytes output for UTF8");
/* Short input handling confirmation */
@@ -211,15 +211,15 @@ static bool test_gd_iso8859_cp850_handle(struct torture_context *tctx)
CH_UTF16LE, CH_DOS,
gd_utf16le.data, gd_utf16le.length,
(void *)&gd_output.data, &gd_output.length),
- "conversion from UTF16LE to (dos charset) ISO8859-1");
- torture_assert_data_blob_equal(tctx, gd_output, gd_iso8859_1, "conversion from UTF16LE to (dos charset) ISO8859-1 incorrect");
+ "conversion from UTF16LE to (dos charset) ISO-8859-1");
+ torture_assert_data_blob_equal(tctx, gd_output, gd_iso8859_1, "conversion from UTF16LE to (dos charset) ISO-8859-1 incorrect");
torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
CH_DOS, CH_UTF16LE,
gd_output.data, gd_output.length,
(void *)&gd_output2.data, &gd_output2.length),
- "round trip conversion from (dos charset) ISO8859-1 back to UTF16LE");
- torture_assert_data_blob_equal(tctx, gd_output2, gd_utf16le, "round trip conversion from (dos charset) ISO8859-1 back to UTF16LE");
+ "round trip conversion from (dos charset) ISO-8859-1 back to UTF16LE");
+ torture_assert_data_blob_equal(tctx, gd_output2, gd_utf16le, "round trip conversion from (dos charset) ISO-8859-1 back to UTF16LE");
torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
CH_UTF16LE, CH_UNIX,
@@ -239,29 +239,29 @@ static bool test_gd_iso8859_cp850_handle(struct torture_context *tctx)
CH_DOS, CH_DOS,
gd_iso8859_1.data, gd_iso8859_1.length,
(void *)&gd_output.data, &gd_output.length),
- "conversion from (dos charset) ISO8859-1 to (dos charset) ISO8859-1");
- torture_assert_data_blob_equal(tctx, gd_output, gd_iso8859_1, "conversion from UTF16LE to (dos charset) ISO8859-1 incorrect");
+ "conversion from (dos charset) ISO-8859-1 to (dos charset) ISO-8859-1");
+ torture_assert_data_blob_equal(tctx, gd_output, gd_iso8859_1, "conversion from UTF16LE to (dos charset) ISO-8859-1 incorrect");
torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
CH_DOS, CH_UNIX,
gd_iso8859_1.data, gd_iso8859_1.length,
(void *)&gd_output.data, &gd_output.length),
- "conversion from (dos charset) ISO8859-1 to (unix charset) CP850");
+ "conversion from (dos charset) ISO-8859-1 to (unix charset) CP850");
torture_assert_data_blob_equal(tctx, gd_output, gd_cp850, "conversion from UTF16LE to (unix charset) CP850 incorrect");
torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
CH_DOS, CH_UTF8,
gd_iso8859_1.data, gd_iso8859_1.length,
(void *)&gd_output.data, &gd_output.length),
- "conversion from (dos charset) ISO8859-1 to UTF8");
+ "conversion from (dos charset) ISO-8859-1 to UTF8");
torture_assert_data_blob_equal(tctx, gd_output, gd_utf8, "conversion from UTF16LE to UTF8 incorrect");
torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
CH_DOS, CH_UTF16LE,
gd_iso8859_1.data, gd_iso8859_1.length,
(void *)&gd_output.data, &gd_output.length),
- "conversion from (dos charset) ISO8859-1 to UTF16LE");
- torture_assert_data_blob_equal(tctx, gd_output, gd_utf16le, "conversion from (dos charset) ISO8859-1 to UTF16LE");
+ "conversion from (dos charset) ISO-8859-1 to UTF16LE");
+ torture_assert_data_blob_equal(tctx, gd_output, gd_utf16le, "conversion from (dos charset) ISO-8859-1 to UTF16LE");
torture_assert_int_equal(tctx,
strlen_m_ext_handle(iconv_handle,
(const char *)gd_iso8859_1.data,
@@ -273,14 +273,14 @@ static bool test_gd_iso8859_cp850_handle(struct torture_context *tctx)
CH_DOS, CH_UTF8,
gd_iso8859_1.data, gd_iso8859_1.length,
(void *)&gd_output.data, &gd_output.length),
- "conversion from (dos charset) ISO8859-1 to UTF8");
- torture_assert_data_blob_equal(tctx, gd_output, gd_utf8, "conversion from (dos charset) ISO8859-1 to UTF8");
+ "conversion from (dos charset) ISO-8859-1 to UTF8");
+ torture_assert_data_blob_equal(tctx, gd_output, gd_utf8, "conversion from (dos charset) ISO-8859-1 to UTF8");
torture_assert_int_equal(tctx,
strlen_m_ext_handle(iconv_handle,
(const char *)gd_iso8859_1.data,
CH_DOS, CH_UTF8),
gd_output.length,
- "checking strlen_m_ext of conversion from (dos charset) ISO8859-1 to UTF8");
+ "checking strlen_m_ext of conversion from (dos charset) ISO-8859-1 to UTF8");
return true;
}
@@ -502,7 +502,7 @@ static bool test_gd_ascii_handle(struct torture_context *tctx)
(void *)gd_output.data, gd_output.length,
&gd_output.length) == false,
"conversion from UTF8 to (dos charset) ASCII should fail");
- torture_assert_errno_equal(tctx, EILSEQ, "conversion from UTF8 to (dos charset) ISO8859-1 should fail E2BIG");
+ torture_assert_errno_equal(tctx, EILSEQ, "conversion from UTF8 to (dos charset) ISO-8859-1 should fail E2BIG");
torture_assert_int_equal(tctx, gd_output.length, 1, "Should only get 1 char of output");
torture_assert_data_blob_equal(tctx, gd_output, data_blob_string_const("G"), "partial conversion from UTF8 to (dos charset) ASCII incorrect");
@@ -526,7 +526,7 @@ static bool test_gd_ascii_handle(struct torture_context *tctx)
(void *)gd_output.data, gd_output.length,
&gd_output.length) == false,
"conversion from UTF8 to (dos charset) ASCII should fail due to too illigal seqence");
- torture_assert_errno_equal(tctx, EILSEQ, "conversion from UTF8 to (dos charset) ISO8859-1 should fail EILSEQ");
+ torture_assert_errno_equal(tctx, EILSEQ, "conversion from UTF8 to (dos charset) ISO-8859-1 should fail EILSEQ");
torture_assert_int_equal(tctx, gd_output.length, 1, "Should only get 2 char of output");
/* Short input handling confirmation */
@@ -554,7 +554,7 @@ static bool test_plato_english_iso8859_cp850_handle(struct torture_context *tctx
talloc_steal(tctx, plato_english_utf16le.data);
- iconv_handle = get_iconv_testing_handle(tctx, "ISO8859-1", "CP850",
+ iconv_handle = get_iconv_testing_handle(tctx, "ISO-8859-1", "CP850",
lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true));
torture_assert(tctx, iconv_handle, "getting iconv handle");
@@ -562,8 +562,8 @@ static bool test_plato_english_iso8859_cp850_handle(struct torture_context *tctx
CH_UTF8, CH_DOS,
plato_english_utf8.data, plato_english_utf8.length,
(void *)&plato_english_output.data, &plato_english_output.length),
- "conversion from UTF8 to (dos charset) ISO8859-1");
- torture_assert_data_blob_equal(tctx, plato_english_output, plato_english_iso8859_1, "conversion from UTF8 to (dos charset) ISO8859-1 incorrect");
+ "conversion from UTF8 to (dos charset) ISO-8859-1");
+ torture_assert_data_blob_equal(tctx, plato_english_output, plato_english_iso8859_1, "conversion from UTF8 to (dos charset) ISO-8859-1 incorrect");
torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
CH_UTF8, CH_UNIX,
@@ -583,15 +583,15 @@ static bool test_plato_english_iso8859_cp850_handle(struct torture_context *tctx
CH_UTF16LE, CH_DOS,
plato_english_utf16le.data, plato_english_utf16le.length,
(void *)&plato_english_output.data, &plato_english_output.length),
- "conversion from UTF16LE to (dos charset) ISO8859-1");
- torture_assert_data_blob_equal(tctx, plato_english_output, plato_english_iso8859_1, "conversion from UTF16LE to (dos charset) ISO8859-1 incorrect");
+ "conversion from UTF16LE to (dos charset) ISO-8859-1");
+ torture_assert_data_blob_equal(tctx, plato_english_output, plato_english_iso8859_1, "conversion from UTF16LE to (dos charset) ISO-8859-1 incorrect");
torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
CH_DOS, CH_UTF16LE,
plato_english_output.data, plato_english_output.length,
(void *)&plato_english_output2.data, &plato_english_output2.length),
- "round trip conversion from (dos charset) ISO8859-1 back to UTF16LE");
- torture_assert_data_blob_equal(tctx, plato_english_output2, plato_english_utf16le, "round trip conversion from (dos charset) ISO8859-1 back to UTF16LE");
+ "round trip conversion from (dos charset) ISO-8859-1 back to UTF16LE");
+ torture_assert_data_blob_equal(tctx, plato_english_output2, plato_english_utf16le, "round trip conversion from (dos charset) ISO-8859-1 back to UTF16LE");
torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
CH_UTF16LE, CH_UTF8,
@@ -636,29 +636,29 @@ static bool test_plato_english_iso8859_cp850_handle(struct torture_context *tctx
CH_DOS, CH_DOS,
plato_english_iso8859_1.data, plato_english_iso8859_1.length,
(void *)&plato_english_output.data, &plato_english_output.length),
- "conversion from (dos charset) ISO8859-1 to (dos charset) ISO8859-1");
- torture_assert_data_blob_equal(tctx, plato_english_output, plato_english_iso8859_1, "conversion from UTF16LE to (dos charset) ISO8859-1 incorrect");
+ "conversion from (dos charset) ISO-8859-1 to (dos charset) ISO-8859-1");
+ torture_assert_data_blob_equal(tctx, plato_english_output, plato_english_iso8859_1, "conversion from UTF16LE to (dos charset) ISO-8859-1 incorrect");
torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
CH_DOS, CH_UNIX,
plato_english_iso8859_1.data, plato_english_iso8859_1.length,
(void *)&plato_english_output.data, &plato_english_output.length),
- "conversion from (dos charset) ISO8859-1 to (unix charset) CP850");
+ "conversion from (dos charset) ISO-8859-1 to (unix charset) CP850");
torture_assert_data_blob_equal(tctx, plato_english_output, plato_english_cp850, "conversion from UTF16LE to (unix charset) CP850 incorrect");
torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
CH_DOS, CH_UTF8,
plato_english_iso8859_1.data, plato_english_iso8859_1.length,
(void *)&plato_english_output.data, &plato_english_output.length),
- "conversion from (dos charset) ISO8859-1 to UTF8");
+ "conversion from (dos charset) ISO-8859-1 to UTF8");
torture_assert_data_blob_equal(tctx, plato_english_output, plato_english_utf8, "conversion from UTF16LE to UTF8 incorrect");
torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
CH_DOS, CH_UTF16LE,
plato_english_iso8859_1.data, plato_english_iso8859_1.length,
(void *)&plato_english_output.data, &plato_english_output.length),
- "conversion from (dos charset) ISO8859-1 to UTF16LE");
- torture_assert_data_blob_equal(tctx, plato_english_output, plato_english_utf16le, "conversion from (dos charset) ISO8859-1 to UTF16LE");
+ "conversion from (dos charset) ISO-8859-1 to UTF16LE");
+ torture_assert_data_blob_equal(tctx, plato_english_output, plato_english_utf16le, "conversion from (dos charset) ISO-8859-1 to UTF16LE");
return true;
}
@@ -673,7 +673,7 @@ static bool test_plato_english_minus_1_handle(struct torture_context *tctx)
talloc_steal(tctx, plato_english_utf16le.data);
- iconv_handle = get_iconv_testing_handle(tctx, "ISO8859-1", "CP850",
+ iconv_handle = get_iconv_testing_handle(tctx, "ISO-8859-1", "CP850",
lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true));
torture_assert(tctx, iconv_handle, "getting iconv handle");
@@ -815,7 +815,7 @@ static bool test_plato_minus_1_handle(struct torture_context *tctx)
talloc_steal(tctx, plato_utf8.data);
talloc_steal(tctx, plato_utf16le.data);
- iconv_handle = get_iconv_testing_handle(tctx, "ISO8859-1", "CP850",
+ iconv_handle = get_iconv_testing_handle(tctx, "ISO-8859-1", "CP850",
lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true));
torture_assert(tctx, iconv_handle, "getting iconv handle");