Commit c26697bf authored by Slawomir Ptak's avatar Slawomir Ptak Committed by Konrad Sztyber
Browse files

bdev_ut: Comparison operator and tests fixes



Operator fix and fixes for num blocks in the I/O split tests,
to match the expected and requested values.

Change-Id: I67c7211c5f8cae409d078baaefbeb8851ed71f48
Signed-off-by: default avatarSlawomir Ptak <slawomir.ptak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/25199


Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAlliswell <hisunzhenliang@outlook.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
parent 75a12cbf
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -326,7 +326,7 @@ stub_submit_request(struct spdk_io_channel *_ch, struct spdk_bdev_io *bdev_io)
	}

	CU_ASSERT(expected_io->offset == bdev_io->u.bdev.offset_blocks);
	CU_ASSERT(expected_io->length = bdev_io->u.bdev.num_blocks);
	CU_ASSERT(expected_io->length == bdev_io->u.bdev.num_blocks);
	if (expected_io->type == SPDK_BDEV_IO_TYPE_COPY) {
		CU_ASSERT(expected_io->src_offset == bdev_io->u.bdev.copy.src_offset_blocks);
	}
@@ -2005,7 +2005,7 @@ bdev_io_boundary_split_test(void)
	 * 0x4200 bytes for the IO.
	 */
	expected_io = ut_alloc_expected_io(SPDK_BDEV_IO_TYPE_READ, SPDK_BDEV_IO_NUM_CHILD_IOV,
					   SPDK_BDEV_IO_NUM_CHILD_IOV, 2);
					   1, 2);
	/* position 30 picked up the remaining bytes to the next boundary */
	ut_expected_io_set_iov(expected_io, 0,
			       (void *)(iov[SPDK_BDEV_IO_NUM_CHILD_IOV - 2].iov_base + 0x1e4), 0x2e);
@@ -2566,7 +2566,7 @@ bdev_io_max_size_and_segment_split_test(void)
	expected_io = ut_alloc_expected_io(SPDK_BDEV_IO_TYPE_FLUSH, 15, 4, 0);
	TAILQ_INSERT_TAIL(&g_bdev_ut_channel->expected_io, expected_io, link);

	rc = spdk_bdev_flush_blocks(desc, io_ch, 15, 2, io_done, NULL);
	rc = spdk_bdev_flush_blocks(desc, io_ch, 15, 4, io_done, NULL);
	CU_ASSERT(rc == 0);
	CU_ASSERT(g_io_done == false);
	CU_ASSERT(g_bdev_ut_channel->outstanding_io_count == 1);