test_read6_beyond_eol: Fix an assertion failure

Avoid that running the regression tests against a LUN with size zero triggers
the following assertion failure:

lt-iscsi-test-cu: iscsi-support.c:1666: read6: Assertion `task != ((void *)0)' failed.
Aborted

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
This commit is contained in:
Bart Van Assche
2015-10-02 14:25:29 -07:00
committed by Ronnie Sahlberg
parent 393165d66a
commit 5231923bc8
2 changed files with 6 additions and 2 deletions

View File

@@ -54,7 +54,7 @@ test_read6_simple(void)
if (num_blocks > 0x200000) {
CU_PASS("LUN is too big for read-at-eol tests with READ6. Skipping test.\n");
} else {
for (i = 1; i <= 255; i++) {
for (i = 1; i <= 255 && i + 0U <= num_blocks; i++) {
if (maximum_transfer_length && maximum_transfer_length < i) {
break;
}