From da6fe2e9832501672afc62d1dcde96fa79d424f9 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 9 Jul 2016 15:47:53 -0400 Subject: [PATCH] This should be enough of a shell to write some actual tests. --- .../Mac/Clock SignalTests/C1540Tests.swift | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/OSBindings/Mac/Clock SignalTests/C1540Tests.swift b/OSBindings/Mac/Clock SignalTests/C1540Tests.swift index cce738162..5f169902b 100644 --- a/OSBindings/Mac/Clock SignalTests/C1540Tests.swift +++ b/OSBindings/Mac/Clock SignalTests/C1540Tests.swift @@ -10,4 +10,22 @@ import XCTest class C1540Tests: XCTestCase { + private func with1540(action: (C1540Bridge) -> ()) { + let bridge = C1540Bridge() + + if let path = NSBundle.mainBundle().pathForResource("1541", ofType: "bin", inDirectory: "ROMImages/Commodore1540") { + let data = NSData(contentsOfFile: path) + bridge.setROM(data) + } + + action(bridge) + } + + // MARK: EOI + + func testEOI() { + with1540 { + $0.runForCycles(20) + } + } }