summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-09-10 13:23:22 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-09-10 14:18:06 +0200
commit0022296349ef95896b0e83a5ac496edba043a98c (patch)
tree4e7ed925c4de80d2286b9932b2a5cad8496c45a0
parent2085dffddb36e8ac3cfe83c3f318d49c96408274 (diff)
downloadsamba-0022296349ef95896b0e83a5ac496edba043a98c.tar.gz
samba-0022296349ef95896b0e83a5ac496edba043a98c.tar.bz2
samba-0022296349ef95896b0e83a5ac496edba043a98c.zip
lib/util/charset: Improve toture assertions in iconv test
-rw-r--r--lib/util/charset/tests/iconv.c15
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)));
}