Mercurial > lcfOS
annotate test/testbitfun.py @ 365:98ff43cfdd36
Nasty bug in adr instruction
author | Windel Bouwman |
---|---|
date | Wed, 19 Mar 2014 22:32:04 +0100 |
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() |