Commit c2721e8e authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

test/log: verify that log facility is not NULL



Make the static analyzer happy.

Change-Id: I431b98af167d268f7e91c1f6d507c2c19d10ae25
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent b2340985
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
APP = log_ut

C_SRCS := log_ut.c
CFLAGS += -I$(SPDK_ROOT_DIR)/test
CFLAGS += -I$(SPDK_ROOT_DIR)/lib/log

LIBS += $(SPDK_LIBS) -lcunit
+3 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@
#include <errno.h>
#include <stdio.h>

#include "CUnit/Basic.h"
#include "spdk_cunit.h"
#include "spdk/log.h"

#include "log.c"
@@ -56,9 +56,11 @@ log_test(void)

	spdk_g_log_facility = -1;
	buf = spdk_get_log_facility();
	SPDK_CU_ASSERT_FATAL(buf != NULL);
	CU_ASSERT_STRING_EQUAL(buf, "daemon");
	spdk_g_log_facility = LOG_LOCAL7;
	buf = spdk_get_log_facility();
	SPDK_CU_ASSERT_FATAL(buf != NULL);
	CU_ASSERT_STRING_EQUAL(buf, "local7");

	rc = spdk_set_log_priority("test");