diff options
| author | Ajax <commial@gmail.com> | 2018-05-18 16:35:36 +0200 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2018-05-18 16:35:36 +0200 |
| commit | ac36f324154b1ef936f3d5fd27215535ae99452a (patch) | |
| tree | 09791f3d3c31add07060940ee7f2d2fd6e5fd225 /test/arch/x86/unit/mn_int.py | |
| parent | dfa6a23894f6d6bf37336490db214b557bc5a50c (diff) | |
| download | miasm-ac36f324154b1ef936f3d5fd27215535ae99452a.tar.gz miasm-ac36f324154b1ef936f3d5fd27215535ae99452a.zip | |
Add a regression test to ensure INT is called each time in a loop
Diffstat (limited to '')
| -rwxr-xr-x | test/arch/x86/unit/mn_int.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/arch/x86/unit/mn_int.py b/test/arch/x86/unit/mn_int.py index 09792371..efacb105 100755 --- a/test/arch/x86/unit/mn_int.py +++ b/test/arch/x86/unit/mn_int.py @@ -8,12 +8,18 @@ from asm_test import Asm_Test_32 class Test_INT(Asm_Test_32): TXT = ''' main: + MOV ECX, 0x10 + loop: INT 0x42 + DEC ECX + JNZ loop + ret: RET ''' def set_int_num(self, jitter): - self.int_num = jitter.cpu.get_interrupt_num() + assert jitter.cpu.get_interrupt_num() == 0x42 + self.int_num += 1 jitter.cpu.set_exception(0) return True @@ -24,7 +30,7 @@ class Test_INT(Asm_Test_32): self.set_int_num) def check(self): - assert self.int_num == 0x42 + assert self.int_num == 0x10 self.myjit.cpu.set_interrupt_num(14) assert self.myjit.cpu.get_interrupt_num() == 14 |