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) {
|
if(output == expectStr) {
|
||||||
logln(caseString+": format: SUCCESS! "+UnicodeString("expect=output=")+output);
|
logln(caseString+": format: SUCCESS! "+UnicodeString("expect=output=")+output);
|
||||||
} else {
|
} 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 {
|
} else {
|
||||||
cal->clear();
|
cal->clear();
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#include "unicode/unistr.h"
|
#include "unicode/unistr.h"
|
||||||
#include "unicode/ustring.h"
|
#include "unicode/ustring.h"
|
||||||
|
#include "util.h"
|
||||||
#include "ucln.h"
|
#include "ucln.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -117,22 +118,19 @@ udbg_stoi(const UnicodeString &s)
|
|||||||
return atoi(ch);
|
return atoi(ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
// from incaltst.cpp
|
T_CTEST_API UnicodeString *
|
||||||
T_CTEST_API UnicodeString
|
udbg_escape(const UnicodeString &src, UnicodeString *dst)
|
||||||
udbg_escape(const UnicodeString &src)
|
|
||||||
{
|
{
|
||||||
UnicodeString dst;
|
dst->remove();
|
||||||
dst.remove();
|
|
||||||
for (int32_t i = 0; i < src.length(); ++i) {
|
for (int32_t i = 0; i < src.length(); ++i) {
|
||||||
UChar c = src[i];
|
UChar c = src[i];
|
||||||
if(c < 0x0080)
|
if(ICU_Utility::isUnprintable(c)) {
|
||||||
dst += c;
|
*dst += UnicodeString("[");
|
||||||
|
ICU_Utility::escapeUnprintable(*dst, c);
|
||||||
|
*dst += UnicodeString("]");
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
dst += UnicodeString("[");
|
*dst += c;
|
||||||
char buf [8];
|
|
||||||
sprintf(buf, "%#x", c);
|
|
||||||
dst += UnicodeString(buf);
|
|
||||||
dst += UnicodeString("]");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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 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
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user