mirror of
https://github.com/pevans/erc-c.git
synced 2025-01-02 09:29:58 +00:00
Further testing
This commit is contained in:
parent
e84b79819b
commit
a48bc05bd0
@ -47,3 +47,48 @@ Test(apple2dd, step)
|
|||||||
apple2dd_step(drive, -1000);
|
apple2dd_step(drive, -1000);
|
||||||
cr_assert_eq(drive->track_pos, 0);
|
cr_assert_eq(drive->track_pos, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Test(apple2dd, set_mode)
|
||||||
|
{
|
||||||
|
apple2dd_set_mode(drive, DD_WRITE);
|
||||||
|
cr_assert_eq(drive->mode, DD_WRITE);
|
||||||
|
apple2dd_set_mode(drive, DD_READ);
|
||||||
|
cr_assert_eq(drive->mode, DD_READ);
|
||||||
|
|
||||||
|
// let's try shenanigans
|
||||||
|
apple2dd_set_mode(drive, 111111111);
|
||||||
|
cr_assert_eq(drive->mode, DD_READ);
|
||||||
|
}
|
||||||
|
|
||||||
|
Test(apple2dd, turn_on)
|
||||||
|
{
|
||||||
|
apple2dd_turn_on(drive, true);
|
||||||
|
cr_assert(drive->online);
|
||||||
|
apple2dd_turn_on(drive, false);
|
||||||
|
cr_assert(!drive->online);
|
||||||
|
|
||||||
|
// I mean, ok
|
||||||
|
apple2dd_turn_on(drive, 1111333);
|
||||||
|
cr_assert(drive->online);
|
||||||
|
}
|
||||||
|
|
||||||
|
Test(apple2dd, write_protect)
|
||||||
|
{
|
||||||
|
apple2dd_write_protect(drive, true);
|
||||||
|
cr_assert(drive->write_protect);
|
||||||
|
apple2dd_write_protect(drive, false);
|
||||||
|
cr_assert(!drive->write_protect);
|
||||||
|
apple2dd_write_protect(drive, 2222);
|
||||||
|
cr_assert(drive->write_protect);
|
||||||
|
}
|
||||||
|
|
||||||
|
Test(apple2dd, position)
|
||||||
|
{
|
||||||
|
// Without any data, the drive should return a null position
|
||||||
|
// regardless of track position
|
||||||
|
drive->track_pos = 3;
|
||||||
|
drive->sector_pos = 44;
|
||||||
|
cr_assert_eq(apple2dd_position(drive), 0);
|
||||||
|
|
||||||
|
// FIXME: we need some dummy data for the drive...
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user