1397 |
1397 |
1398 // string 4: mixed, with corrupt surrogate |
1398 // string 4: mixed, with corrupt surrogate |
1399 _LIT(KCorruptString1, "ab\xD840\xDDAD e\xDDAD\xD840"); |
1399 _LIT(KCorruptString1, "ab\xD840\xDDAD e\xDDAD\xD840"); |
1400 TBuf16<128> s04(KCorruptString1); |
1400 TBuf16<128> s04(KCorruptString1); |
1401 test(s04.FindCorruptSurrogate() == 6); |
1401 test(s04.FindCorruptSurrogate() == 6); |
|
1402 |
|
1403 // string 5: fill |
|
1404 _LIT(KOddString5, "0123456"); |
|
1405 TBuf16<128> s05(KOddString5); |
|
1406 s05.Fill2(0x21000); |
|
1407 test(s05 == _L("\xD844\xDC00\xD844\xDC00\xD844\xDC00\xD844")); |
|
1408 s05.Fill2(' '); |
|
1409 test(s05 == _L(" ")); |
|
1410 s05.AppendFill2(0x22222, 2); |
|
1411 s05.AppendFill2(0x22222, 3); |
|
1412 test(s05 == _L(" \xD848\xDE22\xD848\xDE22\xD848")); |
|
1413 |
|
1414 // string 6: locate |
|
1415 // from Unicode 5.0, CaseFolding.txt |
|
1416 // 10400; C; 10428; # DESERET CAPITAL LETTER LONG I |
|
1417 // 0x10400's fold is 0x10428 |
|
1418 TCharF f06(0x10400); |
|
1419 test(f06 == 0x10428); // just to ensure the property is correct |
|
1420 // 0x10400: D801, DC00 |
|
1421 // 0x10428: D801, DC28 |
|
1422 _LIT(KMixedString6, "ab\xD801\xDC00 e\xD801\xDC27"); |
|
1423 TBuf16<128> s06(KMixedString6); |
|
1424 TInt pos6 = s06.LocateReverseF2(0x10428); |
|
1425 test(pos6 == 2); |
1402 } |
1426 } |
1403 |
1427 |
1404 |
1428 |
1405 #ifndef _DEBUG |
1429 #ifndef _DEBUG |
1406 #pragma warning (disable: 4702)// Unreachable code |
1430 #pragma warning (disable: 4702)// Unreachable code |