test/accel: add UT for _is_batch_valid()
Signed-off-by: paul luse <paul.e.luse@intel.com> Change-Id: Ifd9197c6a9941b3643c902cbf2f1ca670b455bd5 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6357 Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot
This commit is contained in:
parent
598eda5d78
commit
8dc056bc71
@ -196,6 +196,24 @@ test_spdk_accel_get_capabilities(void)
|
||||
free(ch);
|
||||
}
|
||||
|
||||
static void
|
||||
test_is_batch_valid(void)
|
||||
{
|
||||
struct spdk_accel_batch batch = {};
|
||||
struct accel_io_channel accel_ch = {};
|
||||
bool rc;
|
||||
|
||||
/* This batch doesn't go with this channel. */
|
||||
batch.accel_ch = (struct accel_io_channel *)0xDEADBEEF;
|
||||
rc = _is_batch_valid(&batch, &accel_ch);
|
||||
CU_ASSERT(rc == false);
|
||||
|
||||
/* This one does. */
|
||||
batch.accel_ch = &accel_ch;
|
||||
rc = _is_batch_valid(&batch, &accel_ch);
|
||||
CU_ASSERT(rc == true);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
CU_pSuite suite = NULL;
|
||||
@ -212,6 +230,7 @@ int main(int argc, char **argv)
|
||||
CU_ADD_TEST(suite, test_is_supported);
|
||||
CU_ADD_TEST(suite, test_spdk_accel_task_complete);
|
||||
CU_ADD_TEST(suite, test_spdk_accel_get_capabilities);
|
||||
CU_ADD_TEST(suite, test_is_batch_valid);
|
||||
|
||||
CU_basic_set_mode(CU_BRM_VERBOSE);
|
||||
CU_basic_run_tests();
|
||||
|
Loading…
Reference in New Issue
Block a user