fixed shiftright test

This commit is contained in:
radumacocian
2025-06-30 16:02:27 +02:00
parent 0f4a97bbf2
commit a79014c657
2 changed files with 3 additions and 4 deletions

View File

@@ -2,7 +2,6 @@ package cpu
import ( import (
"radu.macocian.me/goboy/cpu/operations" "radu.macocian.me/goboy/cpu/operations"
"radu.macocian.me/goboy/memory"
) )
type op_context struct { type op_context struct {

View File

@@ -12,18 +12,18 @@ func TestShiftLeft(t *testing.T) {
actual := r1 actual := r1
if actual != expected { if actual != expected {
t.Errorf("actual %x != expected %x", actual, expected) t.Errorf("actual %08b != expected %08b", actual, expected)
} }
} }
func TestShiftRight(t *testing.T) { func TestShiftRight(t *testing.T) {
r1 := byte(0b01010101) r1 := byte(0b01010101)
ShiftLeft(&r1) ShiftRight(&r1)
expected := byte(0b00101010) expected := byte(0b00101010)
actual := r1 actual := r1
if actual != expected { if actual != expected {
t.Errorf("actual %x != expected %x", actual, expected) t.Errorf("actual %08b != expected %08b", actual, expected)
} }
} }