Exemplo n.º 1
0
        public void TestBitRotateRightAndLeftOnUInt16()
        {
            UInt16 val = 1497;

            UInt16 resR = val.R(7);  // rotate right
            UInt16 resL = resR.L(7); // rotate left

            Assert.AreEqual(val, resL);

            resR = val.R(129);
            resL = resR.L(129);
            Assert.AreEqual(val, resL);

            val  = 30066;
            resL = val.L(11);
            resR = resL.R(11);
            Assert.AreEqual(val, resR);
        }
Exemplo n.º 2
0
        public void TestBitRotateRightAndLeftZeroUInt16()
        {
            UInt16 val = 197;

            UInt16 resR = val.R(0); // rotate right by 0, on a byte should not modify the content:

            Assert.AreEqual(val, resR);

            UInt16 resL = resR.L(0); // rotate left by 0, on a byte should not modify the content:

            Assert.AreEqual(val, resL);
        }
Exemplo n.º 3
0
        public void TestBitRotateRightAndLeftWithExactUInt16Size()
        {
            UInt16 val = 197;

            UInt16 resR = val.R(16); // rotate right by 16, on a byte should not modify the content:

            Assert.AreEqual(val, resR);

            UInt16 resL = resR.L(16); // rotate left by 16, on a byte should not modify the content:

            Assert.AreEqual(val, resL);
        }