[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 20/25] fdc_test: update media_change test
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 20/25] fdc_test: update media_change test |
Date: |
Mon, 9 Jul 2012 16:16:23 +0200 |
From: Pavel Hrdina <address@hidden>
After rewrite DSKCHG bit handling the test has to be updated. Now
is needed to seek to different track to clear DSKCHG bit.
Signed-off-by: Pavel Hrdina <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
tests/fdc-test.c | 25 +++++++++++++++++--------
1 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/tests/fdc-test.c b/tests/fdc-test.c
index 610e2f1..5f52f6c 100644
--- a/tests/fdc-test.c
+++ b/tests/fdc-test.c
@@ -156,19 +156,16 @@ static uint8_t send_read_command(void)
return ret;
}
-static void send_step_pulse(void)
+static void send_step_pulse(int cyl)
{
int drive = 0;
int head = 0;
- static int cyl = 0;
floppy_send(CMD_SEEK);
floppy_send(head << 2 | drive);
g_assert(!get_irq(FLOPPY_IRQ));
floppy_send(cyl);
ack_irq();
-
- cyl = (cyl + 1) % 4;
}
static uint8_t cmos_read(uint8_t reg)
@@ -195,8 +192,7 @@ static void test_no_media_on_start(void)
assert_bit_set(dir, DSKCHG);
dir = inb(FLOPPY_BASE + reg_dir);
assert_bit_set(dir, DSKCHG);
- send_step_pulse();
- send_step_pulse();
+ send_step_pulse(1);
dir = inb(FLOPPY_BASE + reg_dir);
assert_bit_set(dir, DSKCHG);
dir = inb(FLOPPY_BASE + reg_dir);
@@ -227,7 +223,14 @@ static void test_media_change(void)
dir = inb(FLOPPY_BASE + reg_dir);
assert_bit_set(dir, DSKCHG);
- send_step_pulse();
+ send_step_pulse(0);
+ dir = inb(FLOPPY_BASE + reg_dir);
+ assert_bit_set(dir, DSKCHG);
+ dir = inb(FLOPPY_BASE + reg_dir);
+ assert_bit_set(dir, DSKCHG);
+
+ /* Step to next track should clear DSKCHG bit. */
+ send_step_pulse(1);
dir = inb(FLOPPY_BASE + reg_dir);
assert_bit_clear(dir, DSKCHG);
dir = inb(FLOPPY_BASE + reg_dir);
@@ -243,7 +246,13 @@ static void test_media_change(void)
dir = inb(FLOPPY_BASE + reg_dir);
assert_bit_set(dir, DSKCHG);
- send_step_pulse();
+ send_step_pulse(0);
+ dir = inb(FLOPPY_BASE + reg_dir);
+ assert_bit_set(dir, DSKCHG);
+ dir = inb(FLOPPY_BASE + reg_dir);
+ assert_bit_set(dir, DSKCHG);
+
+ send_step_pulse(1);
dir = inb(FLOPPY_BASE + reg_dir);
assert_bit_set(dir, DSKCHG);
dir = inb(FLOPPY_BASE + reg_dir);
--
1.7.6.5
- [Qemu-devel] [PATCH 02/25] qcow2: preserve free_byte_offset when qcow2_alloc_bytes() fails, (continued)
- [Qemu-devel] [PATCH 02/25] qcow2: preserve free_byte_offset when qcow2_alloc_bytes() fails, Kevin Wolf, 2012/07/09
- [Qemu-devel] [PATCH 06/25] sheepdog: use coroutine based socket functions in coroutine context, Kevin Wolf, 2012/07/09
- [Qemu-devel] [PATCH 08/25] sheepdog: split outstanding list into inflight and pending, Kevin Wolf, 2012/07/09
- [Qemu-devel] [PATCH 09/25] sheepdog: traverse pending_list from the first for each time, Kevin Wolf, 2012/07/09
- [Qemu-devel] [PATCH 14/25] blkdebug: optionally tie errors to a specific sector, Kevin Wolf, 2012/07/09
- [Qemu-devel] [PATCH 10/25] blkdebug: remove sync i/o events, Kevin Wolf, 2012/07/09
- [Qemu-devel] [PATCH 16/25] block: copy over job and dirty bitmap fields in bdrv_append, Kevin Wolf, 2012/07/09
- [Qemu-devel] [PATCH 11/25] blkdebug: tiny cleanup, Kevin Wolf, 2012/07/09
- [Qemu-devel] [PATCH 17/25] block: introduce bdrv_swap, implement bdrv_append on top of it, Kevin Wolf, 2012/07/09
- [Qemu-devel] [PATCH 18/25] fdc: rewrite seek and DSKCHG bit handling, Kevin Wolf, 2012/07/09
- [Qemu-devel] [PATCH 20/25] fdc_test: update media_change test,
Kevin Wolf <=
- [Qemu-devel] [PATCH 13/25] blkdebug: store list of active rules, Kevin Wolf, 2012/07/09
- [Qemu-devel] [PATCH 15/25] raw: hook into blkdebug, Kevin Wolf, 2012/07/09
- [Qemu-devel] [PATCH 24/25] qtest: Tidy up temporary files properly, Kevin Wolf, 2012/07/09
- [Qemu-devel] [PATCH 21/25] fdc_test: introduce test_sense_interrupt, Kevin Wolf, 2012/07/09
- [Qemu-devel] [PATCH 19/25] fdc: fix interrupt handling, Kevin Wolf, 2012/07/09
- [Qemu-devel] [PATCH 23/25] fdc: Move floppy geometry guessing back from block.c, Kevin Wolf, 2012/07/09