diff options
author | Stephen Toub <stoub@microsoft.com> | 2020-10-30 12:50:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-30 12:50:49 +0300 |
commit | a112379a677ab36e0b417086ba74f7cc547118f3 (patch) | |
tree | 0a1a74162ea443e1ef030c6bca3f24cdaeabf734 /src/libraries/System.Net.Security/tests/UnitTests | |
parent | b5ea5cbe9fc2f57f4ba6fc63e822a01240c1caf7 (diff) |
Add Stream argument validation helpers and use throughout dotnet/runtime (#43968)
* Add Stream argument validation helpers and use throughout dotnet/runtime
* Delete unnecessary code in Stream
Stream.Null was using BlockingBegin/EndRead/Write, but the operations are nops (they don't even do argument validation), so the functionality was unnecessary complication. We can just use TaskToApm instead, with already completed tasks, and then also delete the SynchronousAsyncResult that was used by these operations.
Also, the Begin/EndRead/Write methods were checking CanRead/Write and throwing if they return false, but this is a private sealed type with CanRead/Write hardcoded to return true! Delete.
Finally added consistency across Stream.Null to checking for cancellation.
* Clean up some style on Stream
Also consolidate a few resources and use a few existing ThrowHelpers where appropriate.
* Fix a few issues, and remove duplicative tests missed in conformance tests rollout
* Address PR feedback
Diffstat (limited to 'src/libraries/System.Net.Security/tests/UnitTests')
-rw-r--r-- | src/libraries/System.Net.Security/tests/UnitTests/Fakes/FakeSslStream.Implementation.cs | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/src/libraries/System.Net.Security/tests/UnitTests/Fakes/FakeSslStream.Implementation.cs b/src/libraries/System.Net.Security/tests/UnitTests/Fakes/FakeSslStream.Implementation.cs index 9b74d718878..666ca16e9ef 100644 --- a/src/libraries/System.Net.Security/tests/UnitTests/Fakes/FakeSslStream.Implementation.cs +++ b/src/libraries/System.Net.Security/tests/UnitTests/Fakes/FakeSslStream.Implementation.cs @@ -35,10 +35,6 @@ namespace System.Net.Security _handshakeCompleted = false; } - private void ValidateParameters(byte[] buffer, int offset, int count) - { - } - private void ValidateCreateContext(SslAuthenticationOptions sslAuthenticationOptions) { _sslAuthenticationOptions = new FakeOptions() { TargetHost = sslAuthenticationOptions.TargetHost }; |