evas_canvas3d_mesh: implement get methods for efl.file file and mmap props

also add unit tests for new methods

ref T5719

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Reviewed-by: Marcel Hollerbach <marcel-hollerbach@t-online.de>
Differential Revision: https://phab.enlightenment.org/D7785
This commit is contained in:
Mike Blumenkrantz 2019-01-25 12:47:38 -05:00 committed by Marcel Hollerbach
parent 015fbac20d
commit 956a66c748
3 changed files with 26 additions and 3 deletions

View File

@ -876,7 +876,21 @@ _evas_canvas3d_mesh_efl_file_mmap_set(Eo *obj,
return EINA_TRUE;
}
/* FIXME: Imelemnt mmap_get and file_get. */
EOLIAN void
_evas_canvas3d_mesh_efl_file_mmap_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *sd EINA_UNUSED, const Eina_File **file, const char **group)
{
ERR("this function is not available for this object");
if (file) *file = NULL;
if (group) *group = NULL;
}
EOLIAN void
_evas_canvas3d_mesh_efl_file_file_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *sd EINA_UNUSED, const char **file, const char **key)
{
ERR("this function is not available for this object");
if (file) *file = NULL;
if (key) *key = NULL;
}
EOLIAN static Eina_Bool
_evas_canvas3d_mesh_efl_file_file_set(Eo *obj, Evas_Canvas3D_Mesh_Data *pd,

View File

@ -426,8 +426,8 @@ class Evas.Canvas3D.Mesh extends Evas.Canvas3D.Object implements Efl.File
Efl.Object.destructor;
Evas.Canvas3D.Object.update_notify;
Evas.Canvas3D.Object.change_notify;
Efl.File.file { set; }
Efl.File.mmap { set; }
Efl.File.file { get; set; }
Efl.File.mmap { get; set; }
Efl.File.save;
}

View File

@ -44,6 +44,9 @@
{ \
int set_ok, save_ok; \
Eina_File *f; \
const Eina_File *f_get = NULL; \
const char *filename = NULL; \
const char *key = NULL; \
mesh = efl_add(EVAS_CANVAS3D_MESH_CLASS, e); \
mesh2 = efl_add(EVAS_CANVAS3D_MESH_CLASS, e); \
fail_if(mesh == NULL); \
@ -55,11 +58,17 @@
fail_if(!save_ok); \
set_ok = efl_file_set(mesh2, buffer, NULL); \
fail_if(!set_ok); \
efl_file_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); \
fail_if(!!key); \
eina_file_close(f); \
save_ok = efl_file_save(mesh, buffer, NULL, NULL); \
fail_if(!set_ok); \