1
0
mirror of https://github.com/ariejan/i6502.git synced 2024-06-10 01:29:33 +00:00
i6502/ram_test.go
Ariejan de Vroom 0e1d9eaa8f Add ROM Memory
2014-08-17 16:20:30 +02:00

24 lines
427 B
Go

package i6502
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestRamSize(t *testing.T) {
ram, _ := NewRam(0x8000) // 32 kB
assert.Equal(t, 0x8000, ram.Size())
}
func TestRamReadWrite(t *testing.T) {
ram, _ := NewRam(0x8000) // 32 kB
// Ram zeroed out initially
for i := 0; i < 0x8000; i++ {
assert.Equal(t, 0x00, ram.data[i])
}
ram.Write(0x1000, 0x42)
assert.Equal(t, 0x42, ram.Read(0x1000))
}