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); \
|
CU_ASSERT_EQUAL(_r, 0); \
|
||||||
} while (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(...) \
|
#define RECEIVE_COPY_RESULTS(...) \
|
||||||
do { \
|
do { \
|
||||||
int _r; \
|
int _r; \
|
||||||
|
|||||||
@@ -29,20 +29,13 @@
|
|||||||
void
|
void
|
||||||
test_readcapacity16_alloclen(void)
|
test_readcapacity16_alloclen(void)
|
||||||
{
|
{
|
||||||
int i, ret;
|
int i;
|
||||||
|
|
||||||
|
|
||||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||||
logging(LOG_VERBOSE, "Test that READCAPACITY16 with alloc_len 0-15 is not an error");
|
logging(LOG_VERBOSE, "Test that READCAPACITY16 with alloc_len 0-15 is not an error");
|
||||||
|
|
||||||
for (i = 0; i < 16; i++) {
|
for (i = 0; i < 16; i++) {
|
||||||
ret = readcapacity16(sd, NULL, i,
|
READCAPACITY16(sd, NULL, i,
|
||||||
EXPECT_STATUS_GOOD);
|
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,18 +29,9 @@
|
|||||||
void
|
void
|
||||||
test_readcapacity16_simple(void)
|
test_readcapacity16_simple(void)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
|
|
||||||
|
|
||||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||||
logging(LOG_VERBOSE, "Test that READCAPACITY16 works");
|
logging(LOG_VERBOSE, "Test that READCAPACITY16 works");
|
||||||
|
|
||||||
ret = readcapacity16(sd, NULL, 16,
|
READCAPACITY16(sd, NULL, 16,
|
||||||
EXPECT_STATUS_GOOD);
|
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);
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user