1 /*
2  *  TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY
3  *
4  *	 FILE:	dat_wcrtomb.c
5  *
6  *	 WCRTOMB:  intwcrtomb (char *s, wchar_t wc, mbstate_t *ps);
7  *
8  */
9 
10 TST_WCRTOMB tst_wcrtomb_loc [] = {
11   {
12     { Twcrtomb, TST_LOC_de },
13     {
14       /* #01 : normal case			       */
15       { /*input.*/ { 1,		 0x00FC,   0,0 },
16 	/*expect*/ { 0,	   1,1,	 "�"	       },
17       },
18       /* #02 : normal case			       */
19       { /*input.*/ { 1,		 0x00D6,   0,0 },
20 	/*expect*/ { 0,	   1,1,	 "�"	       },
21       },
22       /* #03 : error case			       */
23       { /*input.*/ { 1,		 0xFFA1,   0,0 },
24 	/*expect*/ {  EILSEQ,1,-1, ""	       },
25       },
26       /* #04 :				       */
27       { /*input.*/ { 0,		 0x0041,   0,0 },
28 	/*expect*/ { 0,	   1,1,	 ""	       },
29       },
30       /* #05 :				       */
31       { /*input.*/ { 0,		 0x0092,   0,0 },
32 	/*expect*/ { 0,	   1,1,	 ""	       },
33       },
34       { .is_last = 1 }
35     }
36   },
37   {
38     { Twcrtomb, TST_LOC_enUS },
39     {
40       /* #01 : normal case			       */
41       { /*input.*/ { 1,		 0x0041,   0,0 },
42 	/*expect*/ { 0,	   1,1,	 "A"	       },
43       },
44       /* #02 : normal case			       */
45       { /*input.*/ { 1,		 0x0042,   0,0 },
46 	/*expect*/ { 0,	   1,1,	 "B"	       },
47       },
48       /* #03 : error case			       */
49       /* <WAIVER> x 2 */
50       { /*input.*/ { 1,		 0x0092,   0,0 },  /* assume ascii */
51 	/*expect*/ {  EILSEQ,1,-1, ""	       },
52       },
53       /* #04 :				       */
54       { /*input.*/ { 0,		 0x0041,   0,0 },
55 	/*expect*/ { 0,	   1,1,	 ""	       },
56       },
57       /* #05 :				       */
58       { /*input.*/ { 0,		 0x0092,   0,0 },
59 	/*expect*/ { 0,	   1,1,	 ""	       },
60       },
61       { .is_last = 1 }
62     }
63   },
64 #if 0
65   {
66     { Twcrtomb, TST_LOC_eucJP },
67     {
68       /* #01 : normal case			       */
69       { /*input.*/ { 1,		 0x3042,   0,0 },
70 	/*expect*/ { 0,      1,2,  "\244\242"	   },
71       },
72       /* #02 : normal case			       */
73       { /*input.*/ { 1,		 0x3044,   0,0 },
74 	/*expect*/ { 0,      1,2,  "\244\244"	   },
75       },
76       /* #03 : normal case			       */
77       { /*input.*/ { 1,		 0x008E,   0,0 },
78 	/*expect*/ { EILSEQ, 1,-1, ""	       },
79       },
80       /* #04 :				       */
81       { /*input.*/ { 0,		 0x3042,   0,0 },
82 	/*expect*/ { 0,	   0,0,	 ""	       },
83       },
84       /* #05 :				       */
85       { /*input.*/ { 0,		 0x008E,   0,0 },
86 	/*expect*/ { 0,	   0,0,	 ""	       },
87       },
88       { .is_last = 1 }
89     }
90   },
91 #else
92   {
93     { Twcrtomb, TST_LOC_ja_UTF8 },
94     {
95       /* #01 : normal case			       */
96       { /*input.*/ { 1,		 0x3042,   0,0 },
97 	/*expect*/ { 0,      1,3,  "\343\201\202"	   },
98       },
99       /* #02 : normal case			       */
100       { /*input.*/ { 1,		 0x3044,   0,0 },
101 	/*expect*/ { 0,      1,3,  "\343\201\204"	   },
102       },
103       /* #03 : normal case			       */
104       { /*input.*/ { 1,		 0x008E,   0,0 },
105 	/*expect*/ { EILSEQ, 1,-1, ""	       },
106       },
107       /* #04 :				       */
108       { /*input.*/ { 0,		 0x3042,   0,0 },
109 	/*expect*/ { 0,	   0,0,	 ""	       },
110       },
111       /* #05 :				       */
112       { /*input.*/ { 0,		 0x008E,   0,0 },
113 	/*expect*/ { 0,	   0,0,	 ""	       },
114       },
115       { .is_last = 1 }
116     }
117   },
118 #endif
119   {
120     { Twcrtomb, TST_LOC_end }
121   }
122 };
123