From c3d43b67ec2dbeb6b0794c47828ca6a5281ca12a Mon Sep 17 00:00:00 2001 From: Gert Driesen Date: Sun, 17 Sep 2017 17:34:37 +0200 Subject: [PATCH] Pass buffer size to ShellStream ctor. Fixes issue #303. Added tests for issue #303 and PR #211. --- .../Renci.SshNet.Tests.NET35.csproj | 38 ++++- .../ServiceFactoryTest_CreateShellStream.cs | 134 ++++++++++++++++ .../Classes/ShellStreamTest.cs | 12 +- ...ferEmptyAndWriteLessBytesThanBufferSize.cs | 135 ++++++++++++++++ ...ferEmptyAndWriteMoreBytesThanBufferSize.cs | 142 ++++++++++++++++ ...yAndWriteNumberOfBytesEqualToBufferSize.cs | 129 +++++++++++++++ ...Write_WriteBufferEmptyAndWriteZeroBytes.cs | 126 +++++++++++++++ ...fferFullAndWriteLessBytesThanBufferSize.cs | 135 ++++++++++++++++ ..._Write_WriteBufferFullAndWriteZeroBytes.cs | 133 +++++++++++++++ ...tyAndWriteLessBytesThanBufferCanContain.cs | 141 ++++++++++++++++ ...tyAndWriteMoreBytesThanBufferCanContain.cs | 149 +++++++++++++++++ ...te_WriteBufferNotEmptyAndWriteZeroBytes.cs | 133 +++++++++++++++ ...AndBufferSizeAndTerminalModes_Connected.cs | 151 ++++++++++++++++++ ...ndWidthAndHeightAndBufferSize_Connected.cs | 147 +++++++++++++++++ .../Renci.SshNet.Tests.csproj | 12 ++ src/Renci.SshNet/IServiceFactory.cs | 34 ++++ src/Renci.SshNet/ServiceFactory.cs | 30 ++++ src/Renci.SshNet/ShellStream.cs | 52 ++++-- src/Renci.SshNet/SshClient.cs | 8 +- 19 files changed, 1822 insertions(+), 19 deletions(-) create mode 100644 src/Renci.SshNet.Tests/Classes/ServiceFactoryTest_CreateShellStream.cs create mode 100644 src/Renci.SshNet.Tests/Classes/ShellStreamTest_Write_WriteBufferEmptyAndWriteLessBytesThanBufferSize.cs create mode 100644 src/Renci.SshNet.Tests/Classes/ShellStreamTest_Write_WriteBufferEmptyAndWriteMoreBytesThanBufferSize.cs create mode 100644 src/Renci.SshNet.Tests/Classes/ShellStreamTest_Write_WriteBufferEmptyAndWriteNumberOfBytesEqualToBufferSize.cs create mode 100644 src/Renci.SshNet.Tests/Classes/ShellStreamTest_Write_WriteBufferEmptyAndWriteZeroBytes.cs create mode 100644 src/Renci.SshNet.Tests/Classes/ShellStreamTest_Write_WriteBufferFullAndWriteLessBytesThanBufferSize.cs create mode 100644 src/Renci.SshNet.Tests/Classes/ShellStreamTest_Write_WriteBufferFullAndWriteZeroBytes.cs create mode 100644 src/Renci.SshNet.Tests/Classes/ShellStreamTest_Write_WriteBufferNotEmptyAndWriteLessBytesThanBufferCanContain.cs create mode 100644 src/Renci.SshNet.Tests/Classes/ShellStreamTest_Write_WriteBufferNotEmptyAndWriteMoreBytesThanBufferCanContain.cs create mode 100644 src/Renci.SshNet.Tests/Classes/ShellStreamTest_Write_WriteBufferNotEmptyAndWriteZeroBytes.cs create mode 100644 src/Renci.SshNet.Tests/Classes/SshClientTest_CreateShellStream_TerminalNameAndColumnsAndRowsAndWidthAndHeightAndBufferSizeAndTerminalModes_Connected.cs create mode 100644 src/Renci.SshNet.Tests/Classes/SshClientTest_CreateShellStream_TerminalNameAndColumnsAndRowsAndWidthAndHeightAndBufferSize_Connected.cs diff --git a/src/Renci.SshNet.Tests.NET35/Renci.SshNet.Tests.NET35.csproj b/src/Renci.SshNet.Tests.NET35/Renci.SshNet.Tests.NET35.csproj index 24ae3f061..7ae4ac5d1 100644 --- a/src/Renci.SshNet.Tests.NET35/Renci.SshNet.Tests.NET35.csproj +++ b/src/Renci.SshNet.Tests.NET35/Renci.SshNet.Tests.NET35.csproj @@ -912,6 +912,9 @@ Classes\ServiceFactoryTest_CreateSftpFileReader_FileSizeIsZero.cs + + Classes\ServiceFactoryTest_CreateShellStream.cs + Classes\SessionTest.cs @@ -1425,12 +1428,45 @@ Classes\ShellStreamTest.cs + + Classes\ShellStreamTest_Write_WriteBufferEmptyAndWriteLessBytesThanBufferSize.cs + + + Classes\ShellStreamTest_Write_WriteBufferEmptyAndWriteMoreBytesThanBufferSize.cs + + + Classes\ShellStreamTest_Write_WriteBufferEmptyAndWriteNumberOfBytesEqualToBufferSize.cs + + + Classes\ShellStreamTest_Write_WriteBufferEmptyAndWriteZeroBytes.cs + + + Classes\ShellStreamTest_Write_WriteBufferFullAndWriteLessBytesThanBufferSize.cs + + + Classes\ShellStreamTest_Write_WriteBufferFullAndWriteZeroBytes.cs + + + Classes\ShellStreamTest_Write_WriteBufferNotEmptyAndWriteLessBytesThanBufferCanContain.cs + + + Classes\ShellStreamTest_Write_WriteBufferNotEmptyAndWriteMoreBytesThanBufferCanContain.cs + + + Classes\ShellStreamTest_Write_WriteBufferNotEmptyAndWriteZeroBytes.cs + Classes\ShellTestTest.cs Classes\SshClientTest.cs + + Classes\SshClientTest_CreateShellStream_TerminalNameAndColumnsAndRowsAndWidthAndHeightAndBufferSizeAndTerminalModes_Connected.cs + + + Classes\SshClientTest_CreateShellStream_TerminalNameAndColumnsAndRowsAndWidthAndHeightAndBufferSize_Connected.cs + Classes\SshClientTest_Disconnect_ForwardedPortStarted.cs @@ -1632,7 +1668,7 @@ - +