예제 #1
0
 def test_bool_write_nonflag(self):
     r = Register(32)
     r.write(True)
     self.assertEqual(r.read(), True)
예제 #2
0
 def test_flag(self):
     r = Register(1)
     self.assertEqual(r.read(), False)
예제 #3
0
 def test_flag_trunc(self):
     r = Register(1)
     r.write(3)
     self.assertEqual(r.read(), True)
예제 #4
0
 def test_truncate(self):
     r = Register(32)
     r.write(2**32)
     self.assertEqual(r.read(), 0)
예제 #5
0
 def test_largest_write(self):
     r = Register(32)
     r.write(0xffffffff)
     self.assertEqual(r.read(), 0xffffffff)
예제 #6
0
 def test_bitvec(self):
     r = Register(32)
     b = BitVecConstant(32, 0)
     r.write(b)
     self.assertIs(r.read(), b)
예제 #7
0
 def test_truncate(self):
     r = Register(32)
     r.write(2**32)
     self.assertEqual(r.read(), 0)
예제 #8
0
 def test_bitvec_flag(self):
     r = Register(1)
     b = BitVecConstant(32, 0)
     r.write(b)
     # __nonzero__ (==) currently unimplemented for Bool
     self.assertTrue(isinstance(r.read(), Bool))
예제 #9
0
 def test_bitvec(self):
     r = Register(32)
     b = BitVecConstant(32, 0)
     r.write(b)
     self.assertIs(r.read(), b)
예제 #10
0
 def test_bool_write_nonflag(self):
     r = Register(32)
     r.write(True)
     self.assertEqual(r.read(), True)
예제 #11
0
 def test_Bool(self):
     r = Register(32)
     b = Bool()
     r.write(b)
     self.assertIs(r.read(), b)
예제 #12
0
 def test_flag_trunc(self):
     r = Register(1)
     r.write(3)
     self.assertEqual(r.read(), True)
예제 #13
0
 def test_flag(self):
     r = Register(1)
     self.assertEqual(r.read(), False)
예제 #14
0
 def test_largest_write(self):
     r = Register(32)
     r.write(0xffffffff)
     self.assertEqual(r.read(), 0xffffffff)
예제 #15
0
 def test_Bool(self):
     r = Register(32)
     b = Bool()
     r.write(b)
     self.assertIs(r.read(), b)
예제 #16
0
 def test_rd(self):
     r = Register(32)
     self.assertEqual(r.read(), 0)
예제 #17
0
 def test_bitvec_flag(self):
     r = Register(1)
     b = BitVecConstant(32, 0)
     r.write(b)
     # __nonzero__ (==) currently unimplemented for Bool
     self.assertTrue(isinstance(r.read(), Bool))
예제 #18
0
 def test_basic_write(self):
     r = Register(32)
     r.write(1)
     self.assertEqual(r.read(), 1)
예제 #19
0
 def test_rd(self):
     r = Register(32)
     self.assertEqual(r.read(), 0)
예제 #20
0
 def test_basic_write(self):
     r = Register(32)
     r.write(1)
     self.assertEqual(r.read(), 1)