ICU-2039 ferror doesn't work consistently on all platforms.

Update the tests to reflect that.

X-SVN-Rev: 11909
This commit is contained in:
George Rhoten 2003-05-13 16:09:04 +00:00
parent 22606628d5
commit 51e7d300a1
2 changed files with 16 additions and 2 deletions

View file

@ -178,6 +178,12 @@ T_FileStream_eof(FileStream* fileStream)
return feof((FILE*)fileStream);
}
/*
Warning
This function may not work consistently on all platforms
(e.g. HP-UX, FreeBSD and MacOSX don't return an error when
putc is used on a file opened as readonly)
*/
U_CAPI int U_EXPORT2
T_FileStream_error(FileStream* fileStream)
{

View file

@ -566,9 +566,17 @@ static void TestFileStream(void){
if(T_FileStream_error(stream)){
log_data_err("T_FileStream_error shouldn't have an error %s\n",fileName);
}
T_FileStream_writeLine(stream,testline);
if(!T_FileStream_error(NULL)){
log_err("T_FileStream_error didn't get an error %s\n",fileName);
}
T_FileStream_putc(stream, 0x20);
if(!T_FileStream_error(stream)){
log_data_err("T_FileStream_error didn't get an error %s\n",fileName);
/*
Warning
writing to a read-only file may not consistently fail on all platforms
(e.g. HP-UX, FreeBSD, MacOSX)
*/
log_verbose("T_FileStream_error didn't get an error when writing to a readonly file %s\n",fileName);
}
T_FileStream_close(stream);