mirror of
https://github.com/TomHarte/CLK.git
synced 2025-08-07 23:25:00 +00:00
Ensured test raises only the intentional failure exceptions.
This commit is contained in:
@@ -38,8 +38,15 @@ class Z80MachineCycleTests: XCTestCase {
|
|||||||
let length = cycle.timeStamp - totalCycles
|
let length = cycle.timeStamp - totalCycles
|
||||||
totalCycles += length
|
totalCycles += length
|
||||||
|
|
||||||
XCTAssertEqual(length, busCycles[index].length)
|
if index >= busCycles.count {
|
||||||
XCTAssertEqual(cycle.operation, busCycles[index].operation)
|
// this can't be reached without one of the asserts failing;
|
||||||
|
// it's to prevent an unintended exeception via out-of-bounds
|
||||||
|
// array access
|
||||||
|
break
|
||||||
|
} else {
|
||||||
|
XCTAssertEqual(length, busCycles[index].length)
|
||||||
|
XCTAssertEqual(cycle.operation, busCycles[index].operation)
|
||||||
|
}
|
||||||
|
|
||||||
index += 1
|
index += 1
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user