Esempio n. 1
0
        public void TestBitRotateRightAndLeftOnUInt32()
        {
            UInt32 val = 1497;

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

            Assert.AreEqual(val, resL);

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

            val  = 300666;
            resL = val.L(11);
            resR = resL.R(11);
            Assert.AreEqual(val, resR);
        }
Esempio n. 2
0
        public void TestBitRotateRightAndLeftZeroUInt32()
        {
            UInt32 val = 197;

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

            Assert.AreEqual(val, resR);

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

            Assert.AreEqual(val, resL);
        }
Esempio n. 3
0
        public void TestBitRotateRightAndLeftWithExactUInt32Size()
        {
            UInt32 val = 197;

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

            Assert.AreEqual(val, resR);

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

            Assert.AreEqual(val, resL);
        }