Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ef00c0d
Fix invalid assert in StreamBuffer
stephentoub Oct 26, 2020
a590bcf
Add ConnectedStreams.CreateUnidirectional
stephentoub Oct 26, 2020
f63c227
Add initial set of Stream conformance tests
stephentoub Oct 26, 2020
59238b7
Add ConnectedStreams tests
stephentoub Oct 26, 2020
0d61950
Fix NetworkStream argument names
stephentoub Oct 26, 2020
b20d581
Add stream conformance tests for NetworkStream
stephentoub Oct 26, 2020
80e15eb
Add stream conformance tests for QuicStream
stephentoub Oct 26, 2020
a7f6964
Fix several CryptoStream behaviors
stephentoub Oct 26, 2020
78bc0ac
Add stream conformance tests for CryptoStream
stephentoub Oct 26, 2020
3586739
Fix FileStream argument names
stephentoub Oct 26, 2020
4f32db2
Fix BufferedStream argument names
stephentoub Oct 26, 2020
cad5f6a
Add stream conformance tests for FileStream
stephentoub Oct 26, 2020
ec88166
Add stream conformance tests for BufferedStream
stephentoub Oct 26, 2020
3f6a0f7
Add stream conformance tests for SslStream and NegotiateStream
stephentoub Oct 26, 2020
fb1de39
Fix PipeStream.Flush to not fail on readable streams
stephentoub Oct 26, 2020
fb55c4a
Add stream conformance tests for PipeStream
stephentoub Oct 26, 2020
c6fa2f1
Fix several BrotliStream behaviors
stephentoub Oct 26, 2020
af13fb9
Fix several DeflateStream (and friends) issues
stephentoub Oct 26, 2020
296b99a
Add stream conformance tests for Deflate/ZLib/GZip/BrotliStream
stephentoub Oct 26, 2020
230c853
Fix PipeReader/WriterStream argument validation
stephentoub Oct 26, 2020
5e5afba
Add stream conformance tests for PipeReader/WriterStream
stephentoub Oct 26, 2020
6dc26b6
Remove erroneous asserts from Stream.ReadWriteTask
stephentoub Oct 26, 2020
c46cdd1
Address PR feedback
stephentoub Oct 27, 2020
ac6aff5
Fix a few tests in CI
stephentoub Oct 28, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/libraries/Common/src/System/Net/StreamBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ public void Reset()
{
if (_hasWaiter != 0)
{
Debug.Fail("Concurrent use is not supported");
throw new InvalidOperationException("Concurrent use is not supported");
}

Expand Down
6 changes: 6 additions & 0 deletions src/libraries/Common/tests/Common.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@
Link="Common\System\Threading\Tasks\TaskToApm.cs" />
<Compile Include="$(CoreLibSharedDir)System\IO\PathInternal.cs"
Link="System\IO\PathInternal.cs" />
<Compile Include="System\IO\ConnectedStreams.cs" Link="System\IO\ConnectedStreams.cs" />
<Compile Include="Tests\System\IO\ConnectedStreamsTests.cs" />
<Compile Include="Tests\System\IO\StreamConformanceTests.cs" />
<Compile Include="$(CommonPath)System\Net\ArrayBuffer.cs" Link="Common\System\Net\ArrayBuffer.cs" />
<Compile Include="$(CommonPath)System\Net\StreamBuffer.cs" Link="Common\System\Net\StreamBuffer.cs" />
<Compile Include="$(CommonTestPath)System\IO\CallTrackingStream.cs" Link="Common\System\IO\CallTrackingStream.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsWindows)'=='true'">
<Compile Include="$(CoreLibSharedDir)System\IO\PathInternal.Windows.cs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System.Collections.Generic;
using System.IO.Tests;
using System.Threading.Tasks;

namespace System.IO.Compression
{
public abstract class CompressionTestBase
public abstract class CompressionTestBase : WrappingConnectedStreamConformanceTests
{
public static IEnumerable<object[]> UncompressedTestFiles()
{
Expand Down Expand Up @@ -36,8 +38,22 @@ public abstract class CompressionStreamTestBase : CompressionTestBase
public abstract Stream CreateStream(Stream stream, CompressionLevel level);
public abstract Stream CreateStream(Stream stream, CompressionLevel level, bool leaveOpen);
public abstract Stream BaseStream(Stream stream);
public virtual bool FlushCompletes { get => true; }
public virtual bool FlushNoOps { get => false; }
public virtual int BufferSize { get => 8192; }

protected override Task<StreamPair> CreateConnectedStreamsAsync()
{
(Stream stream1, Stream stream2) = ConnectedStreams.CreateBidirectional(4 * 1024, 16 * 1024);
return Task.FromResult<StreamPair>((CreateStream(stream1, CompressionMode.Compress), CreateStream(stream2, CompressionMode.Decompress)));
}

protected override Task<StreamPair> CreateWrappedConnectedStreamsAsync(StreamPair wrapped, bool leaveOpen) =>
Task.FromResult<StreamPair>((CreateStream(wrapped.Stream1, CompressionMode.Compress, leaveOpen), CreateStream(wrapped.Stream2, CompressionMode.Decompress, leaveOpen)));

protected override int BufferedSize => 16 * 1024 + BufferSize;
protected override bool UsableAfterCanceledReads => false;
protected override Type UnsupportedReadWriteExceptionType => typeof(InvalidOperationException);
protected override bool WrappedUsableAfterClose => false;
protected override bool FlushRequiredToWriteData => true;
protected override bool FlushGuaranteesAllDataWritten => false;
}
}

Large diffs are not rendered by default.

Loading