Mercurial > lcfOS
view test/testbitfun.py @ 396:fb3c1f029b30
Added baselexer into c3 lexer
author | Windel Bouwman |
---|---|
date | Tue, 27 May 2014 22:19:32 +0200 |
parents | 3bb7dcfe5529 |
children |
line wrap: on
line source
import unittest import sys from ppci.bitfun import rotate_left, rotate_right class BitRotationTestCase(unittest.TestCase): def testRightRotation(self): self.assertEqual(0xFF000000, rotate_right(0xFF, 8)) self.assertEqual(0x0FF00000, rotate_right(0xFF, 12)) def testLeftRotation(self): self.assertEqual(0x0000FF00, rotate_left(0xFF, 8)) self.assertEqual(0x001FE000, rotate_left(0xFF, 13)) if __name__ == '__main__': unittest.main() sys.exit()