test/unit/part: mock out thread for tests.
Change-Id: I2f2a4aeb01dfbe434fd100a7a52664bb783a3a87 Signed-off-by: Seth Howell <seth.howell@intel.com> Reviewed-on: https://review.gerrithub.io/406428 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
7a0375f672
commit
ecd5f65138
@ -56,6 +56,12 @@ spdk_conf_section_get_nmval(struct spdk_conf_section *sp, const char *key, int i
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_part_send_msg(spdk_thread_fn fn, void *ctx, void *thread_ctx)
|
||||||
|
{
|
||||||
|
fn(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
spdk_scsi_nvme_translate(const struct spdk_bdev_io *bdev_io,
|
spdk_scsi_nvme_translate(const struct spdk_bdev_io *bdev_io,
|
||||||
int *sc, int *sk, int *asc, int *ascq)
|
int *sc, int *sk, int *asc, int *ascq)
|
||||||
@ -160,9 +166,11 @@ main(int argc, char **argv)
|
|||||||
return CU_get_error();
|
return CU_get_error();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
spdk_allocate_thread(_part_send_msg, NULL, NULL, NULL, "thread0");
|
||||||
CU_basic_set_mode(CU_BRM_VERBOSE);
|
CU_basic_set_mode(CU_BRM_VERBOSE);
|
||||||
CU_basic_run_tests();
|
CU_basic_run_tests();
|
||||||
num_failures = CU_get_number_of_failures();
|
num_failures = CU_get_number_of_failures();
|
||||||
CU_cleanup_registry();
|
CU_cleanup_registry();
|
||||||
|
spdk_free_thread();
|
||||||
return num_failures;
|
return num_failures;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user