diff --git a/suite/regress/x86_int_3.py b/suite/regress/x86_int_3.py new file mode 100755 index 0000000000000000000000000000000000000000..a4c2e035d5d2f1b04ec5ebbff8f5098436acfc46 --- /dev/null +++ b/suite/regress/x86_int_3.py @@ -0,0 +1,24 @@ +#!/usr/bin/python +# example on how to code a Keystone regression in Python +# Nguyen Anh Quynh, 2016 + +# Fill in the information in the form below when you create a new regression + +# Github issue: #7 +# Author: Nguyen Anh Quynh + +from keystone import * + +import regress + +class TestX86(regress.RegressTest): + def runTest(self): + # Initialize Keystone engine + ks = Ks(KS_ARCH_X86, KS_MODE_32) + # Assemble to get back insn encoding & statement count + encoding, count = ks.asm("int 3") + # Assert the result + self.assertEqual(encoding, [ 0xcd, 0x03 ]) + +if __name__ == '__main__': + regress.main()