Commit Graph

51 Commits

Author SHA1 Message Date
Stefan Schmidt b209bb051b tests: evas: check fd being non -1 before using close()
eina_file_mkstemp would return -1 in an error case. Make sure we check
the return when clsoing here.

CID: 1400790

Reviewed-by: Christopher Michael <devilhorns@comcast.net>
Differential Revision: https://phab.enlightenment.org/D11957
2020-06-10 10:07:59 +02:00
Mike Blumenkrantz 565fa76a11 tests/evas: verify loading and mmap values for efl.file are correct with skip_head
ensure that these functions are still usable with async load

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11424
2020-03-06 13:30:52 +01:00
Mike Blumenkrantz 7768b54043 tests/evas: add simple test for skip_head property
Summary:
when using this property, there should be no mmap loaded after a call
to evas_object_image_file_set, and we want to make sure the image is
eventually loaded

ref T8378

Depends on D11340

Reviewers: raster

Reviewed By: raster

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8378

Differential Revision: https://phab.enlightenment.org/D11341
2020-02-14 08:33:49 -05:00
Shinwoo Kim 50f3648391 evas proxy: make it work for File_Save.save
Summary:
File_Save.save does not work for proxy object from following commit.

   c53f152 evas: Make save() work on snapshots

Test Plan:
1. Add an image object and set source object.
evas_object_image_source_set(obj, source);

2. Save the object as a file when you need.
evas_object_image_save(obj, "./file_name.png", NULL, NULL);

Reviewers: cedric, Hermet, jsuya

Reviewed By: Hermet

Subscribers: zmike, subodh6129, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10629
2020-02-04 12:06:38 +09:00
Mike Blumenkrantz 28f589d795 efl/image: rename "border" -> "border_insets"
Summary:
this is a clearer name which makes the intent of the API more obvious at
a glance

ref T7875

Subscribers: cedric, #reviewers, #committers

Tags: #efl_api

Maniphest Tasks: T7875

Differential Revision: https://phab.enlightenment.org/D9996
2019-09-18 10:08:56 +02:00
Cedric BAIL b799ba1a10 evas: add a test for loading Android 9patch file.
Example data come from https://github.com/vindolin/ninepatch/tree/master/ninepatch/data
under MIT license.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Hermet Park <hermetpark@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9105
2019-07-12 09:54:24 -07:00
Cedric BAIL 2020f971a4 evas: improve test to evaluate stretch region effect on content region.
Reviewed-by: Hermet Park <hermetpark@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9098
2019-07-12 09:54:08 -07:00
Cedric BAIL d3efb9c769 evas: add test for the new efl_gfx_image_content_region_get API.
Reviewed-by: Hermet Park <hermetpark@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9095
2019-07-12 09:54:01 -07:00
Christopher Michael b563fed2e4 evas_test_image: Fix resource leak
Summary:
Coverity reports that we leak variable 'f' going out of scope here, so
if we are going to exit the test, lets close the file before we do

Fixes CID1400945

@fix
Depends on D8770

Reviewers: raster, cedric, zmike, bu5hm4n, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8771
2019-05-02 13:47:22 +02:00
Mike Blumenkrantz f381bf8f01 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
2019-04-18 16:04:17 +02:00
Marcel Hollerbach 11442eca6f Revert "tests: add api coverage for evas image"
This reverts commit cf70826b33.

This test cannot work right now because the fix has not landed.
2019-04-18 11:01:21 +02:00
Mike Blumenkrantz cf70826b33 tests: add api coverage for evas image
Summary:
verify that legacy apis function as expected when using legacy api to
load and unload images
Depends on D8618

Reviewers: Hermet

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8619
2019-04-18 09:59:58 +09:00
Mike Blumenkrantz 6326e18b3f 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
2019-02-27 13:17:10 -05:00
Shinwoo Kim 3a89ea15b9 evas cache image: compare with cached image file
As cache2 knows cached image could be not matched even though
hash key is not different.

Please refer to the following comment of evas_cache2_image_open.

   /* image we found doesn't match what's on disk (stat info wise)
    * so dirty the active cache entry so we never find it again. this
    * also implicitly guarantees that we only have 1 active copy
    * of an image at a given key. we wither find it and keep re-reffing
    * it or we dirty it and get it out */

The hash key is created base on the image file address.
If the image file address to find does not equal cached image file address
then it means that the cached image is no longer valid.

This case could happen with the following step.

(1) Call evas_object_image_memfile_set with content data A
(2) Call evas_object_image_memfile_set with content data B
(3) Add timer with short time (ex: 0.01 sec)
(4) Delete A image, and add A image in timer callback
(5) Delete B image, and add B image in timer callback

Sometimes you could see image of A from the B image, because newly created
image at step 5 has same address of setp 1.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D6870
2018-11-29 16:01:48 -08:00
Mike Blumenkrantz 22cb35c9a4 tests: use loop test to split jpeg tests from evas_object_image_all_loader_data
Summary:
jpeg loader tests take 4+ seconds due to manual value comparisons, so ensure
that they run separately

