public static IEnumerable <object[]> GetNumberData() { FailRead(EtfTokenType.SmallBig, new byte[] { 0x01, 0x01, 0x01 }); // Min - 1 FailRead(EtfTokenType.LargeBig, new byte[] { 0x00, 0x00, 0x00, 0x01, 0x01, 0x01 }); // Min - 1 foreach (var x in UnsignedIntHelpers.Reads <ulong>(0, 0)) { yield return(x); } foreach (var x in UnsignedIntHelpers.Reads <ulong>(18446744073709551615, 18446744073709551615)) { yield return(x); // Max } FailRead(EtfTokenType.LargeBig, new byte[] { 0x00, 0x00, 0x00, 0x09, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }); // Max + 1 yield return(Write(EtfTokenType.SmallInteger, new byte[] { 0x00 }, 0)); yield return(Write(EtfTokenType.SmallBig, new byte[] { 0x08, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, 18446744073709551615)); }
public static IEnumerable <object[]> GetNumberData() { FailRead(EtfTokenType.SmallBig, new byte[] { 0x01, 0x01, 0x01 }); // Min - 1 FailRead(EtfTokenType.LargeBig, new byte[] { 0x00, 0x00, 0x00, 0x01, 0x01, 0x01 }); // Min - 1 foreach (var x in UnsignedIntHelpers.Reads <ushort>(0, 0)) { yield return(x); } foreach (var x in UnsignedIntHelpers.Reads <ushort>(65535, 65535)) { yield return(x); // Max } foreach (var x in UnsignedIntHelpers.FailReads <ushort>(65536)) { ; // Max + 1 } yield return(Write(EtfTokenType.SmallInteger, new byte[] { 0x00 }, 0)); yield return(Write(EtfTokenType.Integer, new byte[] { 0x00, 0x00, 0xFF, 0xFF }, 65535)); }
public static IEnumerable <object[]> GetNumberData() { FailRead(EtfTokenType.SmallBig, new byte[] { 0x01, 0x01, 0x01 }); // Min - 1 FailRead(EtfTokenType.LargeBig, new byte[] { 0x00, 0x00, 0x00, 0x01, 0x01, 0x01 }); // Min - 1 foreach (var x in UnsignedIntHelpers.Reads <uint>(0, 0)) { yield return(x); } foreach (var x in UnsignedIntHelpers.Reads <uint>(4294967295, 4294967295)) { yield return(x); // Max } foreach (var x in UnsignedIntHelpers.FailReads <uint>(4294967296)) { ; // Max + 1 } yield return(Write(EtfTokenType.SmallInteger, new byte[] { 0x00 }, 0)); yield return(Write(EtfTokenType.Integer, new byte[] { 0x7F, 0xFF, 0xFF, 0xFF }, 2147483647)); yield return(Write(EtfTokenType.SmallBig, new byte[] { 0x04, 0x00, 0xFF, 0xFF, 0xFF, 0xFF }, 4294967295)); }