ICU-3383 add utility to 'autoquote' unquoted apostrophes in message format

X-SVN-Rev: 17775
This commit is contained in:
Doug Felt 2005-06-02 17:50:50 +00:00
parent 132ad760ae
commit aed5521f8f

View File

@ -1233,9 +1233,15 @@ void TestMessageFormat::testAutoQuoteApostrophe(void) {
UnicodeString result = MessageFormat::autoQuoteApostrophe(patterns[i], status); UnicodeString result = MessageFormat::autoQuoteApostrophe(patterns[i], status);
UnicodeString target(patterns[i+1]); UnicodeString target(patterns[i+1]);
if (target != result) { if (target != result) {
char buf[128]; const int BUF2_LEN = 64;
sprintf(buf, "[%2d] \"%s\" : \"%s\" != \"%s\"\n", i/2, patterns[i], patterns[i+1], result); char buf[256];
errln(buf); char buf2[BUF2_LEN];
int32_t len = result.extract(0, result.length(), buf2, BUF2_LEN);
if (len >= BUF2_LEN) {
buf2[BUF2_LEN-1] = 0;
}
sprintf(buf, "[%2d] test \"%s\": target (\"%s\") != result (\"%s\")\n", i/2, patterns[i], patterns[i+1], buf2);
errln(buf);
} }
} }
} }