izapple2/screenHiRes_test.go

25 lines
393 B
Go
Raw Normal View History

2020-10-03 21:38:26 +00:00
package izapple2
2019-04-26 16:08:30 +00:00
import (
"testing"
)
func TestGetHiResLineOffest(t *testing.T) {
2019-04-26 16:08:30 +00:00
scenarios := map[int]uint16{
0: 0x2000,
1: 0x2400,
8: 0x2080,
63: 0x3f80,
64: 0x2028,
128: 0x2050,
191: 0x3fd0,
}
for in, want := range scenarios {
got := 0x2000 + getHiResLineOffset(in)
2019-04-26 16:08:30 +00:00
if want != got {
t.Errorf("expected %x but got %x for line %v", want, got, in)
}
}
}