Added more tests

This commit is contained in:
Eduard Urbach 2024-08-26 15:03:39 +02:00
parent fd64bc6358
commit e5dd47b5dd
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0

View File

@ -8,10 +8,12 @@ import (
) )
func TestX64(t *testing.T) { func TestX64(t *testing.T) {
assert.DeepEqual(t, x64.Call(nil, 1), []byte{0xe8, 0x01, 0x00, 0x00, 0x00}) assert.DeepEqual(t, x64.AlignStack(nil), []byte{0x48, 0x83, 0xE4, 0xF0})
assert.DeepEqual(t, x64.MoveRegisterNumber(nil, 0, 1), []byte{0xb8, 0x01, 0x00, 0x00, 0x00}) assert.DeepEqual(t, x64.Call(nil, 1), []byte{0xE8, 0x01, 0x00, 0x00, 0x00})
assert.DeepEqual(t, x64.MoveRegisterNumber(nil, 1, 1), []byte{0xb9, 0x01, 0x00, 0x00, 0x00}) assert.DeepEqual(t, x64.CallAtAddress(nil, 1), []byte{0xFF, 0x15, 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}) assert.DeepEqual(t, x64.ExtendRAXToRDX(nil), []byte{0x48, 0x99})
assert.DeepEqual(t, x64.MoveRegisterNumber(nil, 0, 1), []byte{0xB8, 0x01, 0x00, 0x00, 0x00})
assert.DeepEqual(t, x64.MoveRegisterNumber(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})
} }