test/unit/bdev: mock out thread for tests.
This thread is needed in any context when we send a message. Change-Id: Ifcb5e3bf2e6ee60385b425a976ed380228570ae6 Signed-off-by: Seth Howell <seth.howell@intel.com> Reviewed-on: https://review.gerrithub.io/406427 Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
46fee78e20
commit
7a0375f672
@ -55,6 +55,12 @@ spdk_conf_section_get_nmval(struct spdk_conf_section *sp, const char *key, int i
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_bdev_send_msg(spdk_thread_fn fn, void *ctx, void *thread_ctx)
|
||||
{
|
||||
fn(ctx);
|
||||
}
|
||||
|
||||
void
|
||||
spdk_scsi_nvme_translate(const struct spdk_bdev_io *bdev_io,
|
||||
int *sc, int *sk, int *asc, int *ascq)
|
||||
@ -543,9 +549,11 @@ main(int argc, char **argv)
|
||||
return CU_get_error();
|
||||
}
|
||||
|
||||
spdk_allocate_thread(_bdev_send_msg, NULL, NULL, NULL, "thread0");
|
||||
CU_basic_set_mode(CU_BRM_VERBOSE);
|
||||
CU_basic_run_tests();
|
||||
num_failures = CU_get_number_of_failures();
|
||||
CU_cleanup_registry();
|
||||
spdk_free_thread();
|
||||
return num_failures;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user