Skip to content

Commit

Permalink
Fix BufferedStream outerloop test (dotnet#56618)
Browse files Browse the repository at this point in the history
  • Loading branch information
MihaZupan authored Jul 30, 2021
1 parent acb6b9b commit 8190713
Showing 1 changed file with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,13 @@ public void BufferSize()

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.Is64BitProcess))]
[OuterLoop]
[InlineData(int.MaxValue / 2 + 1)]
public void WriteFromByte_InputSizeLargerThanHalfOfMaxInt_ShouldSuccess(int inputSize)
public void WriteFromByte_InputSizeLargerThanHalfOfMaxInt_ShouldSuccess()
{
const int InputSize = int.MaxValue / 2 + 1;
byte[] bytes;

try
{
bytes = new byte[inputSize];
bytes = new byte[InputSize];
}
catch (OutOfMemoryException)
{
Expand All @@ -72,21 +71,20 @@ public void WriteFromByte_InputSizeLargerThanHalfOfMaxInt_ShouldSuccess(int inpu
var writableStream = new WriteOnlyStream();
using (var bs = new BufferedStream(writableStream))
{
bs.Write(bytes, 0, inputSize);
Assert.Equal(inputSize, writableStream.Position);
bs.Write(bytes, 0, InputSize);
Assert.Equal(InputSize, writableStream.Position);
}
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.Is64BitProcess))]
[OuterLoop]
[InlineData(int.MaxValue / 2 + 1)]
public void WriteFromSpan_InputSizeLargerThanHalfOfMaxInt_ShouldSuccess(int inputSize)
public void WriteFromSpan_InputSizeLargerThanHalfOfMaxInt_ShouldSuccess()
{
const int InputSize = int.MaxValue / 2 + 1;
byte[] bytes;

try
{
bytes = new byte[inputSize];
bytes = new byte[InputSize];
}
catch (OutOfMemoryException)
{
Expand All @@ -97,7 +95,7 @@ public void WriteFromSpan_InputSizeLargerThanHalfOfMaxInt_ShouldSuccess(int inpu
using (var bs = new BufferedStream(writableStream))
{
bs.Write(new ReadOnlySpan<byte>(bytes));
Assert.Equal(inputSize, writableStream.Position);
Assert.Equal(InputSize, writableStream.Position);
}
}

Expand Down

0 comments on commit 8190713

Please sign in to comment.