Added more tests

This commit is contained in:
Eduard Urbach 2024-06-27 21:39:04 +02:00
parent b6947dab18
commit d77660cdb8
Signed by: eduard
GPG key ID: 49226B848C78F6C8
5 changed files with 61 additions and 8 deletions

View file

@ -8,9 +8,10 @@ import (
)
func TestX64(t *testing.T) {
assert.DeepEqual(t, x64.Call([]byte{}, 1), []byte{0xe8, 0x01, 0x00, 0x00, 0x00})
assert.DeepEqual(t, x64.MoveRegisterNumber32([]byte{}, 0, 1), []byte{0xb8, 0x01, 0x00, 0x00, 0x00})
assert.DeepEqual(t, x64.MoveRegisterNumber32([]byte{}, 1, 1), []byte{0xb9, 0x01, 0x00, 0x00, 0x00})
assert.DeepEqual(t, x64.Return([]byte{}), []byte{0xc3})
assert.DeepEqual(t, x64.Syscall([]byte{}), []byte{0x0f, 0x05})
assert.DeepEqual(t, x64.Call(nil, 1), []byte{0xe8, 0x01, 0x00, 0x00, 0x00})
assert.DeepEqual(t, x64.MoveRegisterNumber32(nil, 0, 1), []byte{0xb8, 0x01, 0x00, 0x00, 0x00})
assert.DeepEqual(t, x64.MoveRegisterNumber32(nil, 1, 1), []byte{0xb9, 0x01, 0x00, 0x00, 0x00})
assert.DeepEqual(t, x64.Return(nil), []byte{0xc3})
assert.DeepEqual(t, x64.Syscall(nil), []byte{0x0f, 0x05})
assert.DeepEqual(t, x64.ExtendRAXToRDX(nil), []byte{0x48, 0x99})
}