Esempio n. 1
0
 public void Test_RotateRight_Int64()
 {
     assertEquals(0xFL, BitOperation.RotateRight(0xF0L, 4));
     assertEquals(0xFL, BitOperation.RotateRight(0xF00L, 8));
     assertEquals(0xFL, BitOperation.RotateRight(0xF000L, 12));
     assertEquals(0xFL, BitOperation.RotateRight(0xF0000L, 16));
     assertEquals(0xFL, BitOperation.RotateRight(0xF00000L, 20));
     assertEquals(0xFL, BitOperation.RotateRight(0xF000000L, 24));
     assertEquals(0xFL, BitOperation.RotateRight(0xF0000000L, 28));
     unchecked
     {
         assertEquals((long)0xF000000000000000L, BitOperation.RotateRight((long)0xF000000000000000L, 64));
         assertEquals((long)0xF000000000000000L, BitOperation.RotateRight((long)0xF000000000000000L, 0));
     }
 }
Esempio n. 2
0
 public void Test_RotateRight_Int32()
 {
     assertEquals(0xF, BitOperation.RotateRight(0xF0, 4));
     assertEquals(0xF, BitOperation.RotateRight(0xF00, 8));
     assertEquals(0xF, BitOperation.RotateRight(0xF000, 12));
     assertEquals(0xF, BitOperation.RotateRight(0xF0000, 16));
     assertEquals(0xF, BitOperation.RotateRight(0xF00000, 20));
     assertEquals(0xF, BitOperation.RotateRight(0xF000000, 24));
     unchecked
     {
         assertEquals(0xF, BitOperation.RotateRight((int)0xF0000000, 28));
         assertEquals((int)0xF0000000, BitOperation.RotateRight((int)0xF0000000, 32));
         assertEquals((int)0xF0000000, BitOperation.RotateRight((int)0xF0000000, 0));
     }
 }