comparison test/testbitfun.py @ 346:3bb7dcfe5529

expanded arm target
author Windel Bouwman
date Fri, 07 Mar 2014 17:05:32 +0100
parents
children
comparison
equal deleted inserted replaced
345:b4882ff0ed06 346:3bb7dcfe5529
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()