diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/commonlib/region-test.c | 6 | ||||
-rw-r--r-- | tests/lib/region_file-test.c | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/tests/commonlib/region-test.c b/tests/commonlib/region-test.c index 32804825a6..6caa12cad2 100644 --- a/tests/commonlib/region-test.c +++ b/tests/commonlib/region-test.c @@ -17,7 +17,7 @@ static void test_region(void **state) struct region outer = {.offset = VAL(2), .size = VAL(4)}; assert_int_equal(region_offset(&outer), VAL(2)); assert_int_equal(region_sz(&outer), VAL(4)); - assert_int_equal(region_end(&outer), VAL(6)); + assert_int_equal(region_last(&outer), VAL(6) - 1); struct region inner = {.offset = VAL(3), .size = VAL(2)}; assert_true(region_is_subregion(&outer, &inner)); @@ -118,7 +118,7 @@ static void test_rdev_basics(void **state) { assert_int_equal(region_device_offset(&mock_rdev), 0); assert_int_equal(region_device_sz(&mock_rdev), ~(size_t)0); - assert_int_equal(region_device_end(&mock_rdev), ~(size_t)0); + assert_int_equal(region_device_last(&mock_rdev), ~(size_t)0 - 1); } /* @@ -254,7 +254,7 @@ static void test_rdev_chain(void **state) assert_int_equal(rdev_chain(&child, &mock_rdev, child_offs, child_size), 0); assert_int_equal(region_device_sz(&child), child_size); assert_int_equal(region_device_offset(&child), child_offs); - assert_int_equal(region_device_end(&child), child_offs + child_size); + assert_int_equal(region_device_last(&child), child_offs + child_size - 1); assert_int_equal(rdev_relative_offset(&mock_rdev, &child), child_offs); assert_int_equal(rdev_relative_offset(&child, &mock_rdev), -1); diff --git a/tests/lib/region_file-test.c b/tests/lib/region_file-test.c index 56bb8e4f01..7607aafe96 100644 --- a/tests/lib/region_file-test.c +++ b/tests/lib/region_file-test.c @@ -145,12 +145,8 @@ static void test_region_file_init_real_data(void **state) static void test_region_file_init_invalid_region_device(void **state) { struct region_device bad_dev; - struct region_file regf; - - rdev_chain_mem_rw(&bad_dev, NULL, 0); - /* Expect fail when passing invalid region_device. */ - assert_int_equal(-1, region_file_init(®f, &bad_dev)); + assert_int_equal(rdev_chain_mem_rw(&bad_dev, NULL, 0), -1); } static void test_region_file_data(void **state) |