X64EmitterTest: Check bytes instead of disassembly in JMP test
Check bytes directly to avoid ambiguity in the disassembly between short and near jumps, which could hypothetically cause the test to pass when it shouldn't.
This commit is contained in:
parent
dcd5ba6587
commit
4ccac53e9f
|
@ -297,15 +297,13 @@ TEST_F(x64EmitterTest, POP_Register)
|
|||
|
||||
TEST_F(x64EmitterTest, JMP)
|
||||
{
|
||||
emitter->NOP(6);
|
||||
emitter->JMP(code_buffer);
|
||||
ExpectDisassembly("multibyte nop "
|
||||
"jmp .-8");
|
||||
emitter->NOP(1);
|
||||
emitter->JMP(code_buffer, XEmitter::Jump::Short);
|
||||
ExpectBytes({/* nop */ 0x90, /* short jmp */ 0xeb, /* offset -3 */ 0xfd});
|
||||
|
||||
emitter->NOP(6);
|
||||
emitter->NOP(1);
|
||||
emitter->JMP(code_buffer, XEmitter::Jump::Near);
|
||||
ExpectDisassembly("multibyte nop "
|
||||
"jmp .-11");
|
||||
ExpectBytes({/* nop */ 0x90, /* near jmp */ 0xe9, /* offset -6 */ 0xfa, 0xff, 0xff, 0xff});
|
||||
}
|
||||
|
||||
TEST_F(x64EmitterTest, JMPptr_Register)
|
||||
|
|
Loading…
Reference in New Issue