From 4d0c7559c0e37d1d692e90a560a4f6508af8bb36 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Sun, 9 Oct 2016 14:28:56 -0700 Subject: [PATCH] TEST: Improve simple startstopunit test Signed-off-by: Ronnie Sahlberg --- test-tool/test_startstopunit_simple.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/test-tool/test_startstopunit_simple.c b/test-tool/test_startstopunit_simple.c index db5922a..59a452a 100644 --- a/test-tool/test_startstopunit_simple.c +++ b/test-tool/test_startstopunit_simple.c @@ -38,17 +38,19 @@ test_startstopunit_simple(void) logging(LOG_VERBOSE, "Test we can eject removable the media with IMMED==1"); if (inq->rmb) { logging(LOG_VERBOSE, "Media is removable. STARTSTOPUNIT should work"); + ret = startstopunit(sd, 1, 0, 0, 0, 1, 0, + EXPECT_STATUS_GOOD); + CU_ASSERT_EQUAL(ret, 0); } else { logging(LOG_VERBOSE, "Media is not removable. STARTSTOPUNIT should fail"); - } + ret = startstopunit(sd, 1, 0, 0, 0, 1, 0, + EXPECT_STATUS_GENERIC_BAD); + if (!inq->rmb) { + CU_ASSERT_NOT_EQUAL(ret, 0); + return; + } - ret = startstopunit(sd, 1, 0, 0, 0, 1, 0, - EXPECT_STATUS_GOOD); - if (!inq->rmb) { - CU_ASSERT_NOT_EQUAL(ret, 0); - return; } - CU_ASSERT_EQUAL(ret, 0); logging(LOG_VERBOSE, "Test TESTUNITREADY that medium is ejected.");