Patchwork [11/26] fdc-test: split test_media_change() test, so insert part can be reused

login
register
mail settings
Submitter Kevin Wolf
Date Nov. 14, 2012, 6:47 p.m.
Message ID <1352918847-3696-12-git-send-email-kwolf@redhat.com>
Download mbox | patch
Permalink /patch/198982/
State New
Headers show

Comments

Kevin Wolf - Nov. 14, 2012, 6:47 p.m.
From: Hervé Poussineau <hpoussin@reactos.org>

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/fdc-test.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

Patch

diff --git a/tests/fdc-test.c b/tests/fdc-test.c
index fa74411..a4303d1 100644
--- a/tests/fdc-test.c
+++ b/tests/fdc-test.c
@@ -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. */