test/unit: Fix scan-build errors in thread and util tests

thread_ut.c: ensure that the channel context is non-null
util: get rid of a couple of uninitialized value errors.

Change-Id: Idbaad4efea14acd7ae8f98b60aa514e45213a134
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/424124
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Seth Howell 2018-08-30 11:23:27 -07:00 committed by Jim Harris
parent 95d97eb965
commit c0297f9c71
3 changed files with 3 additions and 2 deletions

View File

@ -280,6 +280,7 @@ unreg_ch_done(struct spdk_io_channel_iter *i)
ctx->ch_done = true;
SPDK_CU_ASSERT_FATAL(i->cur_thread != NULL);
spdk_for_each_channel_continue(i, 0);
}

View File

@ -192,7 +192,7 @@ test_base64_urlsafe_decode(void)
{
char raw_buf[100];
void *raw = (void *)raw_buf;
size_t raw_len;
size_t raw_len = 0;
int ret;
ret = spdk_base64_urlsafe_decode(raw, &raw_len, text_A);

View File

@ -142,7 +142,7 @@ test_parse_capacity(void)
char str[128];
uint64_t cap;
int rc;
bool has_prefix;
bool has_prefix = true;
rc = spdk_parse_capacity("472", &cap, &has_prefix);
CU_ASSERT(rc == 0);