diff --git a/test-tool/iscsi-support.h b/test-tool/iscsi-support.h index 3830f9e..b301b6f 100644 --- a/test-tool/iscsi-support.h +++ b/test-tool/iscsi-support.h @@ -418,7 +418,7 @@ do { \ } while (0); #define RECEIVE_COPY_RESULTS(...) \ - do { \ + ({ \ int _r; \ _r = receive_copy_results(__VA_ARGS__); \ if (_r == -2) { \ @@ -429,7 +429,8 @@ do { \ return; \ } \ CU_ASSERT_EQUAL(_r, 0); \ - } while (0); + _r; \ + }) #define RELEASE6(...) \ do { \ diff --git a/test-tool/test_receive_copy_results_op_params.c b/test-tool/test_receive_copy_results_op_params.c index 2ee0b99..6d1e76a 100644 --- a/test-tool/test_receive_copy_results_op_params.c +++ b/test-tool/test_receive_copy_results_op_params.c @@ -32,14 +32,16 @@ test_receive_copy_results_op_params(void) { struct scsi_task *op_task = NULL; struct scsi_copy_results_op_params *opp; + int ret; logging(LOG_VERBOSE, LOG_BLANK_LINE); logging(LOG_VERBOSE, "Test RECEIVE COPY RESULTS, OPERATING PARAMS"); - RECEIVE_COPY_RESULTS(&op_task, sd, SCSI_COPY_RESULTS_OP_PARAMS, 0, - (void **)&opp, EXPECT_STATUS_GOOD); + ret = RECEIVE_COPY_RESULTS(&op_task, sd, SCSI_COPY_RESULTS_OP_PARAMS, 0, + (void **)&opp, EXPECT_STATUS_GOOD); - logging(LOG_NORMAL, + if (ret == 0) + logging(LOG_NORMAL, "max_target_desc=%d, max_seg_desc=%d", opp->max_target_desc_count, opp->max_segment_desc_count);