|
|
@ -17,8 +17,9 @@ namespace Jellyfin.Server.Implementations.Tests.LiveTv
|
|
|
|
Span<byte> buffer = stackalloc byte[128];
|
|
|
|
Span<byte> buffer = stackalloc byte[128];
|
|
|
|
int len = HdHomerunManager.WriteNullTerminatedString(buffer, string.Empty);
|
|
|
|
int len = HdHomerunManager.WriteNullTerminatedString(buffer, string.Empty);
|
|
|
|
|
|
|
|
|
|
|
|
Assert.Equal(expected.Length, len);
|
|
|
|
Assert.Equal(
|
|
|
|
Assert.True(expected.SequenceEqual(buffer.Slice(0, len)));
|
|
|
|
Convert.ToHexString(expected),
|
|
|
|
|
|
|
|
Convert.ToHexString(buffer.Slice(0, len)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
@ -32,8 +33,9 @@ namespace Jellyfin.Server.Implementations.Tests.LiveTv
|
|
|
|
Span<byte> buffer = stackalloc byte[128];
|
|
|
|
Span<byte> buffer = stackalloc byte[128];
|
|
|
|
int len = HdHomerunManager.WriteNullTerminatedString(buffer, "The quick");
|
|
|
|
int len = HdHomerunManager.WriteNullTerminatedString(buffer, "The quick");
|
|
|
|
|
|
|
|
|
|
|
|
Assert.Equal(expected.Length, len);
|
|
|
|
Assert.Equal(
|
|
|
|
Assert.True(expected.SequenceEqual(buffer.Slice(0, len)));
|
|
|
|
Convert.ToHexString(expected),
|
|
|
|
|
|
|
|
Convert.ToHexString(buffer.Slice(0, len)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
@ -51,8 +53,31 @@ namespace Jellyfin.Server.Implementations.Tests.LiveTv
|
|
|
|
Span<byte> buffer = stackalloc byte[128];
|
|
|
|
Span<byte> buffer = stackalloc byte[128];
|
|
|
|
int len = HdHomerunManager.WriteGetMessage(buffer, 0, "N");
|
|
|
|
int len = HdHomerunManager.WriteGetMessage(buffer, 0, "N");
|
|
|
|
|
|
|
|
|
|
|
|
Assert.Equal(expected.Length, len);
|
|
|
|
Assert.Equal(
|
|
|
|
Assert.True(expected.SequenceEqual(buffer.Slice(0, len)));
|
|
|
|
Convert.ToHexString(expected),
|
|
|
|
|
|
|
|
Convert.ToHexString(buffer.Slice(0, len)));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
|
|
|
public void WriteSetMessage_NoLockKey_Success()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ReadOnlySpan<byte> expected = stackalloc byte[]
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
0, 4,
|
|
|
|
|
|
|
|
0, 20,
|
|
|
|
|
|
|
|
3,
|
|
|
|
|
|
|
|
10, (byte)'/', (byte)'t', (byte)'u', (byte)'n', (byte)'e', (byte)'r', (byte)'0', (byte)'/', (byte)'N', 0,
|
|
|
|
|
|
|
|
4,
|
|
|
|
|
|
|
|
6, (byte)'v', (byte)'a', (byte)'l', (byte)'u', (byte)'e', 0,
|
|
|
|
|
|
|
|
0xa9, 0x49, 0xd0, 0x68
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Span<byte> buffer = stackalloc byte[128];
|
|
|
|
|
|
|
|
int len = HdHomerunManager.WriteSetMessage(buffer, 0, "N", "value", null);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.Equal(
|
|
|
|
|
|
|
|
Convert.ToHexString(expected),
|
|
|
|
|
|
|
|
Convert.ToHexString(buffer.Slice(0, len)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|