Tests: Add helper for READCAPACITY10

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
Ronnie Sahlberg
2016-02-21 13:51:50 -08:00
parent 80e06cae30
commit 9f81ae91fe
2 changed files with 16 additions and 6 deletions

View File

@@ -335,6 +335,20 @@ do { \
CU_ASSERT_EQUAL(_r, 0); \
} while (0);
#define READCAPACITY10(...) \
do { \
int _r; \
_r = readcapacity10(__VA_ARGS__); \
if (_r == -2) { \
logging(LOG_NORMAL, "[SKIPPED] READCAPACITY10 " \
"is not implemented."); \
CU_PASS("[SKIPPED] Target does not support " \
"READCAPACITY10. Skipping test"); \
return; \
} \
CU_ASSERT_EQUAL(_r, 0); \
} while (0);
#define READCAPACITY16(...) \
do { \
int _r; \

View File

@@ -29,13 +29,9 @@
void
test_readcapacity10_simple(void)
{
int ret;
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test basic READCAPACITY10");
ret = readcapacity10(sd, NULL, 0, 0,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
READCAPACITY10(sd, NULL, 0, 0,
EXPECT_STATUS_GOOD);
}