[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 21/25] fdc_test: introduce test_sense_interrupt
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 21/25] fdc_test: introduce test_sense_interrupt |
Date: |
Mon, 9 Jul 2012 16:16:24 +0200 |
From: Pavel Hrdina <address@hidden>
Calling sense interrupt status while there is no interrupt should
return invalid command (0x80).
Read command should always returns in st0 seek_end bit set to 1.
Signed-off-by: Pavel Hrdina <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
tests/fdc-test.c | 25 ++++++++++++++++++++++++-
1 files changed, 24 insertions(+), 1 deletions(-)
diff --git a/tests/fdc-test.c b/tests/fdc-test.c
index 5f52f6c..585fb0e 100644
--- a/tests/fdc-test.c
+++ b/tests/fdc-test.c
@@ -142,7 +142,7 @@ static uint8_t send_read_command(void)
}
st0 = floppy_recv();
- if (st0 != 0x40) {
+ if (st0 != 0x60) {
ret = 1;
}
@@ -259,6 +259,28 @@ static void test_media_change(void)
assert_bit_set(dir, DSKCHG);
}
+static void test_sense_interrupt(void)
+{
+ int drive = 0;
+ int head = 0;
+ int cyl = 0;
+ int ret = 0;
+
+ floppy_send(CMD_SENSE_INT);
+ ret = floppy_recv();
+ g_assert(ret == 0x80);
+
+ floppy_send(CMD_SEEK);
+ floppy_send(head << 2 | drive);
+ g_assert(!get_irq(FLOPPY_IRQ));
+ floppy_send(cyl);
+
+ floppy_send(CMD_SENSE_INT);
+ ret = floppy_recv();
+ g_assert(ret == 0x20);
+ floppy_recv();
+}
+
/* success if no crash or abort */
static void fuzz_registers(void)
{
@@ -306,6 +328,7 @@ int main(int argc, char **argv)
qtest_add_func("/fdc/no_media_on_start", test_no_media_on_start);
qtest_add_func("/fdc/read_without_media", test_read_without_media);
qtest_add_func("/fdc/media_change", test_media_change);
+ qtest_add_func("/fdc/sense_interrupt", test_sense_interrupt);
qtest_add_func("/fdc/fuzz-registers", fuzz_registers);
ret = g_test_run();
--
1.7.6.5
- [Qemu-devel] [PATCH 14/25] blkdebug: optionally tie errors to a specific sector, (continued)
- [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, 2012/07/09
- [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 <=
- [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
- Re: [Qemu-devel] [PATCH 23/25] fdc: Move floppy geometry guessing back from block.c, Anthony Liguori, 2012/07/09
- Re: [Qemu-devel] [PATCH 23/25] fdc: Move floppy geometry guessing back from block.c, Kevin Wolf, 2012/07/09
- Re: [Qemu-devel] [PATCH 23/25] fdc: Move floppy geometry guessing back from block.c, Anthony Liguori, 2012/07/09
- Re: [Qemu-devel] [PATCH 23/25] fdc: Move floppy geometry guessing back from block.c, Markus Armbruster, 2012/07/09
- Re: [Qemu-devel] [PATCH 23/25] fdc: Move floppy geometry guessing back from block.c, Eric Blake, 2012/07/09
- Re: [Qemu-devel] [PATCH 23/25] fdc: Move floppy geometry guessing back from block.c, Anthony Liguori, 2012/07/09
- Re: [Qemu-devel] [PATCH 23/25] fdc: Move floppy geometry guessing back from block.c, Kevin Wolf, 2012/07/10
[Qemu-devel] [PATCH 22/25] fdc: Drop broken code for user-defined floppy geometry, Kevin Wolf, 2012/07/09