Commit 41517036 authored by Seth Howell's avatar Seth Howell Committed by Jim Harris
Browse files

test/nvmf: add null pointer check to subsystem test



Fedora 27 ships with Clang 5 which throws an erroneous error in the
add_ns subsystem test. It believes that subsystem.ns is a null pointer.
In order to circumvent this error, I add an assert to bail out of the
test if the pointer really is null and then only execute the final
assert if the pointer is not null. This way our tests will still pass
Scan-build tests on Fedora27.

Change-Id: I54d3fae485d56033ba5eb23b0aa323480ae6a6e4
Signed-off-by: default avatarSeth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/396051


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 53c24913
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -210,6 +210,7 @@ test_spdk_nvmf_subsystem_add_ns(void)
	/* NSID 1 is the first unused ID */
	CU_ASSERT(nsid == 1);
	CU_ASSERT(subsystem.max_nsid == 1);
	SPDK_CU_ASSERT_FATAL(subsystem.ns != NULL);
	CU_ASSERT(subsystem.ns[nsid - 1].bdev == &bdev1);

	/* Request a specific NSID */