Skip to content

Commit

Permalink
Port shared tests folder (#1467)
Browse files Browse the repository at this point in the history
These tests were presumably once shared with the old integration tests repo
but have since been sat doing nothing. This brings them into the unit tests
project.

Co-authored-by: Wojciech Nagórski <wojtpl2@gmail.com>
  • Loading branch information
Rob-Hague and WojciechNagorski authored Aug 12, 2024
1 parent a067e28 commit 1af0169
Show file tree
Hide file tree
Showing 19 changed files with 502 additions and 1,613 deletions.
4 changes: 2 additions & 2 deletions src/Renci.SshNet/Abstractions/SocketAbstraction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public static int Read(Socket socket, byte[] buffer, int offset, int size, TimeS
{
if (IsErrorResumable(ex.SocketErrorCode))
{
ThreadAbstraction.Sleep(30);
Thread.Sleep(30);
continue;
}

Expand Down Expand Up @@ -346,7 +346,7 @@ public static void Send(Socket socket, byte[] data, int offset, int size)
if (IsErrorResumable(ex.SocketErrorCode))
{
// socket buffer is probably full, wait and try again
ThreadAbstraction.Sleep(30);
Thread.Sleep(30);
}
else
{
Expand Down
9 changes: 0 additions & 9 deletions src/Renci.SshNet/Abstractions/ThreadAbstraction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ namespace Renci.SshNet.Abstractions
{
internal static class ThreadAbstraction
{
/// <summary>
/// Suspends the current thread for the specified number of milliseconds.
/// </summary>
/// <param name="millisecondsTimeout">The number of milliseconds for which the thread is suspended.</param>
public static void Sleep(int millisecondsTimeout)
{
Thread.Sleep(millisecondsTimeout);
}

/// <summary>
/// Creates and starts a long-running <see cref="Task"/> for the specified <see cref="Action"/>.
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions src/Renci.SshNet/SshMessageFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal sealed class SshMessageFactory
private readonly bool[] _activatedMessagesById;
private readonly object _lock = new object();

private static readonly MessageMetadata[] AllMessages = new MessageMetadata[]
internal static readonly MessageMetadata[] AllMessages = new MessageMetadata[]
{
new MessageMetadata<KeyExchangeInitMessage>(0, "SSH_MSG_KEXINIT", 20),
new MessageMetadata<NewKeysMessage>(1, "SSH_MSG_NEWKEYS", 21),
Expand Down Expand Up @@ -263,7 +263,7 @@ private static SshException CreateMessageTypeAlreadyEnabledForOtherMessageExcept
currentEnabledForMessageName));
}

private abstract class MessageMetadata
internal abstract class MessageMetadata
{
protected MessageMetadata(byte id, string name, byte number)
{
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 1af0169

Please sign in to comment.