ref T6856

Reviewers: stefan_schmidt

Subscribers: cedric

Maniphest Tasks: T6856

Differential Revision: https://phab.enlightenment.org/D5911
2018-04-17 15:14:52 +02:00
Mike Blumenkrantz 624925fe6e tests: move to using checked fixtures for all test suites
individual tests should not need to explicitly call init/shutdown functions
in most cases, and many did not properly do this anyway

see followup commit which resolves some issues with eina tests

ref T6813
ref T6811

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:26 +02:00
Mike Blumenkrantz adc601aca2 tests: add instrumentation to existing tests to find slow tests
efl_check.h must be included and the EFL_START/END_TEST macros must be
used in place of normal START/END_TEST macros

timing is enabled when TIMING_ENABLED is set
https://phab.enlightenment.org/w/improve_tests/

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:25 +02:00
Carsten Haitzler e30fb6945e fix evas test suite to now init both ecore and evas.... correctly.
see c8dcc4327b803e9b8ad2a0985e756c924946c442 - basicall evas depends
on ecore these days... thus requires ecore be initted THEN evas. ...
which in theory is an abi break for those using evas and ONLY evas
long ago from when efl was separate... but it''s how we're building
these days.

@fix
2018-01-05 02:34:16 +09:00
Jean-Philippe Andre b19ee757e5 efl: Use Eina.Size2D in Gfx.View 2017-09-19 10:51:48 +09:00
Jean-Philippe Andre 2df8ad36b4 evas: Use Eina.Slice on the stack (gfx.buffer) 2017-09-19 10:51:48 +09:00
Vincent Torri c358ac0222 evas tests - add Jpeg2000 tests
add tests for loading jp2k files correctly and the images
2017-08-11 17:53:28 +09:00
Uma Devika d4ab6ff90a Evas and Eolian : Freed string buffer
Summary:
Summary : String buffer returned by eina_strbuf_new() is not freed in some cases

@Fix

Signed-off-by: Uma Devika <u.bodapati@samsung.com>

Reviewers: cedric, tasn, jpeg, raster, singh.amitesh

Subscribers: tanwar.umesh07, yashu21985, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5000
2017-07-07 13:22:53 +09:00
Cedric BAIL cf62558402 evas: fix comparison between unsigned and signed warning. 2016-12-15 10:01:35 -08:00
Jean-Philippe Andre 8ee431572d evas: Switch EO APIs to Eina_Slice for gfx buffers (map)
This adds a plane and eina slice argument to the map/unmap
functions, instead of void_ptr + length.
2016-09-06 16:54:53 +09:00
Tom Hacohen e65aae994e Eo: Finish the renaming of Eo to the EFL.
This renames all the rest of the API to the EFL namespace except for
Eo_Event that will follow soon.

Obviously breaks both API and ABI.
2016-08-15 15:07:42 +01:00
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Jean-Philippe Andre 79abba52c5 Evas: Rename Evas.Image into Efl.Canvas.Image.Internal
Make it abstract.
And add Evas.Image as a legacy-only class.
2016-06-10 13:21:20 +09:00
Stefan Schmidt c840162f09 tests: evas: remove unused variable
We set it but never going to use it afterwards. We already tests the
efl_gfx_buffer_colorspace_get() elsewhere in this tests so we can ignore it
for now until we need it and bring it back together with a user.
2016-06-06 15:43:15 +02:00
Tom Hacohen a6a2338962 Revert "Eo: Remove eo_del() and make eo_unref() the replacement."
This reverts commit 546ff7bbba.

It seems that eo_del() is useful and removing it was creating bugs.
The issue is that the way we defined parents in eo, both the parent and
the programmer share a reference to the object. When we eo_unref() that
reference as the programmer, eo has no way to know it's this specific
reference we are freeing, and not a general one, so in some
circumstances, for example:
eo_ref(child);
eo_unref(child); // trying to delete here
eo_unref(container); // container is deleted here
eo_unref(child); // child already has 0 refs before this point.

We would have an issue with references and objects being freed too soon
and in general, issue with the references.

Having eo_del() solves that, because this one explicitly unparents if
there is a parent, meaning the reference ownership is explicitly taken
by the programmer.

eo_del() is essentially a convenience function around "check if has
parent, and if so unparent, otherwise, unref". Which should be used when
you want to delete an object although it has a parent, and is equivalent
to eo_unref() when it doesn't have one.
2016-06-01 13:33:21 +01:00
Tom Hacohen 546ff7bbba Eo: Remove eo_del() and make eo_unref() the replacement.
We used to have eo_del() as the mirrored action to eo_add(). No longer,
now you just always eo_unref() to delete an object. This change makes it
so the reference of the parent is shared with the reference the
programmer has. So eo_parent_set(obj, NULL) can free an object, and so
does eo_unref() (even if there is a parent).

