diff options
Diffstat (limited to 'test/unit-tests.c')
-rw-r--r-- | test/unit-tests.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/test/unit-tests.c b/test/unit-tests.c index cac4445..2d42f6f 100644 --- a/test/unit-tests.c +++ b/test/unit-tests.c @@ -572,18 +572,18 @@ test_setup_sparse_region(void **state UNUSED) /* invalid mappable settings */ ret = vfu_setup_region(&vfu_ctx, VFU_PCI_DEV_BAR0_REGION_IDX, - 0x2000, NULL, 0, mmap_areas, 2, -1); + 0x2000, NULL, 0, mmap_areas, 2, -1, 0); assert_int_equal(-1, ret); assert_int_equal(EINVAL, errno); ret = vfu_setup_region(&vfu_ctx, VFU_PCI_DEV_BAR0_REGION_IDX, - 0x2000, NULL, 0, mmap_areas, 0, 1); + 0x2000, NULL, 0, mmap_areas, 0, 1, 0); assert_int_equal(-1, ret); assert_int_equal(EINVAL, errno); /* default mmap area if not given */ ret = vfu_setup_region(&vfu_ctx, VFU_PCI_DEV_BAR0_REGION_IDX, - 0x2000, NULL, 0, NULL, 0, 1); + 0x2000, NULL, 0, NULL, 0, 1, 0); assert_int_equal(0, ret); free(reg_info.mmap_areas); @@ -591,14 +591,14 @@ test_setup_sparse_region(void **state UNUSED) /* sparse region exceeds region size */ mmap_areas[1].iov_len = 0x1001; ret = vfu_setup_region(&vfu_ctx, VFU_PCI_DEV_BAR0_REGION_IDX, - 0x2000, NULL, 0, mmap_areas, 2, 0); + 0x2000, NULL, 0, mmap_areas, 2, 0, 0); assert_int_equal(-1, ret); assert_int_equal(EINVAL, errno); /* sparse region within region size */ mmap_areas[1].iov_len = 0x1000; ret = vfu_setup_region(&vfu_ctx, VFU_PCI_DEV_BAR0_REGION_IDX, - 0x2000, NULL, 0, mmap_areas, 2, 0); + 0x2000, NULL, 0, mmap_areas, 2, 0, 0); assert_int_equal(0, ret); free(reg_info.mmap_areas); @@ -960,7 +960,7 @@ test_setup_migration_region_too_small(void **state) vfu_ctx_t *v = get_vfu_ctx(state); int r = vfu_setup_region(v, VFU_PCI_DEV_MIGR_REGION_IDX, vfu_get_migr_register_area_size() - 1, NULL, - VFU_REGION_FLAG_READ | VFU_REGION_FLAG_WRITE, NULL, 0, -1); + VFU_REGION_FLAG_READ | VFU_REGION_FLAG_WRITE, NULL, 0, -1, 0); assert_int_equal(-1, r); assert_int_equal(EINVAL, errno); } @@ -971,7 +971,7 @@ test_setup_migration_region_size_ok(void **state) vfu_ctx_t *v = get_vfu_ctx(state); int r = vfu_setup_region(v, VFU_PCI_DEV_MIGR_REGION_IDX, vfu_get_migr_register_area_size(), NULL, - VFU_REGION_FLAG_READ | VFU_REGION_FLAG_WRITE, NULL, 0, -1); + VFU_REGION_FLAG_READ | VFU_REGION_FLAG_WRITE, NULL, 0, -1, 0); assert_int_equal(0, r); } @@ -981,7 +981,7 @@ test_setup_migration_region_fully_mappable(void **state) struct test_setup_migr_reg_dat *p = *state; int r = vfu_setup_region(p->v, VFU_PCI_DEV_MIGR_REGION_IDX, p->s, NULL, VFU_REGION_FLAG_READ | VFU_REGION_FLAG_WRITE, NULL, 0, - 0xdeadbeef); + 0xdeadbeef, 0); assert_int_equal(-1, r); assert_int_equal(EINVAL, errno); } @@ -997,7 +997,8 @@ test_setup_migration_region_sparsely_mappable_over_migration_registers(void **st } }; int r = vfu_setup_region(p->v, VFU_PCI_DEV_MIGR_REGION_IDX, p->s, NULL, - VFU_REGION_FLAG_READ | VFU_REGION_FLAG_WRITE, mmap_areas, 1, 0xdeadbeef); + VFU_REGION_FLAG_READ | VFU_REGION_FLAG_WRITE, mmap_areas, 1, + 0xdeadbeef, 0); assert_int_equal(-1, r); assert_int_equal(EINVAL, errno); } @@ -1014,7 +1015,7 @@ test_setup_migration_region_sparsely_mappable_valid(void **state) }; int r = vfu_setup_region(p->v, VFU_PCI_DEV_MIGR_REGION_IDX, p->s, NULL, VFU_REGION_FLAG_READ | VFU_REGION_FLAG_WRITE, mmap_areas, 1, - 0xdeadbeef); + 0xdeadbeef, 0); assert_int_equal(0, r); } @@ -1031,7 +1032,7 @@ test_setup_migration_callbacks_bad_data_offset(void **state) { struct test_setup_migr_reg_dat *p = *state; int r = vfu_setup_region(p->v, VFU_PCI_DEV_MIGR_REGION_IDX, p->s, NULL, - VFU_REGION_FLAG_READ | VFU_REGION_FLAG_WRITE, NULL, 0, -1); + VFU_REGION_FLAG_READ | VFU_REGION_FLAG_WRITE, NULL, 0, -1, 0); assert_int_equal(0, r); r = vfu_setup_device_migration_callbacks(p->v, &p->c, vfu_get_migr_register_area_size() - 1); @@ -1043,7 +1044,7 @@ test_setup_migration_callbacks(void **state) { struct test_setup_migr_reg_dat *p = *state; int r = vfu_setup_region(p->v, VFU_PCI_DEV_MIGR_REGION_IDX, p->s, NULL, - VFU_REGION_FLAG_READ | VFU_REGION_FLAG_WRITE, NULL, 0, -1); + VFU_REGION_FLAG_READ | VFU_REGION_FLAG_WRITE, NULL, 0, -1, 0); assert_int_equal(0, r); r = vfu_setup_device_migration_callbacks(p->v, &p->c, vfu_get_migr_register_area_size()); |