EncodeZigZag32() private method

private EncodeZigZag32 ( int n ) : uint
n int
return uint
Beispiel #1
0
 public void EncodeZigZag32()
 {
     Assert.AreEqual(0u, CodedOutputStream.EncodeZigZag32(0));
     Assert.AreEqual(1u, CodedOutputStream.EncodeZigZag32(-1));
     Assert.AreEqual(2u, CodedOutputStream.EncodeZigZag32(1));
     Assert.AreEqual(3u, CodedOutputStream.EncodeZigZag32(-2));
     Assert.AreEqual(0x7FFFFFFEu, CodedOutputStream.EncodeZigZag32(0x3FFFFFFF));
     Assert.AreEqual(0x7FFFFFFFu, CodedOutputStream.EncodeZigZag32(unchecked ((int)0xC0000000)));
     Assert.AreEqual(0xFFFFFFFEu, CodedOutputStream.EncodeZigZag32(0x7FFFFFFF));
     Assert.AreEqual(0xFFFFFFFFu, CodedOutputStream.EncodeZigZag32(unchecked ((int)0x80000000)));
 }