Index: source/test/intltest/strtest.cpp |
diff --git a/source/test/intltest/strtest.cpp b/source/test/intltest/strtest.cpp |
index 2081454d5fead6ffbeaea7aa021acea079485c31..5075fa5fc8e1a9b2eee103822d58cc64c7b2c839 100644 |
--- a/source/test/intltest/strtest.cpp |
+++ b/source/test/intltest/strtest.cpp |
@@ -1,6 +1,6 @@ |
/******************************************************************** |
* COPYRIGHT: |
- * Copyright (c) 1997-2012, International Business Machines Corporation and |
+ * Copyright (c) 1997-2015, International Business Machines Corporation and |
* others. All Rights Reserved. |
********************************************************************/ |
/* file name: strtest.cpp |
@@ -521,4 +521,14 @@ StringTest::TestCharString() { |
if (0 != strcmp(expected, chStr.data()) || (int32_t)strlen(expected) != chStr.length()) { |
errln("CharString.getAppendBuffer().append(**) failed."); |
} |
+ |
+ UErrorCode ec = U_ZERO_ERROR; |
+ chStr.clear(); |
+ chStr.appendInvariantChars(UnicodeString("The '@' character is not invariant."), ec); |
+ if (ec != U_INVARIANT_CONVERSION_ERROR) { |
+ errln("%s:%d expected U_INVARIANT_CONVERSION_ERROR, got %s", __FILE__, __LINE__, u_errorName(ec)); |
+ } |
+ if (chStr.length() != 0) { |
+ errln("%s:%d expected length() = 0, got %d", __FILE__, __LINE__, chStr.length()); |
+ } |
} |