diff options
-rw-r--r-- | test/unit-tests.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/unit-tests.c b/test/unit-tests.c index 1902c6a..7f3e924 100644 --- a/test/unit-tests.c +++ b/test/unit-tests.c @@ -528,6 +528,18 @@ test_setup_migration_callbacks(void **state) int r = vfu_setup_device_migration_callbacks(p->v, 0, &p->c); assert_int_equal(0, r); assert_non_null(p->v->migration); + assert_int_equal(p->v->migration->state, VFIO_DEVICE_STATE_RUNNING); +} + +static void +test_setup_migration_callbacks_resuming(void **state) +{ + struct test_setup_migr_reg_dat *p = *state; + int r = vfu_setup_device_migration_callbacks(p->v, + LIBVFIO_USER_MIG_FLAG_START_RESUMING, &p->c); + assert_int_equal(0, r); + assert_non_null(p->v->migration); + assert_int_equal(p->v->migration->state, VFIO_DEVICE_STATE_RESUMING); } static void @@ -809,6 +821,9 @@ main(void) cmocka_unit_test_setup_teardown(test_setup_migration_callbacks, setup_test_setup_migration, teardown_test_setup_migration), + cmocka_unit_test_setup_teardown(test_setup_migration_callbacks_resuming, + setup_test_setup_migration, + teardown_test_setup_migration), cmocka_unit_test_setup_teardown(test_handle_device_state, setup_test_setup_migration, teardown_test_setup_migration), |