From 5e3ce331880404587eb4d88e314c7cb332da6e33 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 25 Jun 2005 06:13:29 +0000 Subject: r7901: check if system supports UTF-16LE at all in LOCAL-ICONV test (This used to be commit aa9e7cf63a0e5ce7c9b7d121a4df064cd6fae90f) --- source4/torture/local/iconv.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source4/torture') diff --git a/source4/torture/local/iconv.c b/source4/torture/local/iconv.c index e61d3348eb..9aa678995b 100644 --- a/source4/torture/local/iconv.c +++ b/source4/torture/local/iconv.c @@ -315,8 +315,16 @@ BOOL torture_local_iconv(void) unsigned char inbuf[1000]; int ok = 1; unsigned int codepoint, i, c; + static iconv_t cd; + + srandom(time(NULL)); - srandom(time(NULL)); + cd = iconv_open("UTF-16LE", "UCS-4LE"); + if (cd == (iconv_t)-1) { + printf("unable to test - system iconv library does not support UTF-16LE -> UCS-4LE\n"); + return True; + } + iconv_close(cd); printf("Testing next_codepoint()\n"); for (codepoint=0;ok && codepoint<(1<<20);codepoint++) { -- cgit