powerpc: remove _dl_platform_string and _dl_powerpc_platforms
[glibc.git] / iconv / tst-iconv1.c
blob0609f50e5049fae2c7467ec88d6045f0fb40b00c
1 /* Test case by yaoz@nih.gov. */
3 #include <iconv.h>
4 #include <stddef.h>
5 #include <stdio.h>
6 #include <string.h>
8 static int
9 do_test (void)
11 char utf8[5];
12 wchar_t ucs4[5];
13 iconv_t cd;
14 char *inbuf;
15 char *outbuf;
16 size_t inbytes;
17 size_t outbytes;
18 size_t n;
20 strcpy (utf8, "abcd");
22 /* From UTF8 to UCS4. */
23 cd = iconv_open ("UCS4", "UTF8");
24 if (cd == (iconv_t) -1)
26 perror ("iconv_open");
27 return 1;
30 inbuf = utf8;
31 inbytes = 4;
32 outbuf = (char *) ucs4;
33 outbytes = 4 * sizeof (wchar_t); /* "Argument list too long" error. */
34 n = iconv (cd, &inbuf, &inbytes, &outbuf, &outbytes);
35 if (n == (size_t) -1)
37 printf ("iconv: %m\n");
38 iconv_close (cd);
39 return 1;
41 iconv_close (cd);
43 return 0;
46 #define TEST_FUNCTION do_test ()
47 #include "../test-skeleton.c"