mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-05 05:34:20 +00:00
Instituted memory value checks, flushing out seven new failures.
This commit is contained in:
parent
c322410783
commit
a329d85697
@ -172,9 +172,9 @@ class FUSETests: XCTestCase {
|
|||||||
let machine = CSTestMachineZ80()
|
let machine = CSTestMachineZ80()
|
||||||
initialState.set(onMachine: machine)
|
initialState.set(onMachine: machine)
|
||||||
|
|
||||||
let memoryGroups = itemDictionary["memory"] as? [Any]
|
let inputMemoryGroups = itemDictionary["memory"] as? [Any]
|
||||||
if let memoryGroups = memoryGroups {
|
if let inputMemoryGroups = inputMemoryGroups {
|
||||||
for group in memoryGroups {
|
for group in inputMemoryGroups {
|
||||||
let groupDictionary = group as! [String: Any]
|
let groupDictionary = group as! [String: Any]
|
||||||
var address = UInt16(groupDictionary["address"] as! NSNumber)
|
var address = UInt16(groupDictionary["address"] as! NSNumber)
|
||||||
let data = groupDictionary["data"] as! [NSNumber]
|
let data = groupDictionary["data"] as! [NSNumber]
|
||||||
@ -189,7 +189,22 @@ class FUSETests: XCTestCase {
|
|||||||
|
|
||||||
let finalState = RegisterState(machine: machine)
|
let finalState = RegisterState(machine: machine)
|
||||||
|
|
||||||
XCTAssertEqual(finalState, targetState, "Failed \(name)")
|
// Compare processor state.
|
||||||
|
XCTAssertEqual(finalState, targetState, "Failed processor state \(name)")
|
||||||
|
|
||||||
|
// Compare memory state.
|
||||||
|
let outputMemoryGroups = outputDictionary["memory"] as? [Any]
|
||||||
|
if let outputMemoryGroups = outputMemoryGroups {
|
||||||
|
for group in outputMemoryGroups {
|
||||||
|
let groupDictionary = group as! [String: Any]
|
||||||
|
var address = UInt16(groupDictionary["address"] as! NSNumber)
|
||||||
|
let data = groupDictionary["data"] as! [NSNumber]
|
||||||
|
for value in data {
|
||||||
|
XCTAssert(machine.value(atAddress: address) == UInt8(value), "Failed memory state \(name)")
|
||||||
|
address = address + 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO compare bus operations and final memory state
|
// TODO compare bus operations and final memory state
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user