From f69634680670ada423d9a71af8bee9f6963cbcd0 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Sun, 4 Feb 2018 11:32:23 -0600 Subject: [PATCH] Add test for switch_latch --- tests/apple2.dd.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/apple2.dd.c b/tests/apple2.dd.c index 0142d82..ccbdf32 100644 --- a/tests/apple2.dd.c +++ b/tests/apple2.dd.c @@ -267,3 +267,16 @@ Test(apple2_dd, switch_drive) apple2_free(mach); } + +Test(apple2_dd, switch_latch) +{ + drive->latch = 0; + drive->mode = DD_READ; + + apple2_dd_switch_latch(drive, 3); + cr_assert_eq(drive->latch, 0); + + drive->mode = DD_WRITE; + apple2_dd_switch_latch(drive, 5); + cr_assert_eq(drive->latch, 5); +}