From 649a585f2f5323379d50ca67597432fcefa43b69 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Mon, 1 Oct 2018 12:18:30 -0700 Subject: [PATCH] test/reduce: rename init() unit test to init_failure() There are now other unit tests which exercise the success path. Signed-off-by: Jim Harris Change-Id: I601395aff7d3c5e88bdcf2986a25e71b0e2f5d39 Reviewed-on: https://review.gerrithub.io/432500 Chandler-Test-Pool: SPDK Automated Test System Tested-by: SPDK CI Jenkins Reviewed-by: Changpeng Liu Reviewed-by: Shuhei Matsumoto Reviewed-by: Ben Walker --- test/unit/lib/reduce/reduce.c/reduce_ut.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/test/unit/lib/reduce/reduce.c/reduce_ut.c b/test/unit/lib/reduce/reduce.c/reduce_ut.c index a8e2aae62..f5ad02981 100644 --- a/test/unit/lib/reduce/reduce.c/reduce_ut.c +++ b/test/unit/lib/reduce/reduce.c/reduce_ut.c @@ -195,7 +195,7 @@ unload_cb(void *cb_arg, int ziperrno) } static void -init(void) +init_failure(void) { struct spdk_reduce_vol_params params = {}; struct spdk_reduce_backing_dev backing_dev = {}; @@ -236,21 +236,7 @@ init(void) CU_ASSERT(g_ziperrno == -EINVAL); SPDK_CU_ASSERT_FATAL(g_vol == NULL); - /* Now specify a uuid. spdk_reduce_vol_init() should then pass. */ - spdk_uuid_generate(¶ms.uuid); - - g_vol = NULL; - g_ziperrno = -1; - spdk_reduce_vol_init(¶ms, &backing_dev, &pm_file, init_cb, NULL); - CU_ASSERT(g_ziperrno == 0); - SPDK_CU_ASSERT_FATAL(g_vol != NULL); - CU_ASSERT(spdk_uuid_compare(¶ms.uuid, &g_vol->uuid) == 0); - - g_ziperrno = -1; - spdk_reduce_vol_unload(g_vol, unload_cb, NULL); - CU_ASSERT(g_ziperrno == 0); - CU_ASSERT(g_volatile_pm_buf == NULL); - + pm_file_close(&pm_file); pm_file_destroy(); } @@ -309,7 +295,7 @@ main(int argc, char **argv) if ( CU_add_test(suite, "get_pm_file_size", get_pm_file_size) == NULL || CU_add_test(suite, "get_backing_device_size", get_backing_device_size) == NULL || - CU_add_test(suite, "init", init) == NULL || + CU_add_test(suite, "init_failure", init_failure) == NULL || CU_add_test(suite, "init_md", init_md) == NULL ) { CU_cleanup_registry();