diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-09-10 13:23:22 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-09-10 14:18:06 +0200 |
commit | 0022296349ef95896b0e83a5ac496edba043a98c (patch) | |
tree | 4e7ed925c4de80d2286b9932b2a5cad8496c45a0 /lib/util/charset | |
parent | 2085dffddb36e8ac3cfe83c3f318d49c96408274 (diff) | |
download | samba-0022296349ef95896b0e83a5ac496edba043a98c.tar.gz samba-0022296349ef95896b0e83a5ac496edba043a98c.tar.bz2 samba-0022296349ef95896b0e83a5ac496edba043a98c.zip |
lib/util/charset: Improve toture assertions in iconv test
Diffstat (limited to 'lib/util/charset')
-rw-r--r-- | lib/util/charset/tests/iconv.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/util/charset/tests/iconv.c b/lib/util/charset/tests/iconv.c index c27c263cfc..62b8d37915 100644 --- a/lib/util/charset/tests/iconv.c +++ b/lib/util/charset/tests/iconv.c @@ -159,7 +159,19 @@ static bool test_buffer(struct torture_context *test, charset)); } cd2 = smb_iconv_open_ex(test, charset, "UTF-16LE", lpcfg_parm_bool(test->lp_ctx, NULL, "iconv", "native", 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, lpcfg_parm_bool(test->lp_ctx, NULL, "iconv", "native", true)); + if (cd3 == (iconv_t)-1) { + torture_fail(test, + talloc_asprintf(test, + "failed to open UTF-16LE to %s via smb_iconv_open_ex", + charset)); + } last_charset = charset; } @@ -206,7 +218,8 @@ static bool test_buffer(struct torture_context *test, show_buf(" rem1:", inbuf+(size-size_in1), size_in1); show_buf(" rem2:", inbuf+(size-size_in2), size_in2); torture_fail(test, talloc_asprintf(test, - "e1=%d/%s e2=%d/%s", + "errno mismatch with %s internal=%d/%s system=%d/%s", + charset, errno1, strerror(errno1), errno2, strerror(errno2))); } |