This means Eo no longer complains if you have a parent during deletion.
2016-05-17 16:23:23 +01:00
Jean-Philippe Andre ba4ffba8c1 Evas: Add a test case for image buffer_map.
This:
1. opens a file
2. maps its data and vaguely verifies it
3. writes data to it
4. writes data to it with a GRY8 map
5. verifies that the final image has all the proper pixels
2016-03-28 16:40:02 +09:00
Jean-Philippe Andre 72363b4777 tests: Remove unused variables (evas_image) 2016-03-18 13:53:39 +09:00
Jean-Philippe Andre b8f682b842 Efl.Gfx.Fill: Rename filled to fill_auto
fill_filled is a strange name for the property.
fill_auto seems to make more sense. If you disagree, scream at
me or revert this commit.
2016-03-18 13:28:45 +09:00
Tom Hacohen 8706d03b43 Change the EFL according to the renaming of the eo_add() current object. 2016-03-15 15:25:54 +00:00
Jean-Philippe Andre 2d10127524 Evas image: Move filled property to Efl.Gfx.Fill and set as default
The filled property should be set to true by default since it
makes more sense. Legacy APIs behaviour is preserved by setting
the default to false.
2016-03-15 11:11:59 +09:00
Stefan Schmidt 2d0d2802bf tests evas: enable xpm image loader in tests
Added in 2014 and not enabled since then. This seems to be fixed now so we can
finally enable it.
2016-03-09 15:25:35 +01:00
Stefan Schmidt 312dd58889 tests evas: remove commented out function which have not been used since 2014
It was already unused when it was disabled almost two years ago.
dbe02d593e
Its about time to remove it.
2016-03-09 15:25:35 +01:00
Vincent Torri 71f0fb98f0 Test rework #20: Evas 2016-02-16 12:41:06 +00:00
jiin.moon 63a12d7d26 emile: fix region load for jpeg image with orientation different set.
Summary:
If you try to load the jpeg image with an orientation mode defined
using elm_photocam, you can see the broken image(in canse of 90 degree)
or even segmentation fault can happen (in case of 180,270 degree)

@fix

Test Plan: photocam menu on elementary_test

Reviewers: Hermet, cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2593

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-06-03 13:46:44 +02:00
kabeer khan 757c7c3f10 evas: add image_orient_set/get tests in evas tests suite.
Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2239

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-04-06 16:37:52 +02:00
pierre lamot 17e73dca05 evas: jpeg decoders alows a difference of 1 bit per component.
The required precision of decompressed images allows a difference of
1 bit for each pixel compoment [1] . Such difference has been noticed
on OSX when using libjpeg9 from macports.

evas_suite images tests has been modified to compare jpeg images with
this tolerance. Other image formats are still compare with exact
precision

[1] http://en.wikipedia.org/wiki/JPEG#Required_precision

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-02-05 16:38:06 +01:00
Cedric BAIL 311ea67b65 evas: add new test for bug in BMP loader. 2015-01-26 11:02:14 +01:00
Cedric BAIL c54c2d94c2 evas: fix tests to actually test image ! 2015-01-26 11:01:44 +01:00
Cedric BAIL 5c8a8a51ce evas: tests only for extension compiled in. 2014-10-22 14:15:32 +02:00
Cedric BAIL f7e07b4914 evas: tests more file format loader.
NOTE: It seems that the xpm one is broken. If somebody could give it
a better look and check if it work for him or not, before opening a bug
in phab.
2014-10-21 23:42:03 +02:00
Cedric BAIL 308f000b39 evas: tests tgv file decoding. 2014-10-02 16:52:30 +02:00
Wonguk 3a0e0df84a evas tests: remove TODO comment already done 2014-08-04 17:15:54 +02:00
Wonguk Jeong 23815453f4 evas: jpeg loader - add tests for EXIF flip, transpose, transverse.
Summary:
Previously, there was rotation test only. (90 CW, 180 CW, 90 CCW)
Flip vertically, flip horizontally, transpose, transverse tests are added

D1126 will make added tests be passed.

Reviewers: raster, cedric, jpeg

CC: seoz, cedric

Differential Revision: https://phab.enlightenment.org/D1127

Signed-off-by: Cedric BAIL <c.bail@partner.samsung.com>
2014-07-06 20:12:31 +02:00
Wonguk Jeong 573f477272 jpeg laoder: exif orientation test added
Summary:
currently, normal orientation tests are only added.
I'm going to add flipped orientation tests as well after I put related code in jpeg loader (currently it's not supported)

Reviewers: raster, cedric, jpeg

CC: seoz, cedric

Differential Revision: https://phab.enlightenment.org/D1098
2014-06-29 13:04:16 +02:00
Daniel Zaoui dbe02d593e Tests: fix annoying warning.
The function is not used so I commented it, in case it has to be used
later.
2014-04-27 11:05:03 +03:00