mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-18 11:14:22 +00:00
ICU-3499 Add some debugging information.
X-SVN-Rev: 15283
This commit is contained in:
parent
7836b888fd
commit
c933db269f
3 changed files with 13 additions and 11 deletions
|
@ -20,7 +20,7 @@ CLEANFILES = *~ $(DEPS)
|
|||
TARGET = iotest$(EXEEXT)
|
||||
|
||||
CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n \
|
||||
-I$(top_srcdir)/tools/ctestfw -I$(top_srcdir)/extra/ustdio
|
||||
-I$(top_srcdir)/tools/ctestfw -I$(top_srcdir)/io
|
||||
LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUIO) $(DEFAULT_LIBS) $(LIB_M)
|
||||
|
||||
OBJECTS = iotest.o strtst.o filetst.o
|
||||
|
|
|
@ -405,8 +405,8 @@ static void DataDrivenScanf(void) {
|
|||
uBufferLenReturned = u_sscanf_u(argument, format, &dbl);
|
||||
//uFileBufferLenReturned = u_fscanf_u(testFile, format, dbl);
|
||||
if (dbl != expectedDbl) {
|
||||
log_err("error in scanf test case Got: %f Exp: %f\n",
|
||||
dbl, expectedDbl);
|
||||
log_err("error in scanf test case[%d] Got: %f Exp: %f\n",
|
||||
i, dbl, expectedDbl);
|
||||
}
|
||||
break;
|
||||
case 0x31: // '1' int8_t
|
||||
|
@ -414,8 +414,8 @@ static void DataDrivenScanf(void) {
|
|||
uBufferLenReturned = u_sscanf_u(argument, format, &i8);
|
||||
//uFileBufferLenReturned = u_fscanf_u(testFile, format, i8);
|
||||
if (i8 != expected8) {
|
||||
log_err("error in scanf test case Got: %02X Exp: %02X\n",
|
||||
i8, expected8);
|
||||
log_err("error in scanf test case[%d] Got: %02X Exp: %02X\n",
|
||||
i, i8, expected8);
|
||||
}
|
||||
break;
|
||||
case 0x32: // '2' int16_t
|
||||
|
@ -423,8 +423,8 @@ static void DataDrivenScanf(void) {
|
|||
uBufferLenReturned = u_sscanf_u(argument, format, &i16);
|
||||
//uFileBufferLenReturned = u_fscanf_u(testFile, format, i16);
|
||||
if (i16 != expected16) {
|
||||
log_err("error in scanf test case Got: %04X Exp: %04X\n",
|
||||
i16, expected16);
|
||||
log_err("error in scanf test case[%d] Got: %04X Exp: %04X\n",
|
||||
i, i16, expected16);
|
||||
}
|
||||
break;
|
||||
case 0x34: // '4' int32_t
|
||||
|
@ -432,8 +432,8 @@ static void DataDrivenScanf(void) {
|
|||
uBufferLenReturned = u_sscanf_u(argument, format, &i32);
|
||||
//uFileBufferLenReturned = u_fscanf_u(testFile, format, i32);
|
||||
if (i32 != expected32) {
|
||||
log_err("error in scanf test case Got: %08X Exp: %08X\n",
|
||||
i32, expected32);
|
||||
log_err("error in scanf test case[%d] Got: %08X Exp: %08X\n",
|
||||
i, i32, expected32);
|
||||
}
|
||||
break;
|
||||
case 0x38: // '8' int64_t
|
||||
|
|
|
@ -248,6 +248,7 @@ static void TestString(void) {
|
|||
static void TestLocalizedString(void) {
|
||||
UChar testStr[256];
|
||||
UChar uBuffer[256];
|
||||
char cBuffer[256];
|
||||
int32_t numResult = -1;
|
||||
UFILE *strFile = u_fstropen(testStr, sizeof(testStr)/sizeof(testStr[0]), "en_US");
|
||||
|
||||
|
@ -260,11 +261,12 @@ static void TestLocalizedString(void) {
|
|||
u_fscanf(strFile, "%d", &numResult);
|
||||
u_fclose(strFile);
|
||||
u_uastrcpy(uBuffer,"1,234");
|
||||
u_austrcpy(cBuffer,testStr);
|
||||
if (u_strcmp(testStr, uBuffer) != 0) {
|
||||
log_err("u_fprintf failed to work on a string\n");
|
||||
log_err("u_fprintf failed to work on a string Got: %s\n", cBuffer);
|
||||
}
|
||||
if (numResult != 1234) {
|
||||
log_err("u_fscanf failed to work on a string\n");
|
||||
log_err("u_fscanf failed to work on a string Got: %d\n", numResult);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue