fdc-test: split test_media_change() test, so insert part can be reused
authorHervé Poussineau <hpoussin@reactos.org>
Tue, 18 Sep 2012 20:48:48 +0000 (22:48 +0200)
committerKevin Wolf <kwolf@redhat.com>
Wed, 14 Nov 2012 17:19:22 +0000 (18:19 +0100)
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
tests/fdc-test.c

index fa7441110dfd1194a202a50ae8909e7e237cb29b..a4303d19d8f3b181c7b0ab0aee7a7885e459c1c2 100644 (file)
@@ -217,7 +217,7 @@ static void test_read_without_media(void)
     g_assert(ret == 0);
 }
 
-static void test_media_change(void)
+static void test_media_insert(void)
 {
     uint8_t dir;
 
@@ -245,6 +245,13 @@ static void test_media_change(void)
     assert_bit_clear(dir, DSKCHG);
     dir = inb(FLOPPY_BASE + reg_dir);
     assert_bit_clear(dir, DSKCHG);
+}
+
+static void test_media_change(void)
+{
+    uint8_t dir;
+
+    test_media_insert();
 
     /* Eject the floppy and check that DSKCHG is set. Reading it out doesn't
      * reset the bit. */