-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests of card presence with Card Cat
- Loading branch information
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package izapple2 | ||
|
||
import ( | ||
"strings" | ||
"testing" | ||
) | ||
|
||
func testCardDetectedInternal(t *testing.T, model string, card string, cycles uint64, banner string) { | ||
overrides := newConfiguration() | ||
overrides.set(confS3, "empty") | ||
overrides.set(confS4, "empty") | ||
overrides.set(confS5, "empty") | ||
overrides.set(confS7, "empty") | ||
|
||
overrides.set(confS2, card) | ||
overrides.set(confS6, "diskii,disk1=\"<internal>/Card Cat 1.0b9.dsk\"") | ||
|
||
at, err := makeApple2Tester(model, overrides) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
at.terminateCondition = func(a *Apple2) bool { | ||
return a.cpu.GetCycles() > cycles | ||
} | ||
at.run() | ||
|
||
text := at.getText80() | ||
if !strings.Contains(text, banner) { | ||
t.Errorf("Expected '%s', got '%s'", banner, text) | ||
} | ||
} | ||
|
||
func TestCardsDetected(t *testing.T) { | ||
|
||
t.Run("test Memory Expansion card", func(t *testing.T) { | ||
testCardDetectedInternal(t, "2enh", "memexp", 50_000_000, "2 03-00-05-D0 Apple II Memory Expansion Card (SP)") | ||
}) | ||
|
||
t.Run("test Mouse card", func(t *testing.T) { | ||
testCardDetectedInternal(t, "2enh", "mouse", 50_000_000, "2 38-18-01-20 Apple II Mouse Card") | ||
}) | ||
|
||
t.Run("test Parallel printer card", func(t *testing.T) { | ||
testCardDetectedInternal(t, "2enh", "parallel", 50_000_000, "2 48-48-58-FF Apple Parallel Interface Card") | ||
}) | ||
|
||
t.Run("test ThunderClock Plus card", func(t *testing.T) { | ||
testCardDetectedInternal(t, "2enh", "thunderclock", 50_000_000, "2 FF-05-18-B8 ThunderClock Plus Card") | ||
}) | ||
|
||
// Saturn not detected | ||
// VidHD not detected | ||
// Swyftcard not compatible with Card Cat | ||
// Pending to try Saturn, 80col with 2plus but fails with an illegal opcode | ||
|
||
} |
Binary file not shown.