Commit b28aa25e authored by paul luse's avatar paul luse Committed by Changpeng Liu
Browse files

ut/compress: remove extra success test case



By moving the success test case to the end we avoid the scan-build
issue however the last test case was already testing success so just
udpated the comment and free the memory at the end.

Fixes issue #933

Change-Id: I0ca81f240d3af32c414b0c886fda5b14ba37e490
Signed-off-by: default avatarpaul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467302


Reviewed-by: default avataryidong0635 <dongx.yi@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 03578a3d
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -782,12 +782,6 @@ test_initdrivers(void)
	/* This is not an error condition, we already have one */
	CU_ASSERT(rc == 0);

	/* success */
	MOCK_SET(rte_vdev_init, 0);
	rc = vbdev_init_compress_drivers();
	CU_ASSERT(rc == 0);
	spdk_mempool_free((struct spdk_mempool *)g_mbuf_mp);

	/* error */
	MOCK_SET(rte_vdev_init, -2);
	rc = vbdev_init_compress_drivers();
@@ -848,11 +842,11 @@ test_initdrivers(void)
	rc = vbdev_init_compress_drivers();
	CU_ASSERT(rc == -2);

	/* rte_compressdev_private_xform_create()succeeds */
	ut_rte_compressdev_start = 0;
	/* success */
	ut_rte_compressdev_private_xform_create = 0;
	rc = vbdev_init_compress_drivers();
	CU_ASSERT(rc == 0);
	spdk_mempool_free((struct spdk_mempool *)g_mbuf_mp);
}

static void