From 267b2add9a99cf42411c325c0f98aeb9b9b8b3f8 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 29 May 2017 16:44:07 -0400 Subject: [PATCH] Adjusted for where FUSE nominally places timestamps. Down to 92 failures. --- OSBindings/Mac/Clock SignalTests/FUSETests.swift | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/OSBindings/Mac/Clock SignalTests/FUSETests.swift b/OSBindings/Mac/Clock SignalTests/FUSETests.swift index ac0dcb9fd..555d96ce6 100644 --- a/OSBindings/Mac/Clock SignalTests/FUSETests.swift +++ b/OSBindings/Mac/Clock SignalTests/FUSETests.swift @@ -167,7 +167,7 @@ class FUSETests: XCTestCase { let name = itemDictionary["name"] as! String -// if name != "66" { +// if name != "d3_1" { // continue; // } @@ -230,7 +230,11 @@ class FUSETests: XCTestCase { continue } + // FUSE counts a memory access as occurring at the last cycle of its bus operation; + // it counts a port access as occurring on the second. timeOffset is used to adjust + // the FUSE numbers as required. var operation: CSTestMachineZ80BusOperationCaptureOperation = .read + var timeOffset: Int32 = 0 switch type { case "MR": operation = .read @@ -240,9 +244,11 @@ class FUSETests: XCTestCase { case "PR": operation = .portRead + timeOffset = 3 case "PW": operation = .portWrite + timeOffset = 3 default: print("Unhandled activity type \(type)!") @@ -251,7 +257,7 @@ class FUSETests: XCTestCase { XCTAssert( capturedBusActivity[capturedBusAcivityIndex].address == address && capturedBusActivity[capturedBusAcivityIndex].value == value! && - capturedBusActivity[capturedBusAcivityIndex].timeStamp == time && + capturedBusActivity[capturedBusAcivityIndex].timeStamp == (time + timeOffset) && capturedBusActivity[capturedBusAcivityIndex].operation == operation, "Failed bus operation match \(name) (at time \(time) with address \(address), value was \(value != nil ? value! : 0), tracking index \(capturedBusAcivityIndex) amgonst \(capturedBusActivity))") capturedBusAcivityIndex += 1