mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 22:44:49 +00:00
ICU-21793 Fix ucptrietest golden diff
This commit is contained in:
parent
83eb2ee1d8
commit
698efda42b
1 changed files with 7 additions and 6 deletions
|
@ -228,18 +228,19 @@ uprv_compareGoldenFiles(
|
|||
std::ifstream ifs(goldenFilePath, std::ifstream::in);
|
||||
int32_t pos = 0;
|
||||
char c;
|
||||
while ((c = ifs.get()) != std::char_traits<char>::eof() && pos < bufferLen) {
|
||||
while (ifs.get(c) && pos < bufferLen) {
|
||||
if (c != buffer[pos]) {
|
||||
// Files differ at this position
|
||||
return pos;
|
||||
break;
|
||||
}
|
||||
pos++;
|
||||
}
|
||||
if (pos < bufferLen || c != std::char_traits<char>::eof()) {
|
||||
// Files are different lengths
|
||||
return pos;
|
||||
if (pos == bufferLen && ifs.eof()) {
|
||||
// Files are same lengths
|
||||
pos = -1;
|
||||
}
|
||||
return -1;
|
||||
ifs.close();
|
||||
return pos;
|
||||
}
|
||||
|
||||
/*U_CAPI UDate U_EXPORT2
|
||||
|
|
Loading…
Add table
Reference in a new issue