/// <summary> /// Reads a value from the packet /// </summary> /// <returns>value</returns> public sbyte ReadSByte() { sbyte res = ByteManipulator.ReadSByte(Data, CurrentSeek); CurrentSeek += sizeof(sbyte); return(res); }
public void TestListSByteReadRedLight() { List <byte> arr = new List <byte>(sizeof(sbyte)); for (int i = 0; i < sizeof(sbyte); i++) { arr.Add(0); } ByteManipulator.Write(arr, 0, (sbyte)-25); Assert.That(ByteManipulator.ReadSByte(arr, 0), Is.Not.EqualTo(9)); }
public void TestSendToAllOthersCorrectPayloadData5RedLight() { BytePacket p = new BytePacket(10); p.Write(750); p.Write((ushort)110); p.Write((sbyte)-5); p.Write(false); p.Write((short)short.MinValue); p.CurrentSeek = 0; transport.SendToAll(p, new VoicePacketInfo(), new List <ulong>() { 1 }); Assert.That(ByteManipulator.ReadSByte(workflow.receivedData, 10), Is.Not.EqualTo(0)); }
public void TestSByteReadRedLight() { byte[] arr = new byte[sizeof(sbyte)]; ByteManipulator.Write(arr, 0, (sbyte)25); Assert.That(ByteManipulator.ReadSByte(arr, 0), Is.Not.EqualTo(9)); }
public void TestSByteRead() { byte[] arr = new byte[sizeof(sbyte)]; ByteManipulator.Write(arr, 0, (sbyte)-111); Assert.That(ByteManipulator.ReadSByte(arr, 0), Is.EqualTo(-111)); }