def test_value(self): """Check immediate value with different size.""" self.assertEqual(self.imm.getValue(), 0x1234) self.imm = Immediate(-4, CPUSIZE.BYTE) self.assertEqual(self.imm.getValue(), 0xfc) self.imm = Immediate(-4, CPUSIZE.WORD) self.assertEqual(self.imm.getValue(), 0xfffc) self.imm = Immediate(-4, CPUSIZE.DWORD) self.assertEqual(self.imm.getValue(), 0xfffffffc) self.imm = Immediate(-4, CPUSIZE.QWORD) self.assertEqual(self.imm.getValue(), 0xfffffffffffffffc)
def test_build_immediate(self): """Check symbolic immediate has correct size and evaluation.""" node = self.Triton.buildSymbolicImmediate(Immediate( 0x10, CPUSIZE.BYTE)) self.assertEqual(node.evaluate(), 0x10) self.assertEqual(node.getBitvectorSize(), CPUSIZE.BYTE_BIT)
def setUp(self): """Define the arch and Immediate to test.""" self.Triton = TritonContext() self.Triton.setArchitecture(ARCH.X86_64) self.imm = Immediate(0x0123456789abcdef, CPUSIZE.QWORD)
def setUp(self): """Define the arch and Immediate to test.""" self.Triton = TritonContext() self.Triton.setArchitecture(ARCH.X86_64) self.imm = Immediate(0x12, CPUSIZE.BYTE)
def setUp(self): """Define the arch and Immediate to test.""" setArchitecture(ARCH.X86_64) self.imm = Immediate(0x12345678, CPUSIZE.DWORD)