1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-07-04 09:29:26 +00:00

Add shift test

This commit is contained in:
Peter Evans 2017-12-15 16:53:12 -06:00
parent 06c8d623e7
commit 223edd14fe

View File

@ -119,3 +119,17 @@ Test(apple2dd, insert)
cr_assert_eq(apple2dd_insert(drive, stream), ERR_BADFILE);
fclose(stream);
}
Test(apple2dd, shift)
{
apple2dd_shift(drive, 5);
cr_assert_eq(drive->sector_pos, 5);
// Push it beyond the sector boundary; see if the track position
// updates as it should.
apple2dd_shift(drive, MAX_SECTOR_POS + 3);
cr_assert_eq(drive->track_pos, 2);
// this should be the mod of sector_pos and MAX_SECTOR_POS
cr_assert_eq(drive->sector_pos, 7);
}