Commit 8e496c51 authored by paul luse's avatar paul luse Committed by Ben Walker
Browse files

lib/idxd: add unit test for spdk_idxd_set_config()



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


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent f603c272
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@

#include "spdk_cunit.h"
#include "spdk_internal/mock.h"
#include "spdk_internal/idxd.h"
#include "common/lib/test_env.c"
#include "idxd/idxd.c"

@@ -80,6 +81,18 @@ mock_movdir64b(void *dst, const void *src)
	return;
}

static int
test_spdk_idxd_set_config(void)
{

	g_dev_cfg = NULL;
	spdk_idxd_set_config(0);
	SPDK_CU_ASSERT_FATAL(g_dev_cfg != NULL);
	CU_ASSERT(memcmp(&g_dev_cfg0, g_dev_cfg, sizeof(struct device_config)) == 0);

	return 0;
}

static int
test_spdk_idxd_reconfigure_chan(void)
{
@@ -103,7 +116,6 @@ test_spdk_idxd_reconfigure_chan(void)
	return 0;
}


int main(int argc, char **argv)
{
	CU_pSuite	suite = NULL;
@@ -115,6 +127,7 @@ int main(int argc, char **argv)
	suite = CU_add_suite("idxd", NULL, NULL);

	CU_ADD_TEST(suite, test_spdk_idxd_reconfigure_chan);
	CU_ADD_TEST(suite, test_spdk_idxd_set_config);

	CU_basic_set_mode(CU_BRM_VERBOSE);
	CU_basic_run_tests();