Imported Upstream version 4.6.0.125

Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2016-08-03 10:59:49 +00:00
parent a569aebcfd
commit e79aa3c0ed
17047 changed files with 3137615 additions and 392334 deletions

View File

@ -1728,5 +1728,30 @@ namespace MonoTests.System.IO
}
}
#endif
[Test] // Covers #11699
public void ReadWriteFileLength ()
{
int bufferSize = 128;
int readLength = 1;
int writeLength = bufferSize + 1;
string path = TempFolder + DSC + "readwritefilelength.tmp";
try {
File.WriteAllBytes (path, new byte [readLength + 1]);
using (var file = new FileStream (path, FileMode.Open, FileAccess.ReadWrite, FileShare.Read,
bufferSize, FileOptions.SequentialScan))
{
file.Read (new byte [readLength], 0, readLength);
file.Write (new byte [writeLength], 0, writeLength);
Assert.AreEqual (readLength + writeLength, file.Length);
}
} finally {
DeleteFile (path);
}
}
}
}