ICU-535 removed compiler warnings and added better error display

X-SVN-Rev: 2225
This commit is contained in:
Madhu K 2000-08-14 21:31:05 +00:00
parent 760629f11b
commit e01ba020dd
2 changed files with 14 additions and 14 deletions

View File

@ -36,7 +36,7 @@ void printSeq(const uint8_t* a, int len)
int i=0; int i=0;
log_verbose("\n{"); log_verbose("\n{");
while (i<len) while (i<len)
log_verbose("%02X, ", a[i++]); log_verbose("0x%02X, ", a[i++]);
log_verbose("}\n"); log_verbose("}\n");
} }
void printUSeq(const UChar* a, int len) void printUSeq(const UChar* a, int len)
@ -44,7 +44,7 @@ void printUSeq(const UChar* a, int len)
int i=0; int i=0;
log_verbose("{"); log_verbose("{");
while (i<len) while (i<len)
log_verbose(" %4x, ", a[i++]); log_verbose(" 0x%04x, ", a[i++]);
log_verbose("}\n"); log_verbose("}\n");
} }
@ -53,7 +53,7 @@ void printSeqErr(const uint8_t* a, int len)
int i=0; int i=0;
fprintf(stderr, "{"); fprintf(stderr, "{");
while (i<len) while (i<len)
fprintf(stderr, " %2x, ", a[i++]); fprintf(stderr, " 0x%02x, ", a[i++]);
fprintf(stderr, "}\n"); fprintf(stderr, "}\n");
} }
void printUSeqErr(const UChar* a, int len) void printUSeqErr(const UChar* a, int len)
@ -61,7 +61,7 @@ void printUSeqErr(const UChar* a, int len)
int i=0; int i=0;
fprintf(stderr, "{"); fprintf(stderr, "{");
while (i<len) while (i<len)
fprintf(stderr, "%4x, ", a[i++]); fprintf(stderr, "0x%04x, ", a[i++]);
fprintf(stderr,"}\n"); fprintf(stderr,"}\n");
} }
void setNuConvTestName(const char *codepage, const char *direction) void setNuConvTestName(const char *codepage, const char *direction)
@ -1270,7 +1270,7 @@ UBool testConvertToUnicode( const uint8_t *source, int sourcelen, const UChar *e
} }
log_verbose(junk); log_verbose(junk);
printUSeq(expect, expectlen);
if ( checkOffsets ) if ( checkOffsets )
{ {
log_verbose("\nOffsets:"); log_verbose("\nOffsets:");
@ -1295,10 +1295,10 @@ UBool testConvertToUnicode( const uint8_t *source, int sourcelen, const UChar *e
log_err(" %2d,", expectOffsets[i]); log_err(" %2d,", expectOffsets[i]);
log_err("\nGot output: "); log_err("\nGot output: ");
for(i=0; i<(targ-junkout); i++) for(i=0; i<(targ-junkout); i++)
log_err("%4x,", junkout[i]); log_err("0x%04x,", junkout[i]);
log_err("\nFrom source: "); log_err("\nFrom source: ");
for(i=0; i<(src-source); i++) for(i=0; i<(src-source); i++)
log_err(" %2x,", (unsigned char)source[i]); log_err(" 0x%02x,", (unsigned char)source[i]);
log_err("\n"); log_err("\n");
} }
} }

View File

@ -37,14 +37,14 @@ void printSeq(const unsigned char* a, int len)
{ {
int i=0; int i=0;
log_verbose("{"); log_verbose("{");
while (i<len) log_verbose("%2x ", a[i++]); while (i<len) log_verbose("0x%02x ", a[i++]);
log_verbose("}\n"); log_verbose("}\n");
} }
void printUSeq(const UChar* a, int len) void printUSeq(const UChar* a, int len)
{ {
int i=0; int i=0;
log_verbose("{U+"); log_verbose("{U+");
while (i<len) log_verbose("%04x ", a[i++]); while (i<len) log_verbose("0x%04x ", a[i++]);
log_verbose("}\n"); log_verbose("}\n");
} }
@ -52,14 +52,14 @@ void printSeqErr(const unsigned char* a, int len)
{ {
int i=0; int i=0;
fprintf(stderr, "{"); fprintf(stderr, "{");
while (i<len) fprintf(stderr, "%2x ", a[i++]); while (i<len) fprintf(stderr, "0x%02x ", a[i++]);
fprintf(stderr, "}\n"); fprintf(stderr, "}\n");
} }
void printUSeqErr(const UChar* a, int len) void printUSeqErr(const UChar* a, int len)
{ {
int i=0; int i=0;
fprintf(stderr, "{U+"); fprintf(stderr, "{U+");
while (i<len) fprintf(stderr, "%04x ", a[i++]); while (i<len) fprintf(stderr, "0x%04x ", a[i++]);
fprintf(stderr,"}\n"); fprintf(stderr,"}\n");
} }
void TestConverterFallBack(void) void TestConverterFallBack(void)
@ -382,7 +382,7 @@ UBool testConvertToUnicode( const uint8_t *source, int sourcelen, const UChar *e
} }
log_verbose(junk); log_verbose(junk);
printUSeq(expect, expectlen);
if ( checkOffsets ) if ( checkOffsets )
{ {
log_verbose("\nOffsets:"); log_verbose("\nOffsets:");
@ -407,10 +407,10 @@ UBool testConvertToUnicode( const uint8_t *source, int sourcelen, const UChar *e
log_err("%d,", expectOffsets[i]); log_err("%d,", expectOffsets[i]);
log_err(""); log_err("");
for(i=0; i<(targ-junkout); i++) for(i=0; i<(targ-junkout); i++)
log_err("%4X,", junkout[i]); log_err("0x%04X,", junkout[i]);
log_err(""); log_err("");
for(i=0; i<(src-source); i++) for(i=0; i<(src-source); i++)
log_err("%4X,", (unsigned char)source[i]); log_err("0x%04X,", (unsigned char)source[i]);
} }
} }