Mercurial > lcfOS
annotate test/testbitfun.py @ 388:e07c2a9abac1
Enabled paging in kernel
author | Windel Bouwman |
---|---|
date | Fri, 02 May 2014 14:51:46 +0200 |
parents | 3bb7dcfe5529 |
children |
rev | line source |
---|---|
346 | 1 |
2 | |
3 import unittest | |
4 import sys | |
5 from ppci.bitfun import rotate_left, rotate_right | |
6 | |
7 | |
8 class BitRotationTestCase(unittest.TestCase): | |
9 def testRightRotation(self): | |
10 self.assertEqual(0xFF000000, rotate_right(0xFF, 8)) | |
11 self.assertEqual(0x0FF00000, rotate_right(0xFF, 12)) | |
12 | |
13 def testLeftRotation(self): | |
14 self.assertEqual(0x0000FF00, rotate_left(0xFF, 8)) | |
15 self.assertEqual(0x001FE000, rotate_left(0xFF, 13)) | |
16 | |
17 | |
18 if __name__ == '__main__': | |
19 unittest.main() | |
20 sys.exit() |