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: Seth Howell <seth.howell@intel.com> Reviewed-on: https://review.gerrithub.io/396051 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
53c24913f2
commit
4151703690
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user