public void UInt32Test() { MsgPackWriter writer = new MsgPackWriter(Allocator.Temp); writer.WriteInteger(uint.MinValue); writer.WriteInteger(uint.MaxValue); writer.WriteInteger((uint)0); MsgPackReader reader = new MsgPackReader(writer.ToArray(Allocator.Temp)); Assert.That(reader.ReadUInt32(), Is.EqualTo(uint.MinValue)); Assert.That(reader.ReadUInt32(), Is.EqualTo(uint.MaxValue)); Assert.That(reader.ReadUInt32(), Is.EqualTo(0)); }
public void Int8Test() { MsgPackWriter writer = new MsgPackWriter(Allocator.Temp); writer.WriteInteger(sbyte.MinValue); writer.WriteInteger(sbyte.MaxValue); writer.WriteInteger((sbyte)0); MsgPackReader reader = new MsgPackReader(writer.ToArray(Allocator.Temp)); Assert.That(reader.ReadInt8(), Is.EqualTo(sbyte.MinValue)); Assert.That(reader.ReadInt8(), Is.EqualTo(sbyte.MaxValue)); Assert.That(reader.ReadInt8(), Is.EqualTo(0)); }