summaryrefslogtreecommitdiff
path: root/src/tests/evas
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-02-27 13:17:09 -0500
committerMike Blumenkrantz <zmike@samsung.com>2019-02-27 13:17:10 -0500
commit6326e18b3fb2a4757f8ffa22be5d55a75da23049 (patch)
tree31d586b52638aa0d0b1c759869a8e3368c9daf5d /src/tests/evas
parent7924660d54500285d3844bfa384394c683825cd9 (diff)
downloadefl-6326e18b3fb2a4757f8ffa22be5d55a75da23049.tar.gz
efl.file: improve api a bit
Summary: the previous implementation/api had a number of issues: * "file" property contained both "file" and "key" values - also performed file loading operation * "load_error" property which was specific to image objects * no methods for controlling file loading/unloading this patch attempts the following changes: * split "file" property into "file" and "key" properties - also remove "key" from existing "mmap" property * remove "load_error" * directly return error codes from operations * add "load" and "unload" methods for directly controlling load state * add implicit file loading if file/mmap is set during construction * rewrite all efl.file implementations to move file loading into load() method * rewrite all usage of efl.file api based on these changes * add C extension functions to mimic previous behavior ref T7577 Reviewers: segfaultxavi, bu5hm4n, cedric Reviewed By: segfaultxavi Subscribers: vitor.sousa, #reviewers, #committers Tags: #efl_api Maniphest Tasks: T7577 Differential Revision: https://phab.enlightenment.org/D8018
Diffstat (limited to 'src/tests/evas')
-rw-r--r--src/tests/evas/evas_test_image.c4
-rw-r--r--src/tests/evas/evas_test_mesh.c16
2 files changed, 10 insertions, 10 deletions
diff --git a/src/tests/evas/evas_test_image.c b/src/tests/evas/evas_test_image.c
index 9e7da26b16..da6ad42365 100644
--- a/src/tests/evas/evas_test_image.c
+++ b/src/tests/evas/evas_test_image.c
@@ -773,7 +773,7 @@ EFL_START_TEST(evas_object_image_map_unmap)
const char *imgpath = TESTS_IMG_DIR "/Pic4.png";
o = efl_add(EFL_CANVAS_IMAGE_CLASS, e);
- efl_file_set(o, imgpath, NULL);
+ efl_file_simple_load(o, imgpath, NULL);
sz = efl_gfx_view_size_get(o);
cs = efl_gfx_buffer_colorspace_get(o);
@@ -852,7 +852,7 @@ EFL_START_TEST(evas_object_image_map_unmap)
uint32_t *dest, *orig;
o2 = efl_add(EFL_CANVAS_IMAGE_CLASS, e);
- efl_file_set(o2, tmp, NULL);
+ efl_file_simple_load(o2, tmp, NULL);
sz = efl_gfx_view_size_get(o);
w2 = sz.w;
h2 = sz.h;
diff --git a/src/tests/evas/evas_test_mesh.c b/src/tests/evas/evas_test_mesh.c
index 424b57b724..aba03730b5 100644
--- a/src/tests/evas/evas_test_mesh.c
+++ b/src/tests/evas/evas_test_mesh.c
@@ -52,22 +52,22 @@
fail_if(mesh == NULL); \
fail_if(mesh2 == NULL); \
snprintf(buffer, PATH_MAX, "%s%s", tmp, ext); \
- set_ok = efl_file_set(mesh, file->path, NULL); \
+ set_ok = efl_file_simple_load(mesh, file->path, NULL); \
save_ok = efl_file_save(mesh, buffer, NULL, NULL); \
fail_if(!set_ok); \
fail_if(!save_ok); \
- set_ok = efl_file_set(mesh2, buffer, NULL); \
+ set_ok = efl_file_simple_load(mesh2, buffer, NULL); \
fail_if(!set_ok); \
- efl_file_get(mesh2, &filename, &key); \
- fail_if(!!filename); \
+ efl_file_simple_get(mesh2, &filename, &key); \
+ fail_if(!filename); \
fail_if(!!key); \
res = _compare_meshes(mesh, mesh2); \
fail_if(res == 1); \
f = eina_file_open(file->path, 0); \
fail_if(!f); \
- set_ok = efl_file_mmap_set(mesh, f, NULL); \
- efl_file_mmap_get(mesh, &f_get, &key); \
- fail_if(!!f_get); \
+ set_ok = efl_file_simple_mmap_load(mesh, f, NULL); \
+ efl_file_simple_mmap_get(mesh, &f_get, &key); \
+ fail_if(!f_get); \
fail_if(!!key); \
eina_file_close(f); \
save_ok = efl_file_save(mesh, buffer, NULL, NULL); \
@@ -75,7 +75,7 @@
fail_if(!save_ok); \
f = eina_file_open(buffer, 0); \
fail_if(!f); \
- set_ok = efl_file_mmap_set(mesh2, f, NULL); \
+ set_ok = efl_file_simple_mmap_load(mesh2, f, NULL); \
eina_file_close(f); \
fail_if(!set_ok); \
res = _compare_meshes(mesh, mesh2); \