evas: add test for the new efl_gfx_image_content_region_get API.
authorCedric BAIL <cedric.bail@free.fr>
Thu, 30 May 2019 18:25:39 +0000 (11:25 -0700)
committerTaehyub Kim <taehyub.kim@samsung.com>
Wed, 17 Jul 2019 07:20:32 +0000 (16:20 +0900)
Reviewed-by: Hermet Park <hermetpark@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9095

src/tests/evas/evas_test_image.c

index 19ae8ff..b9ff2b0 100644 (file)
@@ -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