TESTS: read12/read16 change signature to return an optional task structure

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
Ronnie Sahlberg
2015-05-12 19:48:54 -07:00
parent 20ef4b5687
commit 811c04f01a
36 changed files with 87 additions and 81 deletions

View File

@@ -1678,7 +1678,8 @@ read10(struct scsi_device *sdev, struct scsi_task **out_task,
}
int
read12(struct scsi_device *sdev, uint32_t lba,
read12(struct scsi_device *sdev, struct scsi_task **out_task,
uint32_t lba,
uint32_t datalen, int blocksize, int rdprotect,
int dpo, int fua, int fua_nv, int group,
unsigned char *data,
@@ -1703,14 +1704,17 @@ read12(struct scsi_device *sdev, uint32_t lba,
if (data && task) {
memcpy(data, task->datain.data, task->datain.size);
}
if (task) {
if (out_task) {
*out_task = task;
} else if (task) {
scsi_free_scsi_task(task);
}
return ret;
}
int
read16(struct scsi_device *sdev, uint64_t lba,
read16(struct scsi_device *sdev, struct scsi_task **out_task,
uint64_t lba,
uint32_t datalen, int blocksize, int rdprotect,
int dpo, int fua, int fua_nv, int group,
unsigned char *data,
@@ -1735,7 +1739,9 @@ read16(struct scsi_device *sdev, uint64_t lba,
if (data && task) {
memcpy(data, task->datain.data, task->datain.size);
}
if (task) {
if (out_task) {
*out_task = task;
} else if (task) {
scsi_free_scsi_task(task);
}
return ret;

View File

@@ -284,8 +284,8 @@ int prefetch16(struct scsi_device *sdev, uint64_t lba, int num_blocks, int immed
int preventallow(struct scsi_device *sdev, int prevent);
int read6(struct scsi_device *sdev, struct scsi_task **task, uint32_t lba, uint32_t datalen, int blocksize, unsigned char *data, int status, enum scsi_sense_key key, int *ascq, int num_ascq);
int read10(struct scsi_device *sdev, struct scsi_task **task, uint32_t lba, uint32_t datalen, int blocksize, int rdprotect, int dpo, int fua, int fua_nv, int group, unsigned char *data, int status, enum scsi_sense_key key, int *ascq, int num_ascq);
int read12(struct scsi_device *sdev, uint32_t lba, uint32_t datalen, int blocksize, int rdprotect, int dpo, int fua, int fua_nv, int group, unsigned char *data, int status, enum scsi_sense_key key, int *ascq, int num_ascq);
int read16(struct scsi_device *sdev, uint64_t lba, uint32_t datalen, int blocksize, int rdprotect, int dpo, int fua, int fua_nv, int group, unsigned char *data, int status, enum scsi_sense_key key, int *ascq, int num_ascq);
int read12(struct scsi_device *sdev, struct scsi_task **task, uint32_t lba, uint32_t datalen, int blocksize, int rdprotect, int dpo, int fua, int fua_nv, int group, unsigned char *data, int status, enum scsi_sense_key key, int *ascq, int num_ascq);
int read16(struct scsi_device *sdev, struct scsi_task **task, uint64_t lba, uint32_t datalen, int blocksize, int rdprotect, int dpo, int fua, int fua_nv, int group, unsigned char *data, int status, enum scsi_sense_key key, int *ascq, int num_ascq);
int readcapacity10(struct scsi_device *sdev, struct scsi_task **task, uint32_t lba, int pmi, int status, enum scsi_sense_key key, int *ascq, int num_ascq);
int readcapacity16(struct scsi_device *sdev, struct scsi_task **task, int alloc_len, int status, enum scsi_sense_key key, int *ascq, int num_ascq);
int report_supported_opcodes(struct scsi_device *sdev, struct scsi_task **save_task, int rctd, int options, int opcode, int sa, int alloc_len, int status, enum scsi_sense_key key, int *ascq, int num_ascq);

View File

@@ -103,7 +103,7 @@ test_compareandwrite_miscompare(void)
logging(LOG_VERBOSE, "Read %d blocks at LBA:0 and verify "
"they are still unchanged as 'A'", i);
ret = read16(sd, 0, i * block_size,
ret = read16(sd, NULL, 0, i * block_size,
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
@@ -164,7 +164,7 @@ test_compareandwrite_miscompare(void)
logging(LOG_VERBOSE, "Read %d blocks at LBA:%" PRIu64
"they are still unchanged as 'A'",
i, num_blocks - i);
ret = read16(sd, num_blocks - i, i * block_size,
ret = read16(sd, NULL, num_blocks - i, i * block_size,
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -100,7 +100,7 @@ test_compareandwrite_simple(void)
logging(LOG_VERBOSE, "Read %d blocks at LBA:0 and verify "
"they are all 'B'", i);
ret = read16(sd, 0, i * block_size,
ret = read16(sd, NULL, 0, i * block_size,
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
@@ -158,7 +158,7 @@ test_compareandwrite_simple(void)
logging(LOG_VERBOSE, "Read %d blocks at LBA:%" PRIu64
" and verify they are all 'B'",
i, num_blocks - i);
ret = read16(sd, num_blocks - i, i * block_size,
ret = read16(sd, NULL, num_blocks - i, i * block_size,
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -61,7 +61,7 @@ test_mandatory_sbc(void)
if (sbc3_support) {
logging(LOG_VERBOSE, "Test READ16. the device claims SBC-3 support.");
ret = read16(sd, 0, block_size, block_size,
ret = read16(sd, NULL, 0, block_size, block_size,
0, 0, 0, 0, 0, NULL,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -79,13 +79,13 @@ test_nomedia_sbc(void)
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test READ12 when medium is ejected.");
ret = read12(sd, 0, block_size, block_size,
ret = read12(sd, NULL, 0, block_size, block_size,
0, 0, 0, 0, 0, NULL,
EXPECT_NO_MEDIUM);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test READ16 when medium is ejected.");
ret = read16(sd, 0, block_size, block_size,
ret = read16(sd, NULL, 0, block_size, block_size,
0, 0, 0, 0, 0, NULL,
EXPECT_NO_MEDIUM);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -114,7 +114,7 @@ test_orwrite_verify(void)
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Read %d blocks back", i);
ret = read16(sd, num_blocks - i, i * block_size,
ret = read16(sd, NULL, num_blocks - i, i * block_size,
block_size, 0, 0, 0, 0, 0, readbuf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
@@ -131,7 +131,7 @@ test_orwrite_verify(void)
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Read %d blocks back", i);
ret = read16(sd, num_blocks - i, i * block_size,
ret = read16(sd, NULL, num_blocks - i, i * block_size,
block_size, 0, 0, 0, 0, 0, readbuf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -30,7 +30,7 @@ test_read12_0blocks(void)
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test READ12 0-blocks at LBA==0");
ret = read12(sd, 0, 0, block_size,
ret = read12(sd, NULL, 0, 0, block_size,
0, 0, 0, 0, 0, NULL,
EXPECT_STATUS_GOOD);
if (ret == -2) {
@@ -46,21 +46,21 @@ test_read12_0blocks(void)
}
logging(LOG_VERBOSE, "Test READ12 0-blocks one block past end-of-LUN");
ret = read12(sd, num_blocks + 1, 0,
ret = read12(sd, NULL, num_blocks + 1, 0,
block_size, 0, 0, 0, 0, 0, NULL,
EXPECT_LBA_OOB);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test READ12 0-blocks at LBA==2^31");
ret = read12(sd, 0x80000000, 0, block_size,
ret = read12(sd, NULL, 0x80000000, 0, block_size,
0, 0, 0, 0, 0, NULL,
EXPECT_LBA_OOB);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test READ12 0-blocks at LBA==-1");
ret = read12(sd, -1, 0, block_size,
ret = read12(sd, NULL, -1, 0, block_size,
0, 0, 0, 0, 0, NULL,
EXPECT_LBA_OOB);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -40,7 +40,7 @@ test_read12_beyond_eol(void)
if (maximum_transfer_length && maximum_transfer_length < i) {
break;
}
ret = read12(sd, num_blocks + 1 - i,
ret = read12(sd, NULL, num_blocks + 1 - i,
i * block_size, block_size, 0, 0, 0, 0, 0, NULL,
EXPECT_LBA_OOB);
if (ret == -2) {
@@ -57,7 +57,7 @@ test_read12_beyond_eol(void)
if (maximum_transfer_length && maximum_transfer_length < i) {
break;
}
ret = read12(sd, 0x80000000,
ret = read12(sd, NULL, 0x80000000,
i * block_size, block_size, 0, 0, 0, 0, 0, NULL,
EXPECT_LBA_OOB);
CU_ASSERT_EQUAL(ret, 0);
@@ -69,7 +69,7 @@ test_read12_beyond_eol(void)
if (maximum_transfer_length && maximum_transfer_length < i) {
break;
}
ret = read12(sd, -1, i * block_size,
ret = read12(sd, NULL, -1, i * block_size,
block_size, 0, 0, 0, 0, 0, NULL,
EXPECT_LBA_OOB);
CU_ASSERT_EQUAL(ret, 0);
@@ -81,7 +81,7 @@ test_read12_beyond_eol(void)
if (maximum_transfer_length && maximum_transfer_length < i) {
break;
}
ret = read12(sd, num_blocks - 1,
ret = read12(sd, NULL, num_blocks - 1,
i * block_size, block_size, 0, 0, 0, 0, 0, NULL,
EXPECT_LBA_OOB);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -59,12 +59,12 @@ test_read12_dpofua(void)
logging(LOG_VERBOSE, "Test READ12 with DPO==1");
if (dpofua) {
ret = read12(sd, 0,
ret = read12(sd, NULL, 0,
block_size, block_size, 0, 1, 0, 0, 0, NULL,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
} else {
ret = read12(sd, 0,
ret = read12(sd, NULL, 0,
block_size, block_size, 0, 1, 0, 0, 0, NULL,
EXPECT_INVALID_FIELD_IN_CDB);
CU_ASSERT_EQUAL(ret, 0);
@@ -72,12 +72,12 @@ test_read12_dpofua(void)
logging(LOG_VERBOSE, "Test READ12 with FUA==1");
if (dpofua) {
ret = read12(sd, 0,
ret = read12(sd, NULL, 0,
block_size, block_size, 0, 0, 1, 0, 0, NULL,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
} else {
ret = read12(sd, 0,
ret = read12(sd, NULL, 0,
block_size, block_size, 0, 0, 1, 0, 0, NULL,
EXPECT_INVALID_FIELD_IN_CDB);
CU_ASSERT_EQUAL(ret, 0);
@@ -85,12 +85,12 @@ test_read12_dpofua(void)
logging(LOG_VERBOSE, "Test READ12 with DPO==1 FUA==1");
if (dpofua) {
ret = read12(sd, 0,
ret = read12(sd, NULL, 0,
block_size, block_size, 0, 1, 1, 0, 0, NULL,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
} else {
ret = read12(sd, 0,
ret = read12(sd, NULL, 0,
block_size, block_size, 0, 1, 1, 0, 0, NULL,
EXPECT_INVALID_FIELD_IN_CDB);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -41,7 +41,7 @@ test_read12_rdprotect(void)
if (!inq->protect || (rc16 != NULL && !rc16->prot_en)) {
logging(LOG_VERBOSE, "Device does not support/use protection information. All commands should fail.");
for (i = 1; i < 8; i++) {
ret = read12(sd, 0,
ret = read12(sd, NULL, 0,
block_size, block_size,
i, 0, 0, 0, 0, NULL,
EXPECT_INVALID_FIELD_IN_CDB);

View File

@@ -37,7 +37,7 @@ test_read12_simple(void)
if (maximum_transfer_length && maximum_transfer_length < i) {
break;
}
ret = read12(sd, 0, i * block_size,
ret = read12(sd, NULL, 0, i * block_size,
block_size, 0, 0, 0, 0, 0, NULL,
EXPECT_STATUS_GOOD);
if (ret == -2) {
@@ -54,7 +54,7 @@ test_read12_simple(void)
if (maximum_transfer_length && maximum_transfer_length < i) {
break;
}
ret = read12(sd, num_blocks - i,
ret = read12(sd, NULL, num_blocks - i,
i * block_size, block_size, 0, 0, 0, 0, 0, NULL,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -32,7 +32,7 @@ test_read16_0blocks(void)
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test READ16 0-blocks at LBA==0");
ret = read16(sd, 0, 0, block_size,
ret = read16(sd, NULL, 0, 0, block_size,
0, 0, 0, 0, 0, NULL,
EXPECT_STATUS_GOOD);
if (ret == -2) {
@@ -43,21 +43,21 @@ test_read16_0blocks(void)
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test READ16 0-blocks one block past end-of-LUN");
ret = read16(sd, num_blocks + 1, 0,
ret = read16(sd, NULL, num_blocks + 1, 0,
block_size, 0, 0, 0, 0, 0, NULL,
EXPECT_LBA_OOB);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test READ16 0-blocks at LBA==2^63");
ret = read16(sd, 0x8000000000000000ULL, 0,
ret = read16(sd, NULL, 0x8000000000000000ULL, 0,
block_size, 0, 0, 0, 0, 0, NULL,
EXPECT_LBA_OOB);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test READ16 0-blocks at LBA==-1");
ret = read16(sd, -1, 0, block_size,
ret = read16(sd, NULL, -1, 0, block_size,
0, 0, 0, 0, 0, NULL,
EXPECT_LBA_OOB);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -49,7 +49,7 @@ test_read16_beyond_eol(void)
break;
}
ret = read16(sd, num_blocks + 1 - i,
ret = read16(sd, NULL, num_blocks + 1 - i,
i * block_size, block_size, 0, 0, 0, 0, 0, NULL,
EXPECT_LBA_OOB);
if (ret == -2) {
@@ -66,7 +66,7 @@ test_read16_beyond_eol(void)
break;
}
ret = read16(sd, 0x8000000000000000ULL,
ret = read16(sd, NULL, 0x8000000000000000ULL,
i * block_size, block_size, 0, 0, 0, 0, 0, NULL,
EXPECT_LBA_OOB);
CU_ASSERT_EQUAL(ret, 0);
@@ -80,7 +80,7 @@ test_read16_beyond_eol(void)
break;
}
ret = read16(sd,
ret = read16(sd, NULL,
1ULL << (64 - ilog2(block_size)),
i * block_size, block_size, 0, 0, 0, 0, 0, NULL,
EXPECT_LBA_OOB);
@@ -95,7 +95,7 @@ test_read16_beyond_eol(void)
break;
}
ret = read16(sd,
ret = read16(sd, NULL,
1ULL << (63 - ilog2(block_size)),
i * block_size, block_size, 0, 0, 0, 0, 0, NULL,
EXPECT_LBA_OOB);
@@ -109,7 +109,7 @@ test_read16_beyond_eol(void)
break;
}
ret = read16(sd, -1, i * block_size,
ret = read16(sd, NULL, -1, i * block_size,
block_size, 0, 0, 0, 0, 0, NULL,
EXPECT_LBA_OOB);
CU_ASSERT_EQUAL(ret, 0);
@@ -122,7 +122,7 @@ test_read16_beyond_eol(void)
break;
}
ret = read16(sd, num_blocks - 1,
ret = read16(sd, NULL, num_blocks - 1,
i * block_size, block_size, 0, 0, 0, 0, 0, NULL,
EXPECT_LBA_OOB);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -59,12 +59,12 @@ test_read16_dpofua(void)
logging(LOG_VERBOSE, "Test READ16 with DPO==1");
if (dpofua) {
ret = read16(sd, 0,
ret = read16(sd, NULL, 0,
block_size, block_size, 0, 1, 0, 0, 0, NULL,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
} else {
ret = read16(sd, 0,
ret = read16(sd, NULL, 0,
block_size, block_size, 0, 1, 0, 0, 0, NULL,
EXPECT_INVALID_FIELD_IN_CDB);
CU_ASSERT_EQUAL(ret, 0);
@@ -72,12 +72,12 @@ test_read16_dpofua(void)
logging(LOG_VERBOSE, "Test READ16 with FUA==1");
if (dpofua) {
ret = read16(sd, 0,
ret = read16(sd, NULL, 0,
block_size, block_size, 0, 0, 1, 0, 0, NULL,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
} else {
ret = read16(sd, 0,
ret = read16(sd, NULL, 0,
block_size, block_size, 0, 0, 1, 0, 0, NULL,
EXPECT_INVALID_FIELD_IN_CDB);
CU_ASSERT_EQUAL(ret, 0);
@@ -85,12 +85,12 @@ test_read16_dpofua(void)
logging(LOG_VERBOSE, "Test READ16 with DPO==1 FUA==1");
if (dpofua) {
ret = read16(sd, 0,
ret = read16(sd, NULL, 0,
block_size, block_size, 0, 1, 1, 0, 0, NULL,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
} else {
ret = read16(sd, 0,
ret = read16(sd, NULL, 0,
block_size, block_size, 0, 1, 1, 0, 0, NULL,
EXPECT_INVALID_FIELD_IN_CDB);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -41,7 +41,7 @@ test_read16_rdprotect(void)
if (!inq->protect || (rc16 != NULL && !rc16->prot_en)) {
logging(LOG_VERBOSE, "Device does not support/use protection information. All commands should fail.");
for (i = 1; i < 8; i++) {
ret = read16(sd, 0,
ret = read16(sd, NULL, 0,
block_size, block_size,
i, 0, 0, 0, 0, NULL,
EXPECT_INVALID_FIELD_IN_CDB);

View File

@@ -39,7 +39,7 @@ test_read16_simple(void)
break;
}
ret = read16(sd, 0, i * block_size,
ret = read16(sd, NULL, 0, i * block_size,
block_size, 0, 0, 0, 0, 0, NULL,
EXPECT_STATUS_GOOD);
if (ret == -2) {
@@ -57,7 +57,7 @@ test_read16_simple(void)
break;
}
ret = read16(sd, num_blocks - i,
ret = read16(sd, NULL, num_blocks - i,
i * block_size, block_size, 0, 0, 0, 0, 0, NULL,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -209,7 +209,7 @@ check_lun_is_wiped(unsigned char *buf, uint64_t lba)
int ret;
unsigned char *rbuf = alloca(256 * block_size);
ret = read16(sd, lba, 256 * block_size,
ret = read16(sd, NULL, lba, 256 * block_size,
block_size, 0, 0, 0, 0, 0, rbuf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -118,7 +118,7 @@ check_lun_is_wiped(unsigned char *buf, uint64_t lba)
int ret;
unsigned char *rbuf = alloca(256 * block_size);
ret = read16(sd, lba, 256 * block_size,
ret = read16(sd, NULL, lba, 256 * block_size,
block_size, 0, 0, 0, 0, 0, rbuf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -46,7 +46,7 @@ check_lun_is_wiped(uint64_t lba, unsigned char c)
unsigned char *rbuf = alloca(256 * block_size);
unsigned char *zbuf = alloca(256 * block_size);
ret = read16(sd, lba, 256 * block_size,
ret = read16(sd, NULL, lba, 256 * block_size,
block_size, 0, 0, 0, 0, 0, rbuf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -106,7 +106,7 @@ test_sanitize_reset(void)
logging(LOG_VERBOSE, "Verify that READ16 fails with "
"SANITIZE_IN_PROGRESS");
ret = read16(sd, 0, block_size,
ret = read16(sd, NULL, 0, block_size,
block_size, 0, 0, 0, 0, 0, NULL,
EXPECT_SANITIZE);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -35,7 +35,7 @@ test_verify12_flags(void)
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test VERIFY12 flags");
ret = read12(sd, 0, block_size,
ret = read12(sd, NULL, 0, block_size,
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -40,7 +40,7 @@ test_verify12_mismatch(void)
if (maximum_transfer_length && maximum_transfer_length < i) {
break;
}
ret = read12(sd, 0, i * block_size,
ret = read12(sd, NULL, 0, i * block_size,
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
@@ -66,7 +66,7 @@ test_verify12_mismatch(void)
if (maximum_transfer_length && maximum_transfer_length < i) {
break;
}
ret = read12(sd, num_blocks - i,
ret = read12(sd, NULL, num_blocks - i,
i * block_size, block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -40,7 +40,7 @@ test_verify12_mismatch_no_cmp(void)
if (maximum_transfer_length && maximum_transfer_length < i) {
break;
}
ret = read12(sd, 0, i * block_size,
ret = read12(sd, NULL, 0, i * block_size,
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
@@ -66,7 +66,7 @@ test_verify12_mismatch_no_cmp(void)
if (maximum_transfer_length && maximum_transfer_length < i) {
break;
}
ret = read12(sd, num_blocks - i,
ret = read12(sd, NULL, num_blocks - i,
i * block_size, block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -59,7 +59,7 @@ test_verify12_simple(void)
if (maximum_transfer_length && maximum_transfer_length < i) {
break;
}
ret = read12(sd, num_blocks - i,
ret = read12(sd, NULL, num_blocks - i,
i * block_size, block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -35,7 +35,7 @@ test_verify16_flags(void)
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test VERIFY16 flags");
ret = read16(sd, 0, block_size,
ret = read16(sd, NULL, 0, block_size,
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);

View File

@@ -41,7 +41,7 @@ test_verify16_mismatch(void)
break;
}
ret = read16(sd, 0, i * block_size,
ret = read16(sd, NULL, 0, i * block_size,
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
@@ -68,7 +68,7 @@ test_verify16_mismatch(void)
break;
}
ret = read16(sd, num_blocks - i,
ret = read16(sd, NULL, num_blocks - i,
i * block_size, block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -41,7 +41,7 @@ test_verify16_mismatch_no_cmp(void)
break;
}
ret = read16(sd, 0, i * block_size,
ret = read16(sd, NULL, 0, i * block_size,
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
@@ -68,7 +68,7 @@ test_verify16_mismatch_no_cmp(void)
break;
}
ret = read16(sd, num_blocks - i,
ret = read16(sd, NULL, num_blocks - i,
i * block_size, block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -58,7 +58,7 @@ test_verify16_simple(void)
break;
}
ret = read16(sd, num_blocks - i,
ret = read16(sd, NULL, num_blocks - i,
i * block_size, block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -41,7 +41,7 @@ test_verify16_vrprotect(void)
if (!inq->protect || (rc16 != NULL && !rc16->prot_en)) {
logging(LOG_VERBOSE, "Device does not support/use protection information. All commands should fail.");
for (i = 1; i < 8; i++) {
ret = read16(sd, 0, block_size,
ret = read16(sd, NULL, 0, block_size,
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
ret = verify16(sd, 0, block_size,

View File

@@ -297,7 +297,7 @@ test_write12_residuals(void)
task = NULL;
logging(LOG_VERBOSE, "Read the two blocks");
ret = read12(sd, 0, 2* block_size,
ret = read12(sd, NULL, 0, 2* block_size,
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
@@ -373,7 +373,7 @@ test_write12_residuals(void)
task = NULL;
logging(LOG_VERBOSE, "Read the two blocks");
ret = read12(sd, 0, 2* block_size,
ret = read12(sd, NULL, 0, 2* block_size,
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -297,7 +297,7 @@ test_write16_residuals(void)
task = NULL;
logging(LOG_VERBOSE, "Read the two blocks");
ret = read16(sd, 0, 2* block_size,
ret = read16(sd, NULL, 0, 2* block_size,
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
@@ -373,7 +373,7 @@ test_write16_residuals(void)
task = NULL;
logging(LOG_VERBOSE, "Read the two blocks");
ret = read16(sd, 0, 2* block_size,
ret = read16(sd, NULL, 0, 2* block_size,
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -80,7 +80,7 @@ test_writesame16_unmap(void)
"blocks back and verify they are all zero");
logging(LOG_VERBOSE, "Read %d blocks and verify they "
"are now zero", i);
ret = read16(sd, 0,
ret = read16(sd, NULL, 0,
i * block_size, block_size,
0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
@@ -113,7 +113,7 @@ test_writesame16_unmap(void)
"blocks back and verify they are all zero");
logging(LOG_VERBOSE, "Read %d blocks and verify they "
"are now zero", i);
ret = read16(sd, num_blocks - i,
ret = read16(sd, NULL, num_blocks - i,
i * block_size, block_size,
0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
@@ -184,7 +184,7 @@ test_writesame16_unmap(void)
logging(LOG_VERBOSE, "Read %d blocks and verify they "
"are now zero", i);
ret = read16(sd, 0,
ret = read16(sd, NULL, 0,
i * block_size, block_size,
0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
@@ -234,7 +234,7 @@ test_writesame16_unmap(void)
logging(LOG_VERBOSE, "Read %d blocks and verify they "
"are now zero", i);
ret = read16(sd, 0,
ret = read16(sd, NULL, 0,
i * block_size, block_size,
0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);

View File

@@ -75,7 +75,7 @@ test_writesame16_unmap_until_end(void)
logging(LOG_VERBOSE, "Read %d blocks and verify they "
"are now zero", i);
ret = read16(sd, num_blocks - i,
ret = read16(sd, NULL, num_blocks - i,
i * block_size, block_size,
0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);

View File

@@ -307,7 +307,7 @@ test_writeverify12_residuals(void)
task = NULL;
logging(LOG_VERBOSE, "Read the two blocks");
ret = read12(sd, 0, 2* block_size,
ret = read12(sd, NULL, 0, 2* block_size,
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
@@ -383,7 +383,7 @@ test_writeverify12_residuals(void)
task = NULL;
logging(LOG_VERBOSE, "Read the two blocks");
ret = read12(sd, 0, 2* block_size,
ret = read12(sd, NULL, 0, 2* block_size,
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -316,7 +316,7 @@ test_writeverify16_residuals(void)
task = NULL;
logging(LOG_VERBOSE, "Read the two blocks");
ret = read16(sd, 0, 2* block_size,
ret = read16(sd, NULL, 0, 2* block_size,
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
@@ -392,7 +392,7 @@ test_writeverify16_residuals(void)
task = NULL;
logging(LOG_VERBOSE, "Read the two blocks");
ret = read16(sd, 0, 2* block_size,
ret = read16(sd, NULL, 0, 2* block_size,
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);