ICU-3499 Improve the error information

X-SVN-Rev: 15086
This commit is contained in:
George Rhoten 2004-04-28 17:53:23 +00:00
parent 22328b1eb2
commit 487f050eaf

View File

@ -195,6 +195,8 @@ static void DataDrivenPrintf(void) {
DataDrivenLogger logger; DataDrivenLogger logger;
UChar uBuffer[2048]; UChar uBuffer[2048];
char cBuffer[2048]; char cBuffer[2048];
char cFormat[sizeof(cBuffer)];
char cExpected[sizeof(cBuffer)];
UnicodeString tempStr; UnicodeString tempStr;
UChar format[2048]; UChar format[2048];
//char locale[ULOC_FULLNAME_CAPACITY]; //char locale[ULOC_FULLNAME_CAPACITY];
@ -263,9 +265,11 @@ static void DataDrivenPrintf(void) {
} }
if (u_strcmp(uBuffer, expectedResult) != 0) { if (u_strcmp(uBuffer, expectedResult) != 0) {
u_austrncpy(cBuffer, uBuffer, sizeof(cBuffer)); u_austrncpy(cBuffer, uBuffer, sizeof(cBuffer));
u_austrncpy(cFormat, format, sizeof(cFormat));
u_austrncpy(cExpected, expectedResult, sizeof(cExpected));
cBuffer[sizeof(cBuffer)-1] = 0; cBuffer[sizeof(cBuffer)-1] = 0;
log_err("FAILURE test case %d - Got: %s\n", log_err("FAILURE test case %d \"%s\" - Got: \"%s\" Expected: \"%s\"\n",
i, cBuffer); i, cFormat, cBuffer, cExpected);
} }
if (uBuffer[uBufferLenReturned-1] == 0 if (uBuffer[uBufferLenReturned-1] == 0
|| uBuffer[uBufferLenReturned] != 0 || uBuffer[uBufferLenReturned] != 0