test/scsi: fix dev.c unit tests

These broke due to a conflicting merge that wasn't
found until both were committed to master.

Fixes 3b3c6002c9.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia0fc045a1e5d46cc42e5b4ec985bf1ade4417d85

Reviewed-on: https://review.gerrithub.io/395173
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Jim Harris 2018-01-17 13:20:48 -07:00 committed by Ben Walker
parent 23593aa951
commit e3d083f8d5

View File

@ -173,12 +173,12 @@ static void
dev_destruct_success(void)
{
struct spdk_scsi_dev dev = { .is_allocated = 1 };
struct spdk_scsi_lun *lun;
lun = calloc(1, sizeof(struct spdk_scsi_lun));
int rc;
/* dev with a single lun */
spdk_scsi_dev_add_lun(&dev, lun, 0);
rc = spdk_scsi_dev_add_lun(&dev, "malloc0", 0, NULL, NULL);
CU_ASSERT(rc == 0);
/* free the dev */
spdk_scsi_dev_destruct(&dev);
@ -563,12 +563,7 @@ static void
dev_add_lun_success1(void)
{
int rc;
int i;
struct spdk_scsi_dev dev;
for (i = 0; i < SPDK_SCSI_DEV_MAX_LUN; i++) {
dev.lun[i] = NULL;
}
struct spdk_scsi_dev dev = {0};
rc = spdk_scsi_dev_add_lun(&dev, "malloc0", -1, NULL, NULL);
@ -581,12 +576,7 @@ static void
dev_add_lun_success2(void)
{
int rc;
int i;
struct spdk_scsi_dev dev;
for (i = 0; i < SPDK_SCSI_DEV_MAX_LUN; i++) {
dev.lun[i] = NULL;
}
struct spdk_scsi_dev dev = {0};
rc = spdk_scsi_dev_add_lun(&dev, "malloc0", 0, NULL, NULL);