Commit 93c98686 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

test/io_channel: use SPDK_CU_ASSERT_FATAL for NULL checks



The test can't continue if a NULL pointer would be dereferenced.

Change-Id: If857057c69679de3be08c4605d15bc2b3892210a
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent a8cfc54e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -112,13 +112,13 @@ channel(void)
	g_create_cb_calls = 0;
	ch1 = spdk_get_io_channel(&device1, SPDK_IO_PRIORITY_DEFAULT);
	CU_ASSERT(g_create_cb_calls == 1);
	CU_ASSERT(ch1 != NULL);
	SPDK_CU_ASSERT_FATAL(ch1 != NULL);

	g_create_cb_calls = 0;
	ch2 = spdk_get_io_channel(&device1, SPDK_IO_PRIORITY_DEFAULT);
	CU_ASSERT(g_create_cb_calls == 0);
	CU_ASSERT(ch1 == ch2);
	CU_ASSERT(ch2 != NULL);
	SPDK_CU_ASSERT_FATAL(ch2 != NULL);

	g_destroy_cb_calls = 0;
	spdk_put_io_channel(ch2);
@@ -128,7 +128,7 @@ channel(void)
	ch2 = spdk_get_io_channel(&device2, SPDK_IO_PRIORITY_DEFAULT);
	CU_ASSERT(g_create_cb_calls == 1);
	CU_ASSERT(ch1 != ch2);
	CU_ASSERT(ch2 != NULL);
	SPDK_CU_ASSERT_FATAL(ch2 != NULL);

	ctx = spdk_io_channel_get_ctx(ch2);
	CU_ASSERT(*(uint64_t *)ctx == ctx2);