summaryrefslogtreecommitdiff
path: root/lib/util/charset/tests
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-09-19 19:13:21 -0700
committerAndrew Bartlett <abartlet@samba.org>2011-09-20 06:27:06 +0200
commitf9acf770e9c121aa495cb7e19175a4a6e45ff3d9 (patch)
treeb64283a8a0f929f28de73f84ef207f5f5018f8f9 /lib/util/charset/tests
parent8316577b7538f7204c5fd6328756c4c3f171b36e (diff)
downloadsamba-f9acf770e9c121aa495cb7e19175a4a6e45ff3d9.tar.gz
samba-f9acf770e9c121aa495cb7e19175a4a6e45ff3d9.tar.bz2
samba-f9acf770e9c121aa495cb7e19175a4a6e45ff3d9.zip
lib/util/charset: remove charset module loading
Now that the 'table' modules are gone, there is no reason for there to be charset modules at all. This builds the macosxfs and weird modules into the binary at the appropriate times, and changes the tests to test instead the difference between the remaining internal handlers and iconv(). Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Tue Sep 20 06:27:06 CEST 2011 on sn-devel-104
Diffstat (limited to 'lib/util/charset/tests')
-rw-r--r--lib/util/charset/tests/convert_string.c22
-rw-r--r--lib/util/charset/tests/iconv.c7
2 files changed, 13 insertions, 16 deletions
diff --git a/lib/util/charset/tests/convert_string.c b/lib/util/charset/tests/convert_string.c
index 2c0fe9fc8f..918be496b6 100644
--- a/lib/util/charset/tests/convert_string.c
+++ b/lib/util/charset/tests/convert_string.c
@@ -107,7 +107,7 @@ static bool test_gd_iso8859_cp850_handle(struct torture_context *tctx)
talloc_steal(tctx, gd_utf16le.data);
iconv_handle = get_iconv_testing_handle(tctx, "ISO-8859-1", "CP850",
- lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true));
+ lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "use_builtin_handlers", true));
torture_assert(tctx, iconv_handle, "getting iconv handle");
torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
@@ -300,7 +300,7 @@ static bool test_gd_minus_1_handle(struct torture_context *tctx)
talloc_steal(tctx, gd_utf16le.data);
iconv_handle = get_iconv_testing_handle(tctx, "CP850", "CP850",
- lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true));
+ lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "use_builtin_handlers", true));
torture_assert(tctx, iconv_handle, "getting iconv handle");
gd_utf8_terminated = data_blob_talloc(tctx, NULL, gd_utf8.length + 1);
@@ -485,7 +485,7 @@ static bool test_gd_ascii_handle(struct torture_context *tctx)
talloc_steal(tctx, gd_utf16le.data);
iconv_handle = get_iconv_testing_handle(tctx, "ASCII", "UTF8",
- lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true));
+ lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "use_builtin_handlers", true));
torture_assert(tctx, iconv_handle, "getting iconv handle");
torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
@@ -555,7 +555,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, "ISO-8859-1", "CP850",
- lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true));
+ lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "use_builtin_handlers", true));
torture_assert(tctx, iconv_handle, "getting iconv handle");
torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
@@ -674,7 +674,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, "ISO-8859-1", "CP850",
- lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true));
+ lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "use_builtin_handlers", true));
torture_assert(tctx, iconv_handle, "getting iconv handle");
plato_english_utf8_terminated = data_blob_talloc(tctx, NULL, plato_english_utf8.length + 1);
@@ -816,7 +816,7 @@ static bool test_plato_minus_1_handle(struct torture_context *tctx)
talloc_steal(tctx, plato_utf16le.data);
iconv_handle = get_iconv_testing_handle(tctx, "ISO-8859-1", "CP850",
- lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true));
+ lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "use_builtin_handlers", true));
torture_assert(tctx, iconv_handle, "getting iconv handle");
plato_utf8_terminated = data_blob_talloc(tctx, NULL, plato_utf8.length + 1);
@@ -931,7 +931,7 @@ static bool test_plato_cp850_utf8_handle(struct torture_context *tctx)
talloc_steal(tctx, plato_utf16le.data);
iconv_handle = get_iconv_testing_handle(tctx, "CP850", "UTF8",
- lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true));
+ lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "use_builtin_handlers", true));
torture_assert(tctx, iconv_handle, "creating iconv handle");
torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
@@ -1123,7 +1123,7 @@ static bool test_plato_latin_cp850_utf8_handle(struct torture_context *tctx)
talloc_steal(tctx, plato_latin_utf16le.data);
iconv_handle = get_iconv_testing_handle(tctx, "CP850", "UTF8",
- lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true));
+ lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "use_builtin_handlers", true));
torture_assert(tctx, iconv_handle, "creating iconv handle");
torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
@@ -1192,7 +1192,7 @@ static bool test_gd_case_utf8_handle(struct torture_context *tctx)
talloc_steal(tctx, gd_utf8.data);
iconv_handle = get_iconv_testing_handle(tctx, "ASCII", "UTF8",
- lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true));
+ lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "use_builtin_handlers", true));
torture_assert(tctx, iconv_handle, "getting utf8 iconv handle");
torture_assert(tctx,
@@ -1256,7 +1256,7 @@ static bool test_gd_case_cp850_handle(struct torture_context *tctx)
talloc_steal(tctx, gd_cp850.data);
iconv_handle = get_iconv_testing_handle(tctx, "ASCII", "CP850",
- lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true));
+ lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "use_builtin_handlers", true));
torture_assert(tctx, iconv_handle, "getting cp850 iconv handle");
torture_assert(tctx,
@@ -1318,7 +1318,7 @@ static bool test_plato_case_utf8_handle(struct torture_context *tctx)
talloc_steal(tctx, plato_utf8.data);
iconv_handle = get_iconv_testing_handle(tctx, "ASCII", "UTF8",
- lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true));
+ lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "use_builtin_handlers", true));
torture_assert(tctx, iconv_handle, "getting utf8 iconv handle");
torture_assert(tctx,
diff --git a/lib/util/charset/tests/iconv.c b/lib/util/charset/tests/iconv.c
index 48702e9c50..6704541016 100644
--- a/lib/util/charset/tests/iconv.c
+++ b/lib/util/charset/tests/iconv.c
@@ -35,9 +35,6 @@ static bool iconv_untestable(struct torture_context *tctx)
{
iconv_t cd;
- if (!lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true))
- torture_skip(tctx, "system iconv disabled - skipping test");
-
cd = iconv_open("UTF-16LE", "UCS-4LE");
if (cd == (iconv_t)-1)
torture_skip(tctx, "unable to test - system iconv library does not support UTF-16LE -> UCS-4LE");
@@ -158,14 +155,14 @@ static bool test_buffer(struct torture_context *test,
"failed to open %s to UTF-16LE",
charset));
}
- cd2 = smb_iconv_open_ex(test, charset, "UTF-16LE", false);
+ cd2 = smb_iconv_open_ex(test, charset, "UTF-16LE", lpcfg_parm_bool(test->lp_ctx, NULL, "iconv", "use_builtin_handlers", true));
if (cd2 == (iconv_t)-1) {
torture_fail(test,
talloc_asprintf(test,
"failed to open %s to UTF-16LE via smb_iconv_open_ex",
charset));
}
- cd3 = smb_iconv_open_ex(test, "UTF-16LE", charset, false);
+ cd3 = smb_iconv_open_ex(test, "UTF-16LE", charset, lpcfg_parm_bool(test->lp_ctx, NULL, "iconv", "use_builtin_handlers", true));
if (cd3 == (iconv_t)-1) {
torture_fail(test,
talloc_asprintf(test,