summaryrefslogtreecommitdiff
path: root/src/tests/evas/evas_test_image.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-04-16 08:34:09 -0400
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-04-18 16:04:17 +0200
commitf381bf8f01763d9bd07f86cef90500f09205f759 (patch)
treef75e535b405671f5aa54c93bab5ac0e1f4936d2a /src/tests/evas/evas_test_image.c
parent8135b4698c6f99c7260c46b0e2199beac8723df1 (diff)
tests: add api coverage for evas image
verify that legacy apis function as expected when using legacy api to load and unload images Reviewed-by: Hermet Park <hermetpark@gmail.com> Differential Revision: https://phab.enlightenment.org/D8619
Diffstat (limited to 'src/tests/evas/evas_test_image.c')
-rw-r--r--src/tests/evas/evas_test_image.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/tests/evas/evas_test_image.c b/src/tests/evas/evas_test_image.c
index da6ad42365..259cff77d3 100644
--- a/src/tests/evas/evas_test_image.c
+++ b/src/tests/evas/evas_test_image.c
@@ -729,6 +729,40 @@ EFL_START_TEST(evas_object_image_cached_data_comparision)
729} 729}
730EFL_END_TEST 730EFL_END_TEST
731 731
732EFL_START_TEST(evas_object_image_api)
733{
734 Evas *e = _setup_evas();
735 Evas_Object *o;
736 void *pix;
737 int w, h;
738
739 o = evas_object_image_filled_add(e);
740 /* test file load */
741 evas_object_image_file_set(o, TESTS_IMG_DIR"/Light.jpg", NULL);
742 ck_assert(!!efl_file_get(o));
743 pix = evas_object_image_data_get(o, EINA_FALSE);
744 ck_assert(!!pix);
745 evas_object_image_size_get(o, &w, &h);
746 ck_assert(w && h);
747 /* test file unload */
748 evas_object_image_file_set(o, NULL, NULL);
749 ck_assert(!efl_file_get(o));
750 pix = evas_object_image_data_get(o, EINA_FALSE);
751 ck_assert(!pix);
752 evas_object_image_size_get(o, &w, &h);
753 ck_assert(!w && !h);
754 /* test file load after unload */
755 evas_object_image_file_set(o, TESTS_IMG_DIR"/Light.jpg", NULL);
756 ck_assert(!!efl_file_get(o));
757 pix = evas_object_image_data_get(o, EINA_FALSE);
758 ck_assert(!!pix);
759 evas_object_image_size_get(o, &w, &h);
760 ck_assert(w && h);
761
762 evas_free(e);
763}
764EFL_END_TEST
765
732EFL_START_TEST(evas_object_image_defaults) 766EFL_START_TEST(evas_object_image_defaults)
733{ 767{
734 Evas *e = _setup_evas(); 768 Evas *e = _setup_evas();
@@ -972,6 +1006,7 @@ EFL_END_TEST
972 1006
973void evas_test_image_object(TCase *tc) 1007void evas_test_image_object(TCase *tc)
974{ 1008{
1009 tcase_add_test(tc, evas_object_image_api);
975 tcase_add_test(tc, evas_object_image_defaults); 1010 tcase_add_test(tc, evas_object_image_defaults);
976 tcase_add_test(tc, evas_object_image_loader); 1011 tcase_add_test(tc, evas_object_image_loader);
977 tcase_add_test(tc, evas_object_image_loader_orientation); 1012 tcase_add_test(tc, evas_object_image_loader_orientation);