test/unit: remove more scan-build errors

Change-Id: Ia0f304c20d736cebd43b29337e7c6f8918cff7ef
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/418235
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Seth Howell 2018-07-06 16:14:25 -07:00 committed by Daniel Verkamp
parent a0246f6553
commit df8cbd66c7
2 changed files with 13 additions and 7 deletions

View File

@ -224,7 +224,7 @@ maxburstlength_test(void)
rc = spdk_iscsi_execute(&conn, data_out_pdu);
CU_ASSERT(rc == SPDK_ISCSI_CONNECTION_FATAL);
CU_ASSERT(response_pdu->task != NULL);
SPDK_CU_ASSERT_FATAL(response_pdu->task != NULL);
spdk_iscsi_task_disassociate_pdu(response_pdu->task);
spdk_iscsi_task_put(response_pdu->task);
spdk_put_pdu(response_pdu);

View File

@ -170,7 +170,7 @@ parse_portal_ipv4_normal_case(void)
const char *host_str = "192.168.2.0";
const char *port_str = "3260";
struct spdk_cpuset *cpumask_val;
struct spdk_iscsi_portal *p;
struct spdk_iscsi_portal *p = NULL;
int rc;
cpumask_val = spdk_cpuset_alloc();
@ -180,6 +180,7 @@ parse_portal_ipv4_normal_case(void)
rc = spdk_iscsi_parse_portal(string, &p, 0);
CU_ASSERT(rc == 0);
SPDK_CU_ASSERT_FATAL(p != NULL);
CU_ASSERT(strcmp(p->host, host_str) == 0);
CU_ASSERT(strcmp(p->port, port_str) == 0);
CU_ASSERT(spdk_cpuset_equal(p->cpumask, cpumask_val));
@ -197,7 +198,7 @@ parse_portal_ipv6_normal_case(void)
const char *host_str = "[2001:ad6:1234::]";
const char *port_str = "3260";
struct spdk_cpuset *cpumask_val;
struct spdk_iscsi_portal *p;
struct spdk_iscsi_portal *p = NULL;
int rc;
cpumask_val = spdk_cpuset_alloc();
@ -207,6 +208,7 @@ parse_portal_ipv6_normal_case(void)
rc = spdk_iscsi_parse_portal(string, &p, 0);
CU_ASSERT(rc == 0);
SPDK_CU_ASSERT_FATAL(p != NULL);
CU_ASSERT(strcmp(p->host, host_str) == 0);
CU_ASSERT(strcmp(p->port, port_str) == 0);
CU_ASSERT(spdk_cpuset_equal(p->cpumask, cpumask_val));
@ -224,13 +226,14 @@ parse_portal_ipv4_skip_cpumask_case(void)
const char *host_str = "192.168.2.0";
const char *port_str = "3260";
struct spdk_cpuset *cpumask_val;
struct spdk_iscsi_portal *p;
struct spdk_iscsi_portal *p = NULL;
int rc;
cpumask_val = spdk_app_get_core_mask();
rc = spdk_iscsi_parse_portal(string, &p, 0);
CU_ASSERT(rc == 0);
SPDK_CU_ASSERT_FATAL(p != NULL);
CU_ASSERT(strcmp(p->host, host_str) == 0);
CU_ASSERT(strcmp(p->port, port_str) == 0);
CU_ASSERT(spdk_cpuset_equal(p->cpumask, cpumask_val));
@ -246,13 +249,14 @@ parse_portal_ipv6_skip_cpumask_case(void)
const char *host_str = "[2001:ad6:1234::]";
const char *port_str = "3260";
struct spdk_cpuset *cpumask_val;
struct spdk_iscsi_portal *p;
struct spdk_iscsi_portal *p = NULL;
int rc;
cpumask_val = spdk_app_get_core_mask();
rc = spdk_iscsi_parse_portal(string, &p, 0);
CU_ASSERT(rc == 0);
SPDK_CU_ASSERT_FATAL(p != NULL);
CU_ASSERT(strcmp(p->host, host_str) == 0);
CU_ASSERT(strcmp(p->port, port_str) == 0);
CU_ASSERT(spdk_cpuset_equal(p->cpumask, cpumask_val));
@ -268,13 +272,14 @@ parse_portal_ipv4_skip_port_and_cpumask_case(void)
const char *host_str = "192.168.2.0";
const char *port_str = "3260";
struct spdk_cpuset *cpumask_val;
struct spdk_iscsi_portal *p;
struct spdk_iscsi_portal *p = NULL;
int rc;
cpumask_val = spdk_app_get_core_mask();
rc = spdk_iscsi_parse_portal(string, &p, 0);
CU_ASSERT(rc == 0);
SPDK_CU_ASSERT_FATAL(p != NULL);
CU_ASSERT(strcmp(p->host, host_str) == 0);
CU_ASSERT(strcmp(p->port, port_str) == 0);
CU_ASSERT(spdk_cpuset_equal(p->cpumask, cpumask_val));
@ -290,13 +295,14 @@ parse_portal_ipv6_skip_port_and_cpumask_case(void)
const char *host_str = "[2001:ad6:1234::]";
const char *port_str = "3260";
struct spdk_cpuset *cpumask_val;
struct spdk_iscsi_portal *p;
struct spdk_iscsi_portal *p = NULL;
int rc;
cpumask_val = spdk_app_get_core_mask();
rc = spdk_iscsi_parse_portal(string, &p, 0);
CU_ASSERT(rc == 0);
SPDK_CU_ASSERT_FATAL(p != NULL);
CU_ASSERT(strcmp(p->host, host_str) == 0);
CU_ASSERT(strcmp(p->port, port_str) == 0);
CU_ASSERT(spdk_cpuset_equal(p->cpumask, cpumask_val));