Ejemplo n.º 1
0
        public void TestNullFastwalkStack()
        {
            var expected = new NullFastwalkStack().Compile();

            using var ns = PacketTestUtilities.CreateTestNetState();
            ns.SendInitialFastwalkStack(new uint[] { 0, 0, 0, 0, 0, 0 });

            var result = ns.SendPipe.Reader.TryRead();

            AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
        }
Ejemplo n.º 2
0
        public void TestNullFastwalkStack()
        {
            var data = new NullFastwalkStack().Compile();

            Span <byte> expectedData = stackalloc byte[29];
            var         pos          = 0;

            expectedData.Write(ref pos, (byte)0xBF); // Packet ID
            expectedData.Write(ref pos, (ushort)29); // Length
            expectedData.Write(ref pos, (short)0x1); // Sub-packet

#if NO_LOCAL_INIT
            expectedData.Write(ref pos, 0); // Key 1
            expectedData.Write(ref pos, 0); // Key 2
            expectedData.Write(ref pos, 0); // Key 3
            expectedData.Write(ref pos, 0); // Key 4
            expectedData.Write(ref pos, 0); // Key 5
            expectedData.Write(ref pos, 0); // Key 6
#endif

            AssertThat.Equal(data, expectedData);
        }