From a3cfd7d8234353f5d62d264c908598fc99a90e01 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Thu, 30 May 2019 11:25:39 -0700 Subject: [PATCH] evas: add test for the new efl_gfx_image_content_region_get API. Reviewed-by: Hermet Park Differential Revision: https://phab.enlightenment.org/D9095 --- src/tests/evas/evas_test_image.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/tests/evas/evas_test_image.c b/src/tests/evas/evas_test_image.c index 19ae8ff..b9ff2b0 100644 --- a/src/tests/evas/evas_test_image.c +++ b/src/tests/evas/evas_test_image.c @@ -666,6 +666,7 @@ EFL_START_TEST(evas_object_image_cached_data_comparision) const uint32_t *d2, *n_d2; const char *img_path, *img_path2; Evas_Object *img, *img2; + Eina_Rect region; Evas *e = _setup_evas(); @@ -727,6 +728,18 @@ EFL_START_TEST(evas_object_image_cached_data_comparision) fail_if(w2 != n_w2 || h2 != n_h2); fail_if(memcmp(d2, n_d2, w2 * h2 * 4)); } + + region = efl_gfx_image_content_region_get(img); + ck_assert_int_eq(region.x, 0); + ck_assert_int_eq(region.y, 0); + ck_assert_int_eq(region.w, 250); + ck_assert_int_eq(region.h, 250); + efl_gfx_image_border_set(img, 7, 14, 5, 10); + region = efl_gfx_image_content_region_get(img); + ck_assert_int_eq(region.x, 7); + ck_assert_int_eq(region.y, 5); + ck_assert_int_eq(region.w, 250 - 7 - 14); + ck_assert_int_eq(region.h, 250 - 5 - 10); } EFL_END_TEST -- 2.7.4