ICU-4567 Fix last change so that it works on Windows.
X-SVN-Rev: 22421
This commit is contained in:
parent
065cbd88e5
commit
10b81c7930
@ -221,7 +221,8 @@ void DataDrivenFormatTest::testConvertDate(TestData *testData,
|
||||
if(output == expectStr) {
|
||||
logln(caseString+": format: SUCCESS! "+UnicodeString("expect=output=")+output);
|
||||
} else {
|
||||
errln(caseString+": format: output!=expectStr, got " + udbg_escape(output) + " expected " + udbg_escape(expectStr));
|
||||
UnicodeString result;
|
||||
errln(caseString+": format: output!=expectStr, got " + *udbg_escape(output, &result) + " expected " + *udbg_escape(expectStr, &result));
|
||||
}
|
||||
} else {
|
||||
cal->clear();
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
#include "unicode/unistr.h"
|
||||
#include "unicode/ustring.h"
|
||||
#include "util.h"
|
||||
#include "ucln.h"
|
||||
|
||||
#include <stdio.h>
|
||||
@ -117,22 +118,19 @@ udbg_stoi(const UnicodeString &s)
|
||||
return atoi(ch);
|
||||
}
|
||||
|
||||
// from incaltst.cpp
|
||||
T_CTEST_API UnicodeString
|
||||
udbg_escape(const UnicodeString &src)
|
||||
T_CTEST_API UnicodeString *
|
||||
udbg_escape(const UnicodeString &src, UnicodeString *dst)
|
||||
{
|
||||
UnicodeString dst;
|
||||
dst.remove();
|
||||
dst->remove();
|
||||
for (int32_t i = 0; i < src.length(); ++i) {
|
||||
UChar c = src[i];
|
||||
if(c < 0x0080)
|
||||
dst += c;
|
||||
if(ICU_Utility::isUnprintable(c)) {
|
||||
*dst += UnicodeString("[");
|
||||
ICU_Utility::escapeUnprintable(*dst, c);
|
||||
*dst += UnicodeString("]");
|
||||
}
|
||||
else {
|
||||
dst += UnicodeString("[");
|
||||
char buf [8];
|
||||
sprintf(buf, "%#x", c);
|
||||
dst += UnicodeString(buf);
|
||||
dst += UnicodeString("]");
|
||||
*dst += c;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ T_CTEST_API int32_t T_CTEST_EXPORT2 udbg_enumByString(UDebugEnumType type, cons
|
||||
*/
|
||||
T_CTEST_API int32_t T_CTEST_EXPORT2 udbg_stoi(const UnicodeString &s);
|
||||
|
||||
T_CTEST_API UnicodeString udbg_escape(const UnicodeString &s);
|
||||
T_CTEST_API UnicodeString *udbg_escape(const UnicodeString &s, UnicodeString *dst);
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user