Tests: helper for READCAPACITY16
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
@@ -265,6 +265,20 @@ do { \
|
||||
CU_ASSERT_EQUAL(_r, 0); \
|
||||
} while (0);
|
||||
|
||||
#define READCAPACITY16(...) \
|
||||
do { \
|
||||
int _r; \
|
||||
_r = readcapacity16(__VA_ARGS__); \
|
||||
if (_r == -2) { \
|
||||
logging(LOG_NORMAL, "[SKIPPED] READCAPACITY16 " \
|
||||
"is not implemented."); \
|
||||
CU_PASS("[SKIPPED] Target does not support " \
|
||||
"READCAPACITY16. Skipping test"); \
|
||||
return; \
|
||||
} \
|
||||
CU_ASSERT_EQUAL(_r, 0); \
|
||||
} while (0);
|
||||
|
||||
#define RECEIVE_COPY_RESULTS(...) \
|
||||
do { \
|
||||
int _r; \
|
||||
|
||||
@@ -29,20 +29,13 @@
|
||||
void
|
||||
test_readcapacity16_alloclen(void)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
int i;
|
||||
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test that READCAPACITY16 with alloc_len 0-15 is not an error");
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
ret = readcapacity16(sd, NULL, i,
|
||||
EXPECT_STATUS_GOOD);
|
||||
if (ret == -2) {
|
||||
logging(LOG_NORMAL, "[SKIPPED] READCAPACITY16 is not implemented on this target and it does not claim SBC-3 support.");
|
||||
CU_PASS("READCAPACITY16 is not implemented and no SBC-3 support claimed.");
|
||||
return;
|
||||
}
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
READCAPACITY16(sd, NULL, i,
|
||||
EXPECT_STATUS_GOOD);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,18 +29,9 @@
|
||||
void
|
||||
test_readcapacity16_simple(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test that READCAPACITY16 works");
|
||||
|
||||
ret = readcapacity16(sd, NULL, 16,
|
||||
EXPECT_STATUS_GOOD);
|
||||
if (ret == -2) {
|
||||
logging(LOG_NORMAL, "[SKIPPED] READCAPACITY16 is not implemented on this target and it does not claim support.");
|
||||
CU_PASS("READCAPACITY16 is not implemented and no SBC-3 support claimed.");
|
||||
return;
|
||||
}
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
READCAPACITY16(sd, NULL, 16,
|
||||
EXPECT_STATUS_GOOD);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user