From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9haA-0004C4-75 for qemu-devel@nongnu.org; Thu, 06 Sep 2012 15:17:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9ha8-0002FS-PA for qemu-devel@nongnu.org; Thu, 06 Sep 2012 15:17:41 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]:57520) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9ha7-0002F7-Pj for qemu-devel@nongnu.org; Thu, 06 Sep 2012 15:17:40 -0400 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Thu, 6 Sep 2012 21:17:57 +0200 Message-Id: <1346959079-8307-7-git-send-email-hpoussin@reactos.org> In-Reply-To: <1346959079-8307-1-git-send-email-hpoussin@reactos.org> References: <1346959079-8307-1-git-send-email-hpoussin@reactos.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 6/8] fdc-tests: add tests for VERIFY command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , =?UTF-8?q?Herv=C3=A9=20Poussineau?= Signed-off-by: Herv=C3=A9 Poussineau --- tests/fdc-test.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/fdc-test.c b/tests/fdc-test.c index b825959..4783b08 100644 --- a/tests/fdc-test.c +++ b/tests/fdc-test.c @@ -50,6 +50,7 @@ enum { CMD_SENSE_INT =3D 0x08, CMD_READ_ID =3D 0x0a, CMD_SEEK =3D 0x0f, + CMD_VERIFY =3D 0x16, CMD_READ =3D 0xe6, CMD_RELATIVE_SEEK_OUT =3D 0x8f, CMD_RELATIVE_SEEK_IN =3D 0xcf, @@ -111,7 +112,7 @@ static void ack_irq(uint8_t *pcn) g_assert(!get_irq(FLOPPY_IRQ)); } =20 -static uint8_t send_read_command(void) +static uint8_t send_read_command(uint8_t cmd) { uint8_t drive =3D 0; uint8_t head =3D 0; @@ -127,7 +128,7 @@ static uint8_t send_read_command(void) =20 uint8_t ret =3D 0; =20 - floppy_send(CMD_READ); + floppy_send(cmd); floppy_send(head << 2 | drive); g_assert(!get_irq(FLOPPY_IRQ)); floppy_send(cyl); @@ -214,7 +215,7 @@ static void test_read_without_media(void) { uint8_t ret; =20 - ret =3D send_read_command(); + ret =3D send_read_command(CMD_READ); g_assert(ret =3D=3D 0); } =20 @@ -385,6 +386,14 @@ static void test_read_id(void) g_assert_cmpint(st0, =3D=3D, head << 2); } =20 +static void test_verify(void) +{ + uint8_t ret; + + ret =3D send_read_command(CMD_VERIFY); + g_assert(ret =3D=3D 0); +} + /* success if no crash or abort */ static void fuzz_registers(void) { @@ -435,6 +444,7 @@ int main(int argc, char **argv) qtest_add_func("/fdc/sense_interrupt", test_sense_interrupt); qtest_add_func("/fdc/relative_seek", test_relative_seek); qtest_add_func("/fdc/read_id", test_read_id); + qtest_add_func("/fdc/verify", test_verify); qtest_add_func("/fdc/fuzz-registers", fuzz_registers); =20 ret =3D g_test_run(); --=20 1.7.10.4