mirror of
https://github.com/ivanizag/izapple2.git
synced 2024-12-21 18:29:45 +00:00
Functional tests
This commit is contained in:
parent
8bd489522f
commit
139597b0d5
30
6502functional_test.go
Normal file
30
6502functional_test.go
Normal file
@ -0,0 +1,30 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestFunctional(t *testing.T) {
|
||||
var s state
|
||||
s.memory.loadBinary("tests/6502_functional_test.bin")
|
||||
|
||||
s.registers.setPC(0x0400)
|
||||
for true {
|
||||
testCase := s.memory[0x0200]
|
||||
if testCase >= 240 {
|
||||
break
|
||||
}
|
||||
log := testCase > 43
|
||||
if log {
|
||||
fmt.Printf("[ %d ] ", testCase)
|
||||
}
|
||||
pc := s.registers.getPC()
|
||||
executeInstruction(&s, log)
|
||||
if pc == s.registers.getPC() {
|
||||
//s.memory.printPage(0x00)
|
||||
//s.memory.printPage(0x01)
|
||||
t.Errorf("Failuse in test %v.", testCase)
|
||||
}
|
||||
}
|
||||
}
|
BIN
tests/6502_functional_test.bin
Normal file
BIN
tests/6502_functional_test.bin
Normal file
Binary file not shown.
14360
tests/6502_functional_test.lst
Normal file
14360
tests/6502_functional_test.lst
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user