OLD | NEW |
1 /******************************************************************** | 1 /******************************************************************** |
2 * COPYRIGHT: | 2 * COPYRIGHT: |
3 * Copyright (c) 1997-2012, International Business Machines Corporation and | 3 * Copyright (c) 1997-2015, International Business Machines Corporation and |
4 * others. All Rights Reserved. | 4 * others. All Rights Reserved. |
5 ********************************************************************/ | 5 ********************************************************************/ |
6 /* file name: strtest.cpp | 6 /* file name: strtest.cpp |
7 * encoding: US-ASCII | 7 * encoding: US-ASCII |
8 * tab size: 8 (not used) | 8 * tab size: 8 (not used) |
9 * indentation:4 | 9 * indentation:4 |
10 * | 10 * |
11 * created on: 1999nov22 | 11 * created on: 1999nov22 |
12 * created by: Markus W. Scherer | 12 * created by: Markus W. Scherer |
13 */ | 13 */ |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 if (errorCode.isFailure()) { | 514 if (errorCode.isFailure()) { |
515 return; | 515 return; |
516 } | 516 } |
517 memcpy(buffer, "*****", 5); | 517 memcpy(buffer, "*****", 5); |
518 chStr.append(buffer, 5, errorCode); | 518 chStr.append(buffer, 5, errorCode); |
519 chStr.truncate(chStr.length()-3); | 519 chStr.truncate(chStr.length()-3); |
520 strcat(expected, "**"); | 520 strcat(expected, "**"); |
521 if (0 != strcmp(expected, chStr.data()) || (int32_t)strlen(expected) != chSt
r.length()) { | 521 if (0 != strcmp(expected, chStr.data()) || (int32_t)strlen(expected) != chSt
r.length()) { |
522 errln("CharString.getAppendBuffer().append(**) failed."); | 522 errln("CharString.getAppendBuffer().append(**) failed."); |
523 } | 523 } |
| 524 |
| 525 UErrorCode ec = U_ZERO_ERROR; |
| 526 chStr.clear(); |
| 527 chStr.appendInvariantChars(UnicodeString("The '@' character is not invariant
."), ec); |
| 528 if (ec != U_INVARIANT_CONVERSION_ERROR) { |
| 529 errln("%s:%d expected U_INVARIANT_CONVERSION_ERROR, got %s", __FILE__, _
_LINE__, u_errorName(ec)); |
| 530 } |
| 531 if (chStr.length() != 0) { |
| 532 errln("%s:%d expected length() = 0, got %d", __FILE__, __LINE__, chStr.l
ength()); |
| 533 } |
524 } | 534 } |
OLD | NEW |