Update contrib.
2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
28 TBool __bb = (cond); \
32 ERR_PRINTF1(_L("ERROR: Test Failed")); \
37 ///////////////////////////////////////////////////////////////////////////////////////
38 ///////////////////////////////////////////////////////////////////////////////////////
40 @SYMTestCaseID SYSLIB-CHARCONV-CT-0571
41 @SYMTestCaseDesc CnvUtfConverter class functionality test
42 @SYMTestPriority Medium
43 @SYMTestActions Checking that Java-conformant UTF-8 is generated and handled correctly
44 @SYMTestExpectedResults Test must not fail
47 void CT_JAVA::Test_JAVA()
49 RFs fileServerSession;
50 CleanupClosePushL(fileServerSession);
51 User::LeaveIfError(fileServerSession.Connect());
52 CCnvCharacterSetConverter* characterSetConverter=CCnvCharacterSetConverter::NewLC();
53 INFO_PRINTF1(_L(" @SYMTestCaseID:SYSLIB-CHARCONV-CT-0571 Checking that Java-conformant UTF-8 is generated and handled correctly "));
54 test(characterSetConverter->PrepareToConvertToOrFromL(KCharacterSetIdentifierJavaConformantUtf8, fileServerSession)==CCnvCharacterSetConverter::EAvailable);
56 TBuf16<32> generatedUnicode;
57 TBuf8<64> generatedUtf8;
58 TInt convertToUnicodeState = CCnvCharacterSetConverter::KStateDefault;
61 INFO_PRINTF1(_L("Testing the behaviour of the Unicode character 0x0000"));
63 unicode.Format(_L16("%c"), 0x0000);
64 test(CnvUtfConverter::ConvertFromUnicodeToUtf8(generatedUtf8, unicode)==0);
65 test(generatedUtf8==TPtrC8(REINTERPRET_CAST(const TText8*, "\x00"), 1)); // can't use _L8 as that gets the length by assuming it's a zero-terminated string
66 test(CnvUtfConverter::ConvertToUnicodeFromUtf8(generatedUnicode, generatedUtf8)==0);
67 test(generatedUnicode==unicode);
68 test(characterSetConverter->ConvertFromUnicode(generatedUtf8, unicode)==0);
69 test(generatedUtf8==_L8("\xc0\x80"));
70 test(characterSetConverter->ConvertToUnicode(generatedUnicode, generatedUtf8, convertToUnicodeState)==0);
71 test(generatedUnicode==unicode);
73 unicode.Format(_L16("%c%c"), 0x0000, 0x0026);
74 test(CnvUtfConverter::ConvertFromUnicodeToUtf8(generatedUtf8, unicode)==0);
75 test(generatedUtf8==TPtrC8(REINTERPRET_CAST(const TText8*, "\x00\x26"), 2)); // can't use _L8 as that gets the length by assuming it's a zero-terminated string
76 test(CnvUtfConverter::ConvertToUnicodeFromUtf8(generatedUnicode, generatedUtf8)==0);
77 test(generatedUnicode==unicode);
78 test(characterSetConverter->ConvertFromUnicode(generatedUtf8, unicode)==0);
79 test(generatedUtf8==_L8("\xc0\x80\x26"));
80 test(characterSetConverter->ConvertToUnicode(generatedUnicode, generatedUtf8, convertToUnicodeState)==0);
81 test(generatedUnicode==unicode);
83 unicode.Format(_L16("%c%c"), 0x0000, 0x05d9);
84 test(CnvUtfConverter::ConvertFromUnicodeToUtf8(generatedUtf8, unicode)==0);
85 test(generatedUtf8==TPtrC8(REINTERPRET_CAST(const TText8*, "\x00\xd7\x99"), 3)); // can't use _L8 as that gets the length by assuming it's a zero-terminated string
86 test(CnvUtfConverter::ConvertToUnicodeFromUtf8(generatedUnicode, generatedUtf8)==0);
87 test(generatedUnicode==unicode);
88 test(characterSetConverter->ConvertFromUnicode(generatedUtf8, unicode)==0);
89 test(generatedUtf8==_L8("\xc0\x80\xd7\x99"));
90 test(characterSetConverter->ConvertToUnicode(generatedUnicode, generatedUtf8, convertToUnicodeState)==0);
91 test(generatedUnicode==unicode);
93 unicode.Format(_L16("%c%c"), 0x0000, 0x81ea);
94 test(CnvUtfConverter::ConvertFromUnicodeToUtf8(generatedUtf8, unicode)==0);
95 test(generatedUtf8==TPtrC8(REINTERPRET_CAST(const TText8*, "\x00\xe8\x87\xaa"), 4)); // can't use _L8 as that gets the length by assuming it's a zero-terminated string
96 test(CnvUtfConverter::ConvertToUnicodeFromUtf8(generatedUnicode, generatedUtf8)==0);
97 test(generatedUnicode==unicode);
98 test(characterSetConverter->ConvertFromUnicode(generatedUtf8, unicode)==0);
99 test(generatedUtf8==_L8("\xc0\x80\xe8\x87\xaa"));
100 test(characterSetConverter->ConvertToUnicode(generatedUnicode, generatedUtf8, convertToUnicodeState)==0);
101 test(generatedUnicode==unicode);
103 unicode.Format(_L16("%c%c%c"), 0x0000, 0xd9e0, 0xdda3);
104 test(CnvUtfConverter::ConvertFromUnicodeToUtf8(generatedUtf8, unicode)==0);
105 test(generatedUtf8==TPtrC8(REINTERPRET_CAST(const TText8*, "\x00\xf2\x88\x86\xa3"), 5)); // can't use _L8 as that gets the length by assuming it's a zero-terminated string
106 test(CnvUtfConverter::ConvertToUnicodeFromUtf8(generatedUnicode, generatedUtf8)==0);
107 test(generatedUnicode==unicode);
108 test(characterSetConverter->ConvertFromUnicode(generatedUtf8, unicode)==0);
109 test(generatedUtf8==_L8("\xc0\x80\xed\xa7\xa0\xed\xb6\xa3"));
110 test(characterSetConverter->ConvertToUnicode(generatedUnicode, generatedUtf8, convertToUnicodeState)==0);
111 test(generatedUnicode.Length()==7);
112 test(generatedUnicode[0]==0x0000);
113 test(generatedUnicode[1]==0xFFFD);
114 test(generatedUnicode[2]==0xFFFD);
115 test(generatedUnicode[3]==0xFFFD);
116 test(generatedUnicode[4]==0xFFFD);
117 test(generatedUnicode[5]==0xFFFD);
118 test(generatedUnicode[6]==0xFFFD);
120 unicode.Format(_L16("%c%c"), 0x0071, 0x0000);
121 test(CnvUtfConverter::ConvertFromUnicodeToUtf8(generatedUtf8, unicode)==0);
122 test(generatedUtf8==TPtrC8(REINTERPRET_CAST(const TText8*, "\x71\x00"), 2)); // can't use _L8 as that gets the length by assuming it's a zero-terminated string
123 test(CnvUtfConverter::ConvertToUnicodeFromUtf8(generatedUnicode, generatedUtf8)==0);
124 test(generatedUnicode==unicode);
125 test(characterSetConverter->ConvertFromUnicode(generatedUtf8, unicode)==0);
126 test(generatedUtf8==_L8("\x71\xc0\x80"));
127 test(characterSetConverter->ConvertToUnicode(generatedUnicode, generatedUtf8, convertToUnicodeState)==0);
128 test(generatedUnicode==unicode);
130 unicode.Format(_L16("%c%c"), 0x06aa, 0x0000);
131 test(CnvUtfConverter::ConvertFromUnicodeToUtf8(generatedUtf8, unicode)==0);
132 test(generatedUtf8==TPtrC8(REINTERPRET_CAST(const TText8*, "\xda\xaa\x00"), 3)); // can't use _L8 as that gets the length by assuming it's a zero-terminated string
133 test(CnvUtfConverter::ConvertToUnicodeFromUtf8(generatedUnicode, generatedUtf8)==0);
134 test(generatedUnicode==unicode);
135 test(characterSetConverter->ConvertFromUnicode(generatedUtf8, unicode)==0);
136 test(generatedUtf8==_L8("\xda\xaa\xc0\x80"));
137 test(characterSetConverter->ConvertToUnicode(generatedUnicode, generatedUtf8, convertToUnicodeState)==0);
138 test(generatedUnicode==unicode);
140 unicode.Format(_L16("%c%c"), 0xc427, 0x0000);
141 test(CnvUtfConverter::ConvertFromUnicodeToUtf8(generatedUtf8, unicode)==0);
142 test(generatedUtf8==TPtrC8(REINTERPRET_CAST(const TText8*, "\xec\x90\xa7\x00"), 4)); // can't use _L8 as that gets the length by assuming it's a zero-terminated string
143 test(CnvUtfConverter::ConvertToUnicodeFromUtf8(generatedUnicode, generatedUtf8)==0);
144 test(generatedUnicode==unicode);
145 test(characterSetConverter->ConvertFromUnicode(generatedUtf8, unicode)==0);
146 test(generatedUtf8==_L8("\xec\x90\xa7\xc0\x80"));
147 test(characterSetConverter->ConvertToUnicode(generatedUnicode, generatedUtf8, convertToUnicodeState)==0);
148 test(generatedUnicode==unicode);
150 unicode.Format(_L16("%c%c%c"), 0xd801, 0xdef1, 0x0000);
151 test(CnvUtfConverter::ConvertFromUnicodeToUtf8(generatedUtf8, unicode)==0);
152 test(generatedUtf8==TPtrC8(REINTERPRET_CAST(const TText8*, "\xf0\x90\x9b\xb1\x00"), 5)); // can't use _L8 as that gets the length by assuming it's a zero-terminated string
153 test(CnvUtfConverter::ConvertToUnicodeFromUtf8(generatedUnicode, generatedUtf8)==0);
154 test(generatedUnicode==unicode);
155 test(characterSetConverter->ConvertFromUnicode(generatedUtf8, unicode)==0);
156 test(generatedUtf8==_L8("\xed\xa0\x81\xed\xbb\xb1\xc0\x80"));
157 test(characterSetConverter->ConvertToUnicode(generatedUnicode, generatedUtf8, convertToUnicodeState)==0);
158 test(generatedUnicode.Length()==7);
159 test(generatedUnicode[0]==0xFFFD);
160 test(generatedUnicode[1]==0xFFFD);
161 test(generatedUnicode[2]==0xFFFD);
162 test(generatedUnicode[3]==0xFFFD);
163 test(generatedUnicode[4]==0xFFFD);
164 test(generatedUnicode[5]==0xFFFD);
165 test(generatedUnicode[6]==0x0000);
167 INFO_PRINTF1(_L("Testing the generation of UTF-8 from surrogate pairs"));
168 unicode.Format(_L16("%c"), 0xd7ff);
169 test(CnvUtfConverter::ConvertFromUnicodeToUtf8(generatedUtf8, unicode)==0);
170 test(generatedUtf8==_L8("\xed\x9f\xbf"));
171 test(CnvUtfConverter::ConvertToUnicodeFromUtf8(generatedUnicode, generatedUtf8)==0);
172 test(generatedUnicode==unicode);
173 test(characterSetConverter->ConvertFromUnicode(generatedUtf8, unicode)==0);
174 test(generatedUtf8==_L8("\xed\x9f\xbf"));
175 test(characterSetConverter->ConvertToUnicode(generatedUnicode, generatedUtf8, convertToUnicodeState)==0);
176 test(generatedUnicode==unicode);
178 unicode.Format(_L16("%c"), 0xe000);
179 test(CnvUtfConverter::ConvertFromUnicodeToUtf8(generatedUtf8, unicode)==0);
180 test(generatedUtf8==_L8("\xee\x80\x80"));
181 test(CnvUtfConverter::ConvertToUnicodeFromUtf8(generatedUnicode, generatedUtf8)==0);
182 test(generatedUnicode==unicode);
183 test(characterSetConverter->ConvertFromUnicode(generatedUtf8, unicode)==0);
184 test(generatedUtf8==_L8("\xee\x80\x80"));
185 test(characterSetConverter->ConvertToUnicode(generatedUnicode, generatedUtf8, convertToUnicodeState)==0);
186 test(generatedUnicode==unicode);
188 unicode.Format(_L16("%c%c"), 0xd800, 0xdc00);
189 test(CnvUtfConverter::ConvertFromUnicodeToUtf8(generatedUtf8, unicode)==0);
190 test(generatedUtf8==_L8("\xf0\x90\x80\x80"));
191 test(CnvUtfConverter::ConvertToUnicodeFromUtf8(generatedUnicode, generatedUtf8)==0);
192 test(generatedUnicode==unicode);
193 test(characterSetConverter->ConvertFromUnicode(generatedUtf8, unicode)==0);
194 test(generatedUtf8==_L8("\xed\xa0\x80\xed\xb0\x80"));
195 test(characterSetConverter->ConvertToUnicode(generatedUnicode, generatedUtf8, convertToUnicodeState)==0);
196 test(generatedUnicode.Length()==6);
197 test(generatedUnicode[0]==0xFFFD);
198 test(generatedUnicode[1]==0xFFFD);
199 test(generatedUnicode[2]==0xFFFD);
200 test(generatedUnicode[3]==0xFFFD);
201 test(generatedUnicode[4]==0xFFFD);
202 test(generatedUnicode[5]==0xFFFD);
204 unicode.Format(_L16("%c%c"), 0xd800, 0xdfff);
205 test(CnvUtfConverter::ConvertFromUnicodeToUtf8(generatedUtf8, unicode)==0);
206 test(generatedUtf8==_L8("\xf0\x90\x8f\xbf"));
207 test(CnvUtfConverter::ConvertToUnicodeFromUtf8(generatedUnicode, generatedUtf8)==0);
208 test(generatedUnicode==unicode);
209 test(characterSetConverter->ConvertFromUnicode(generatedUtf8, unicode)==0);
210 test(generatedUtf8==_L8("\xed\xa0\x80\xed\xbf\xbf"));
211 test(characterSetConverter->ConvertToUnicode(generatedUnicode, generatedUtf8, convertToUnicodeState)==0);
212 test(generatedUnicode.Length()==6);
213 test(generatedUnicode[0]==0xFFFD);
214 test(generatedUnicode[1]==0xFFFD);
215 test(generatedUnicode[2]==0xFFFD);
216 test(generatedUnicode[3]==0xFFFD);
217 test(generatedUnicode[4]==0xFFFD);
218 test(generatedUnicode[5]==0xFFFD);
220 unicode.Format(_L16("%c%c"), 0xdbff, 0xdc00);
221 test(CnvUtfConverter::ConvertFromUnicodeToUtf8(generatedUtf8, unicode)==0);
222 test(generatedUtf8==_L8("\xf4\x8f\xb0\x80"));
223 test(CnvUtfConverter::ConvertToUnicodeFromUtf8(generatedUnicode, generatedUtf8)==0);
224 test(generatedUnicode==unicode);
225 test(characterSetConverter->ConvertFromUnicode(generatedUtf8, unicode)==0);
226 test(generatedUtf8==_L8("\xed\xaf\xbf\xed\xb0\x80"));
227 test(characterSetConverter->ConvertToUnicode(generatedUnicode, generatedUtf8, convertToUnicodeState)==0);
228 test(generatedUnicode.Length()==6);
229 test(generatedUnicode[0]==0xFFFD);
230 test(generatedUnicode[1]==0xFFFD);
231 test(generatedUnicode[2]==0xFFFD);
232 test(generatedUnicode[3]==0xFFFD);
233 test(generatedUnicode[4]==0xFFFD);
234 test(generatedUnicode[5]==0xFFFD);
236 unicode.Format(_L16("%c%c"), 0xdbff, 0xdfff);
237 test(CnvUtfConverter::ConvertFromUnicodeToUtf8(generatedUtf8, unicode)==0);
238 test(generatedUtf8==_L8("\xf4\x8f\xbf\xbf"));
239 test(CnvUtfConverter::ConvertToUnicodeFromUtf8(generatedUnicode, generatedUtf8)==0);
240 test(generatedUnicode==unicode);
241 test(characterSetConverter->ConvertFromUnicode(generatedUtf8, unicode)==0);
242 test(generatedUtf8==_L8("\xed\xaf\xbf\xed\xbf\xbf"));
243 test(characterSetConverter->ConvertToUnicode(generatedUnicode, generatedUtf8, convertToUnicodeState)==0);
244 test(generatedUnicode.Length()==6);
245 test(generatedUnicode[0]==0xFFFD);
246 test(generatedUnicode[1]==0xFFFD);
247 test(generatedUnicode[2]==0xFFFD);
248 test(generatedUnicode[3]==0xFFFD);
249 test(generatedUnicode[4]==0xFFFD);
250 test(generatedUnicode[5]==0xFFFD);
252 unicode.Format(_L16("%c%c"), 0xd8e9, 0xdcd4);
253 test(CnvUtfConverter::ConvertFromUnicodeToUtf8(generatedUtf8, unicode)==0);
254 test(generatedUtf8==_L8("\xf1\x8a\x93\x94"));
255 test(CnvUtfConverter::ConvertToUnicodeFromUtf8(generatedUnicode, generatedUtf8)==0);
256 test(generatedUnicode==unicode);
257 test(characterSetConverter->ConvertFromUnicode(generatedUtf8, unicode)==0);
258 test(generatedUtf8==_L8("\xed\xa3\xa9\xed\xb3\x94"));
259 test(characterSetConverter->ConvertToUnicode(generatedUnicode, generatedUtf8, convertToUnicodeState)==0);
260 test(generatedUnicode.Length()==6);
261 test(generatedUnicode[0]==0xFFFD);
262 test(generatedUnicode[1]==0xFFFD);
263 test(generatedUnicode[2]==0xFFFD);
264 test(generatedUnicode[3]==0xFFFD);
265 test(generatedUnicode[4]==0xFFFD);
266 test(generatedUnicode[5]==0xFFFD);
268 unicode.Format(_L16("%c%c%c"), 0xd8e9, 0xdcd4, 0x003e);
269 test(CnvUtfConverter::ConvertFromUnicodeToUtf8(generatedUtf8, unicode)==0);
270 test(generatedUtf8==_L8("\xf1\x8a\x93\x94\x3e"));
271 test(CnvUtfConverter::ConvertToUnicodeFromUtf8(generatedUnicode, generatedUtf8)==0);
272 test(generatedUnicode==unicode);
273 test(characterSetConverter->ConvertFromUnicode(generatedUtf8, unicode)==0);
274 test(generatedUtf8==_L8("\xed\xa3\xa9\xed\xb3\x94\x3e"));
275 test(characterSetConverter->ConvertToUnicode(generatedUnicode, generatedUtf8, convertToUnicodeState)==0);
276 test(generatedUnicode.Length()==7);
277 test(generatedUnicode[0]==0xFFFD);
278 test(generatedUnicode[1]==0xFFFD);
279 test(generatedUnicode[2]==0xFFFD);
280 test(generatedUnicode[3]==0xFFFD);
281 test(generatedUnicode[4]==0xFFFD);
282 test(generatedUnicode[5]==0xFFFD);
283 test(generatedUnicode[6]==0x003e);
285 unicode.Format(_L16("%c%c%c"), 0xd8e9, 0xdcd4, 0x01e9);
286 test(CnvUtfConverter::ConvertFromUnicodeToUtf8(generatedUtf8, unicode)==0);
287 test(generatedUtf8==_L8("\xf1\x8a\x93\x94\xc7\xa9"));
288 test(CnvUtfConverter::ConvertToUnicodeFromUtf8(generatedUnicode, generatedUtf8)==0);
289 test(generatedUnicode==unicode);
290 test(characterSetConverter->ConvertFromUnicode(generatedUtf8, unicode)==0);
291 test(generatedUtf8==_L8("\xed\xa3\xa9\xed\xb3\x94\xc7\xa9"));
292 test(characterSetConverter->ConvertToUnicode(generatedUnicode, generatedUtf8, convertToUnicodeState)==0);
293 test(generatedUnicode.Length()==7);
294 test(generatedUnicode[0]==0xFFFD);
295 test(generatedUnicode[1]==0xFFFD);
296 test(generatedUnicode[2]==0xFFFD);
297 test(generatedUnicode[3]==0xFFFD);
298 test(generatedUnicode[4]==0xFFFD);
299 test(generatedUnicode[5]==0xFFFD);
300 test(generatedUnicode[6]==0x01e9);
302 unicode.Format(_L16("%c%c%c"), 0xd8e9, 0xdcd4, 0x1f9a);
303 test(CnvUtfConverter::ConvertFromUnicodeToUtf8(generatedUtf8, unicode)==0);
304 test(generatedUtf8==_L8("\xf1\x8a\x93\x94\xe1\xbe\x9a"));
305 test(CnvUtfConverter::ConvertToUnicodeFromUtf8(generatedUnicode, generatedUtf8)==0);
306 test(generatedUnicode==unicode);
307 test(characterSetConverter->ConvertFromUnicode(generatedUtf8, unicode)==0);
308 test(generatedUtf8==_L8("\xed\xa3\xa9\xed\xb3\x94\xe1\xbe\x9a"));
309 test(characterSetConverter->ConvertToUnicode(generatedUnicode, generatedUtf8, convertToUnicodeState)==0);
310 test(generatedUnicode.Length()==7);
311 test(generatedUnicode[0]==0xFFFD);
312 test(generatedUnicode[1]==0xFFFD);
313 test(generatedUnicode[2]==0xFFFD);
314 test(generatedUnicode[3]==0xFFFD);
315 test(generatedUnicode[4]==0xFFFD);
316 test(generatedUnicode[5]==0xFFFD);
317 test(generatedUnicode[6]==0x1f9a);
319 unicode.Format(_L16("%c%c%c"), 0x0025, 0xd8e9, 0xdcd4);
320 test(CnvUtfConverter::ConvertFromUnicodeToUtf8(generatedUtf8, unicode)==0);
321 test(generatedUtf8==_L8("\x25\xf1\x8a\x93\x94"));
322 test(CnvUtfConverter::ConvertToUnicodeFromUtf8(generatedUnicode, generatedUtf8)==0);
323 test(generatedUnicode==unicode);
324 test(characterSetConverter->ConvertFromUnicode(generatedUtf8, unicode)==0);
325 test(generatedUtf8==_L8("\x25\xed\xa3\xa9\xed\xb3\x94"));
326 test(characterSetConverter->ConvertToUnicode(generatedUnicode, generatedUtf8, convertToUnicodeState)==0);
327 test(generatedUnicode.Length()==7);
328 test(generatedUnicode[0]==0x0025);
329 test(generatedUnicode[1]==0xFFFD);
330 test(generatedUnicode[2]==0xFFFD);
331 test(generatedUnicode[3]==0xFFFD);
332 test(generatedUnicode[4]==0xFFFD);
333 test(generatedUnicode[5]==0xFFFD);
334 test(generatedUnicode[6]==0xFFFD);
336 unicode.Format(_L16("%c%c%c"), 0x00a5, 0xd8e9, 0xdcd4);
337 test(CnvUtfConverter::ConvertFromUnicodeToUtf8(generatedUtf8, unicode)==0);
338 test(generatedUtf8==_L8("\xc2\xa5\xf1\x8a\x93\x94"));
339 test(CnvUtfConverter::ConvertToUnicodeFromUtf8(generatedUnicode, generatedUtf8)==0);
340 test(generatedUnicode==unicode);
341 test(characterSetConverter->ConvertFromUnicode(generatedUtf8, unicode)==0);
342 test(generatedUtf8==_L8("\xc2\xa5\xed\xa3\xa9\xed\xb3\x94"));
343 test(characterSetConverter->ConvertToUnicode(generatedUnicode, generatedUtf8, convertToUnicodeState)==0);
344 test(generatedUnicode.Length()==7);
345 test(generatedUnicode[0]==0x00a5);
346 test(generatedUnicode[1]==0xFFFD);
347 test(generatedUnicode[2]==0xFFFD);
348 test(generatedUnicode[3]==0xFFFD);
349 test(generatedUnicode[4]==0xFFFD);
350 test(generatedUnicode[5]==0xFFFD);
351 test(generatedUnicode[6]==0xFFFD);
353 unicode.Format(_L16("%c%c%c"), 0x0ca6, 0xd8e9, 0xdcd4);
354 test(CnvUtfConverter::ConvertFromUnicodeToUtf8(generatedUtf8, unicode)==0);
355 test(generatedUtf8==_L8("\xe0\xb2\xa6\xf1\x8a\x93\x94"));
356 test(CnvUtfConverter::ConvertToUnicodeFromUtf8(generatedUnicode, generatedUtf8)==0);
357 test(generatedUnicode==unicode);
358 test(characterSetConverter->ConvertFromUnicode(generatedUtf8, unicode)==0);
359 test(generatedUtf8==_L8("\xe0\xb2\xa6\xed\xa3\xa9\xed\xb3\x94"));
360 test(characterSetConverter->ConvertToUnicode(generatedUnicode, generatedUtf8, convertToUnicodeState)==0);
361 test(generatedUnicode.Length()==7);
362 test(generatedUnicode[0]==0x0ca6);
363 test(generatedUnicode[1]==0xFFFD);
364 test(generatedUnicode[2]==0xFFFD);
365 test(generatedUnicode[3]==0xFFFD);
366 test(generatedUnicode[4]==0xFFFD);
367 test(generatedUnicode[5]==0xFFFD);
368 test(generatedUnicode[6]==0xFFFD);
370 // Additional tests added for INC117111...
372 generatedUtf8.Format(_L8("\xe0\xb2\xa6\xc0"));
373 test(characterSetConverter->ConvertToUnicode(generatedUnicode, generatedUtf8, convertToUnicodeState)==1);
374 test(generatedUnicode[0]==0x0ca6);
376 generatedUtf8.Format(_L8("\xc0"));
377 test(characterSetConverter->ConvertToUnicode(generatedUnicode, generatedUtf8, convertToUnicodeState)==CnvUtfConverter::EErrorIllFormedInput);
379 CleanupStack::PopAndDestroy(2); // characterSetConverter and fileServerSession
385 SetTestStepName(KTestStep_T_JAVA);
388 TVerdict CT_JAVA::doTestStepL()
390 SetTestStepResult(EFail);
394 TRAPD(error1, Test_JAVA());
398 if(error1 == KErrNone )
400 SetTestStepResult(EPass);
403 return TestStepResult();