Commit Graph

369 Commits

Author SHA1 Message Date
Mike Blumenkrantz bc3dc78a52 eina: make tiler test compare tilers which are not equal 2017-07-14 18:43:00 -04:00
Prasoon Singh 9c62ab525b eina: fix for escapable charachters not getting escaped if it comes after '\t' or '\n'
Summary:
Escaping is not happening whenever any escapable characters is coming after
'\t' or '\n'. It will also fix invalid read of 1 byte which happens for string where
last charachter is '\t' or '\n' like "eina\t".

Test Plan:
Take a string like "eina\t ". Observe space which is followed by tab is not getting
escaped.

Signed-off-by: Prasoon Singh <prasoon.16@samsung.com>

Reviewers: shilpasingh, rajeshps, govi, cedric

Reviewed By: shilpasingh

Subscribers: cedric, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-05-09 10:37:16 -07:00
Mike Blumenkrantz 73fb81b19e tests: add test for large eina tiler rect 2017-04-21 16:16:12 -04:00
Jean-Philippe Andre 38446d8daf tests: Remove CPU affinity from all threads
I believe that all the threads created in our test suite should
be spawned without any special CPU affinity. The default parameter
is not 0 (corresponds to the first CPU, known as CPU 0) but -1.

Similarily the default priority is NORMAL (1), not 0 (URGENT).

This also affects two unused code paths: evas render2 and gl preload.

@fix
2017-03-06 17:03:47 +09:00
Stefan Schmidt 0daed02e89 tests: eina_file: check if the fd is really 0 when we set close file to true
The return value from create_file_not_empty was saved but never checked if it
really is 0. Whcih should be the case if we call the function with file_close
true.
2017-02-13 14:20:17 +01:00
Stefan Schmidt d853b0ba68 tests: eina_file: fix coding style in file_unlink test case 2017-02-13 14:12:38 +01:00
Stefan Schmidt 83e00cc8e8 tests: eina_file: remove unused variable 2017-02-13 14:10:03 +01:00
Ivan Furs 808fcf4dae eina_file: add eina_file_unlink
Test Plan: split  D4423 - unlink

Reviewers: raster, vtorri, an.kroitor, jpeg, reutskiy.v.v, NikaWhite, cedric

Reviewed By: cedric

Subscribers: artem.popov, cedric, vtorri, jpeg

Tags: #windows, #efl

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-02-07 15:14:54 -08:00
Gustavo Sverzut Barbieri 8dc853f230 ifdef RUN_IN_TREE logic.
This logic is only needed for autotools, cmake will replicate the
installation file structure and thus eina_prefix works out of box.
2017-02-03 12:36:38 -02:00
Marcel Hollerbach e1e7614ea4 build: PACKAGE_BUILD_DIR is now defined for everyone 2017-01-23 18:23:40 +01:00
Gustavo Sverzut Barbieri 3d5abc081f EflMacros: major improvements towards usability.
Stick to one target per directory and remove prefix from variables,
makes it cleaner and easier to use.

Document variables used and use a more consistent name that matches
CMake properties.
2017-01-23 18:23:40 +01:00
Gustavo Sverzut Barbieri dee24c3821 CMake: rework to use some helper macros.
This tries to defines some macros to create a cleaner build system.
2017-01-23 18:23:40 +01:00
Marcel Hollerbach 88283204c1 build: switch eina to half baked cmake 2017-01-23 18:23:40 +01:00
Jean-Philippe Andre ffbc0645e5 eina: Remove EAPI eina_freeq_main_set()
I believe this function is not required and should not be
used by applications. If there is a very good use case to
use your own main freeq, then the API could be added again.

For now, removing the set() is probably the safer option.

Note: the API was introduced in the upcoming 1.19
2017-01-17 14:21:17 +09:00
Jean-Philippe Andre 4550b4cf83 eina: Introduce Eina_Slstr for short-lived strings
Built on top of the new 'postponed' free queue, the short-lived
strings API allows users to return new strings without caring
about freeing them. EFL main loop will do this automatically for
them you at a later point in time (at the end of an iteration).

The APIs provided will either duplicate (copy) or more generally
steal an existing string (char *, stringshare, tmpstr, strbuf),
taking ownership of it and controling its lifetime. Those strings
can then be safely returned by an API. From a user point of view,
those strings must be considered like simple const char *, ie.
no need to free() them and their validity is limited to the
local scope.

There is no function to remove such a string from the freeq.

The short lived strings API is not thread-safe: do not send a
short-lived object from one thread to another.

@feature
2017-01-17 14:20:55 +09:00
Jean-Philippe Andre 4f5e64fdea eina_freeq: Add mode for postponed deletion
While this reuses the existing (but new) infrastructure of
eina_freeq, the mode of operation and objective is very different
from the default freeq.

By default, any object added to the freeq is basically already
freed from the user point of view, and the freeq itself only adds
a tiny layer of memory safety by deferring the actual call to free
and optionally filling the memory blob with a pattern ('wwwww...').
This is mostly thread-safe (requires thread-safe free functions).

This new type I called postponed is intended to store objects that
will be short lived. This is not thread safe as the life of the
objects added to this queue depends on the thread that adds to
the queue. The main intent is to introduce a new API for short-lived
strings.

@feature
2017-01-17 14:05:16 +09:00
Cedric BAIL 95e1cefb40 eina: add test for all float/double util function. 2017-01-06 15:58:46 -08:00
Cedric BAIL 8f1c071d6a eina: rename EINA_{FLT,DBL}_CMP to EINA_{FLT,DBL}_EQ. 2017-01-06 15:58:46 -08:00
Marcel Hollerbach 4d6d177ff7 eina_buf: replace eina_strbuf_free_return with eina_xXxbuf_release
The api name free_return wasnt a good choice so it is changed to
release. This also moves the implementation to binbuf template so it is
available in all buf types.
2017-01-06 12:45:27 +01:00
Marcel Hollerbach 2f1d0fb189 eina_strbuf: add eina_strbuf_free_return
Summary:
For a function which just composes a string with strbuf its quite
usefull to return the string while its freed.

This makes a function like:

{
   Eina_Strbuf *buf;
   char *path;

   buf = eina_strbuf_new();
   eina_strbuf_append(buf, "test");
   eina_strbuf_append_printf(buf, "%s-%d.edj", "test", 0);
   path = eina_strbuf_string_steal(buf);
   eina_strbuf_free(buf);
   return path;
}

To:

{
   Eina_Strbuf *buf;

   buf = eina_strbuf_new();
   eina_strbuf_append(buf, "test");
   eina_strbuf_append_printf(buf, "%s-%d.edj", "test", 0);
   return eina_strbuf_free_return(buf);
}

Which is a bit more handy.

Test Plan: just run make check

Reviewers: raster, cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D4545
2017-01-05 14:08:23 +01:00
Cedric BAIL 18f41e12bc eina: try slight improvement of eina tests suite.
Still need to go through individual test to improve them.
2016-12-21 16:40:22 -08:00
Marcel Hollerbach 4e9656feac eina: add api for assessing the relative position of two rectangles
Summary:
the api returns if a rectangle is positioned above/below/right or left
of a other rectangle.

Code which does simular things are part of verne and e, i think its a good idea to provide api for that.

Test Plan: Just run the test suite

Reviewers: raster, jpeg, cedric

Reviewed By: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-12-20 16:39:30 -08:00
Gustavo Sverzut Barbieri 09825cbe5d eina_binbuf: allow expand & usage of extra bytes.
Some code needs to read directly into eina_binbuf to avoid an extra
copy from eina_binbuf_append* variants.

This can be achieved by using eina_binbuf_expand(), which returns a
write-able slice of the spare bytes. Once they are used,
eina_binbuf_use() should be called to increment "buf->len", which is
used by all other binbuf functions such as eina_binbuf_length_get() or
eina_binbuf_append_slice().
2016-12-20 10:18:32 -02:00
Cedric BAIL c12d60c1e6 eina fixup matrix test 2016-12-19 16:33:46 -08:00
Cedric BAIL ae9257401e eina: get rid of float comparison warning on quaternion tests. 2016-12-19 16:33:46 -08:00
Cedric BAIL 27bf609b9d eina: get rid of float comparison warning on quad tests. 2016-12-19 16:33:46 -08:00
Cedric BAIL e24ad29142 eina: get rid of float comparison warning from str test. 2016-12-19 16:33:46 -08:00
Cedric BAIL d03482a0a7 eina: use proper logic for comparing double in matrix tests. 2016-12-19 16:33:46 -08:00
Cedric BAIL 4489e7520e eina: correctly compar double in eina xattr test. 2016-12-19 16:33:46 -08:00
Cedric BAIL 0ff7bf3611 eina: add a test for eina_stringshare_refplace. 2016-12-15 15:00:58 -08:00
Cedric BAIL 563dcd1ed9 eina: add test for skyline algorithm. 2016-12-15 14:40:06 -08:00
Cedric BAIL b3cc37dd77 eina: pass the right size of the string to avoid unbounded access warning. 2016-12-15 11:39:16 -08:00
Marcel Hollerbach 712ec60012 eina: add free cb to eina_iterator_filter_new
if you allocate memory for the data param data you can free it in this callback.
2016-12-09 10:16:08 +01:00
Bruno Dilly adb95630ef eina: remove tests, examples and docs for eina_model
Summary:
Since eina_model was dropped some years ago.
Also a few other points where related stuff is just commented out.

Reviewers: iscaro, barbieri

Reviewed By: barbieri

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4442
2016-11-30 18:37:34 -02:00
Marcel Hollerbach c34e4b6312 eina_iterator: add new api to have a filtered iterator
Summary:
the new iterator represents the order from the elements of the original
iterator, elements where the filter callback return false will be
skipped.

The container of this iterator is the original iterator.

Test Plan: Just run `make check` there is a testcase

Reviewers: cedric, jpeg, raster, herdsman

Differential Revision: https://phab.enlightenment.org/D4417
2016-11-21 12:13:02 +01:00
Cedric BAIL e842c79ff3 eina: remove Eina_Promise tests. 2016-11-07 11:23:59 -08:00
Carsten Haitzler 0ee33e7b4b eina - add a free queue (eina_freeq) for deferring frees of data
this adds eina_freeq api's for c land for deferring freeing of
pointers and can be used a s a simple copy & paste drop-in for free()
just to "do this later". the pointer will eveentually be freed as
eina_shutdown will free the main free queue and this will in turn free
everything in it. as long as the main lo0op keeps pumping things will
og on the queue and then be freed from it. free queues have limits so
if they get full they will clear out old pointers and free them so it
won't grow without bound. the default max is 1mb of data or 16384
items whichever limit is hit first and at that point the oldest item
will be freed to make room for the newest. the mainloop whenever it
finishes idle enterers will add an idler to spin and free while idle.
the sizes can be tuned and aruged about as to what defaults should be.

this also allows for better memory debugging too by being able to fill
freed memory with patterns if its small enough etc. etc.

@feature
2016-11-06 13:13:10 +09:00
Jean Guyomarc'h a1373a860d tests: oops, remove invalid trailing slash 2016-10-01 21:26:16 +02:00
Jean Guyomarc'h 06a3629bec tests: check for the presence of clock_gettime()
macOS Sierra provides clock_gettime().
Instead of testing for the Mach kernel to re-implement clock_gettime(),
let first check that clock_gettime() is not already declared. Older OSX
versions will have the Mach-only fallback.

@fix
2016-10-01 21:19:15 +02:00
Jean Guyomarc'h 00b0501424 tests: mimic POSIX API in clock_gettime()
Let the clock_gettime() re-implementation have the same signature than
its POSIX definition.
2016-10-01 21:17:05 +02:00
Gustavo Sverzut Barbieri 45c0002929 eina_slice: startswith and endswith.
these helpers around memcmp() make the code more readable.
2016-08-23 21:25:02 -03:00
Gustavo Sverzut Barbieri 9944c164bd eina_slice: fix multi-byte find function, add tests. 2016-08-23 20:17:13 -03:00
Gustavo Sverzut Barbieri 0d96ba9734 binbuf, strbuf and ustrbuf: add slice_get() and rw_slice_get(). 2016-08-22 18:25:14 -03:00
Gustavo Sverzut Barbieri 77faebde67 eina_stringshare: add slice_get() 2016-08-22 18:25:14 -03:00
Gustavo Sverzut Barbieri 9062bbd8e0 eina: introduce Eina_Slice and Eina_Rw_Slice.
A plain simple pointer + length describing a linear memory region.
2016-08-22 18:25:14 -03:00
Gustavo Sverzut Barbieri e56811ed4d eina_error: allow errno.h codes.
we have some duplication of errors between Eina_Error and errno.h,
however we should use Eina_Error to extend the traditional errno.h
system.

then change eina_error_msg_register() and
eina_error_msg_static_register() to return a magic bit to state the
number was registered, and on other functions test this bit in order
to operate on registered values, otherwise fallback to errno.h, such
as strerror().

It also deprecates 2 clear duplicated errors:

- EINA_ERROR_OUT_OF_MEMORY -> ENOMEM

- EINA_ERROR_TIMEOUT -> ETIMEDOUT

There are two details when using strerror():

 - old behavior did not return strings for non-error, such as
   "Success" or "Unknown error ${N}"

 - thread-safety issues: since we must be thread safe, then use
   strerror_r() and eina_stringshare_add() that value, keeping a hash
   of cached values
2016-08-18 13:36:05 -03:00
Jean-Philippe Andre cb24d5f489 eina: Set EINA_ERROR_TIMEOUT to cond_timedwait
This adds a new error code.

I'm using a weak symbol (were supported, ie GCC on linux) for
some kind of forward compatibility.

Fixes T1780

@feature
2016-08-16 16:14:21 +09:00
Cedric Bail 914043d567 eina: test safepointer in the correct range for 32bits system.
The generation counter on 32bits system is on 8bits, obviously 1024
is more than that.

T4265
2016-08-02 15:35:15 -07:00
Stefan Schmidt b56bf67f56 tests: eina: comment out unused test to avoid warning
Just to avoid the unused function warning.
2016-07-29 14:55:10 +02:00
Felipe Magno de Almeida 949af55947 eina: Add support for eina_safepointer in promises 2016-06-11 10:40:27 -03:00
Cedric BAIL 1d3cfc0aff eina: reenable all tests that where wrongfully disabled. 2016-06-10 14:10:13 -07:00
Cedric BAIL edc753d1a2 eina: add tests suite for Eina_Safepointer. 2016-06-10 14:09:41 -07:00
Lauro Moura 46843551c0 eina: Remove value type promises
All values in promises are now considered as by-pointer.
2016-06-09 22:38:54 -03:00
Lauro Moura 3b090b808b eina: Fixes on promises behavior when cancelling
- Free the cancel callbacks on promise delete
- Cancelling an ended promise should be a nop
- More tests to increase coverage
2016-06-09 19:14:14 -03:00
Lauro Moura 47dea6abc1 eina: Avoid promise early deletion when cancelled.
Cancelling a promise will fulfill it but won't actually free the memory. This
memory is under custody of the owner, who must either call value_set or
error_set to finish it.
2016-06-06 03:09:40 -03:00
Lauro Moura b28f6f2fce eina: Fix promise tests and avoid early deletion
- Progress notify refcount fixes, avoiding early deletion
- Avoid leaking memory on tests
2016-06-05 21:58:19 -03:00
Felipe Magno de Almeida e98c57d9d4 eina: Remove more Eina_Promise* parameter in promise callback
Remove not very useful parameter to eina_promise_then callbacks.
2016-06-03 18:37:21 -03:00
Felipe Magno de Almeida 8fec0d5139 eina: Remove unnecessary indirection to promises
Now when dealing with pointer types, we will not get pointer to
pointer semantics in callbacks and eina_promise_owner_value_set
for Eina_Promise.

It will work as expected:

Eina_Promise_Owner* promise = eina_promise_add();

void* p = malloc(sizeof(T));
eina_promise_owner_value_set(promise, p, &free);
2016-06-03 17:22:12 -03:00
Felipe Magno de Almeida 28bc891925 eina: Fix new prototype for then cb in test
Added Eina_Promise* parameter to function prototypes
2016-05-26 13:35:07 -03:00
Carsten Haitzler a1a2bc5017 eina test suite - ooops reenable tests
accidentally snukc in commented disables in test suite as i was
hunting why eina test suite crashes while dealing with feedback on my
compare fixes etc.
2016-05-26 13:03:01 +09:00
Carsten Haitzler 7ee4eba33f efl - new cmp "fix" code - remove one duplicated cmp 2016-05-26 12:49:58 +09:00
Felipe Magno de Almeida de9be13d45 eina: Add promise parameter to then calllbacks
Added promise parameter to then callbacks so callbacks can steal
ownership of the value from the promise.
2016-05-25 21:32:03 -03:00
Jean Guyomarc'h 147ef32b2b efl: fix misleading indentation
GCC's -Wmisleading-indentation is complaining...
It is a warning flag introduced in GCC 6.x, and
is enabled by -Wall.
2016-05-18 21:57:02 +02:00
Carsten Haitzler 8de2ba5d47 eina test suite vector - make correctness range 2x as big
make correctness rand 2 * DBL_EPSILON due to compilers, fastmath and
being a little inaccurate sometimes at the bottom end of precision.

@fix
2016-05-18 02:02:45 +09:00
Felipe Magno de Almeida 1c5ce16565 eina: Add eina_promise_race composition function
Added eina_promise_race function that composes multiple
promise objects into a new promise which is fulfilled
when one of the promises are fulfilled, or fails
when one of the promises have failed.
2016-05-09 19:10:26 -03:00
Felipe Magno de Almeida 6d43adaaf4 eina: Fix memory leaks in promise 2016-05-07 13:55:18 -03:00
Felipe Magno de Almeida 236c13df34 eina: Add progress notify callback feature for Promise Owners
Add a way for users of the promise owner to get notified when a
promise progress is registered. Also added a convenience composition
function that creates a promise which is fulfilled when another
promise has a progress notification.
2016-05-06 12:41:42 -03:00
Carsten Haitzler 1bf509548c eina value test - gix blob check to check only relevant fields
the value check for blobs was checking unused fields in a union and
thats just bad. check only fields that matter to the blob.

@fix
2016-04-19 16:33:33 +09:00
Felipe Magno de Almeida 35dd5b5cab eina: Fix promise error with eina_promise_all
Fix value_set and error_set signatures which were receiving a
owner. They actually receive the promise and not the owner, this
caused wrong access to memory and were not visible by warnings because
the functions are casted.

This problem caused errors in which it seemed that promise had
actually error'ed when questioned it.
2016-04-13 14:44:19 -03:00
Tom Hacohen de1a7759fa Eina matrix/vector tests: pass correct pointers to arrays.
Clang (rightfully) complained about passing double ** where we should have
passed a double *.
2016-04-12 15:45:10 +01:00
Felipe Magno de Almeida 1d314828f7 eina: add tests for promises 2016-04-05 11:35:12 -07:00
Oleksandr Shcherbina 48f75713e5 eina: fix eina vector in case output vector the same as target vector
Summary:
Use aditional temporary vector for intermedia results in case output vector
the same as target vector in functions:
eina_vector2_transform,
eina_vector2_homogeneous_direction_transform,
eina_vector3_cross_product,
eina_vector3_transform,
eina_vector3_homogeneous_direction_transform
It was in original version (in evas_vecN, module evas_3d_utils.h)
Enrich test suit for this case.

Reviewers: jpeg, cedric

Reviewed By: cedric

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2016-03-15 11:20:55 -07:00
Vivek Ellur d8166c7507 eina_strbuf: add test cases for eina strbuf prepend functions
Summary:
Added test cases for eina_strbuf_prepend_printf and eina_strbuf_prepend_vprintf
functions

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: raster, jpeg, cedric

Subscribers: seoz, jpeg, raster, cedric

Differential Revision: https://phab.enlightenment.org/D3163
2016-02-17 14:33:59 -08:00
se.osadchy a1584c8a5d evas: Update eina_vector, add new function.
Summary: Add direction transform for eina_vector3.

Reviewers: cedric, Hermet, jpeg

Reviewed By: jpeg

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D3692
2016-02-17 16:12:35 +09:00
Vincent Torri 1b143f233e Test rework #10: Eina
mainly minor stuff: whitespaces, order of includes, ... Just don't fear the number
of changed files :-)
2016-02-16 12:41:06 +00:00
se.osadchy acd0af9ec6 eina: add tests cases for eina_vector3.
Summary: Add tests for functions of vector3 in eina.

Reviewers: cedric, Hermet

Subscribers: jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-02-12 21:25:55 +01:00
Mike Blumenkrantz 2c72709d65 eina: add test covering tiler rect add/del/add of same geometry regions
ref ec2ec3e9d13f64b5a4792717204deb59eb9d4caa
2016-02-05 14:35:28 -05:00
Jean-Philippe Andre 0402b5fd12 Ecore: Remove all temporary files after running make check 2016-01-19 18:18:29 +09:00
Jean-Philippe Andre d9460afcdc Eina: Add proper test case for eina_mk[ds]temp 2016-01-19 18:18:29 +09:00
Jean-Philippe Andre 7832bab253 Eina: Convert eina_test_file.c to UTF-8
It was encoded as ISO-8859 (Latin-1) before.
Maybe this will break these checks on Windows, but all of EFL APIs take
UTF-8 strings, so it doesn't make sense to have ISO-8859 here.
2016-01-19 18:18:29 +09:00
Oleksandr Shcherbina c36c4e246c eina_test: Add test-case for eina_quaternion_transform
Reviewers: stefan_schmidt, cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D3568
2016-01-14 11:51:45 +01:00
se.osadchy 5e0c1b7cc6 eina: add all test cases for eina_vector2.
Summary: All tests passes for eina_vector2 functions.

Reviewers: cedric, stefan_schmidt

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D3565
2016-01-13 17:30:50 +01:00
Oleksandr Shcherbina f2e9a29a0d eina: Add test-case for eina_normal3_matrix_get
Summary: Test case fail, need apply that D3563

Reviewers: cedric, Hermet, stefan_schmidt

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D3564
2016-01-13 14:14:50 +01:00
se.osadchy 9e00bd01a1 eina: add test case for eina_vector2
Summary: Create eina_test_vector and add first test case.

Reviewers: cedric, stefan_schmidt

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D3560
2016-01-13 13:46:49 +01:00
Srivardhan Hebbar 26ffe0d55c eina: add test case for eina_strbuf_manage_read_only_new_length API.
Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: jpeg, cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-01-09 00:33:51 +01:00
Cedric BAIL bb921aff04 emile: move all eina_str_base64 to emile_base64. 2016-01-07 16:27:57 -08:00
Srivardhan Hebbar b598f8eb73 eina: Updated testcases of strbuf_substr_get.
Summary:
Fixes T2949.

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric, jpeg

Reviewed By: jpeg

Maniphest Tasks: T2949

Differential Revision: https://phab.enlightenment.org/D3460
2016-01-07 15:35:18 +09:00
Srivardhan Hebbar 39dcf0e55a eina: add test case for eina_base64url_decode API.
Summary:
Depends on D3521

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-01-04 15:42:59 -08:00
Vincent Torri 1921055644 Eina test: fix warning
Reviewers: jpeg

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3465
2015-12-18 16:48:34 +09:00
Srivardhan Hebbar 9f99213723 eina: Added testcase for base64url encoding API.
Summary:
Depends on D414

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: jpeg, cedric

Differential Revision: https://phab.enlightenment.org/D3432
2015-12-16 16:11:28 +09:00
Vincent Torri 6b368eb127 Eina test: declare clock_gettime() by including time.h, like it should be 2015-12-14 11:14:46 +09:00
Vincent Torri 70b805be46 Eina test strbuf: the macro TEXT already exists on Windows so rename it to TEST_TEXT 2015-12-14 11:14:34 +09:00
Vincent Torri 2b20e3e21b Evas example: fix warning
Summary:

Test Plan:

Reviewers: cedric

Subscribers:
2015-12-14 11:14:28 +09:00
Felipe Magno de Almeida 5d4038d74d eina: add EINA_VALUE_TYPE_OPTIONAL, a single-element container that can be empty.
Eina Value Optional can be used to create a eina value that can be set
or be empty and can be embedded in a eina_value_struct.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-10 11:10:46 -08:00
Srivardhan Hebbar 4103f38eed eina: Adding test case for base64 decode function.
Summary:
Depends on D3381

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric, jpeg

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D3382
2015-12-10 16:50:11 +09:00
se.osadchy 82504d9d77 evas: recognize duplicated data structure with eina_quternion and ector.
Summary:
Move data structure and functionality to eina_quaternion from evas_vec4.

Reviewers: raster, Hermet, cedric

Subscribers: jpeg, Oleksander

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-07 16:36:16 -08:00
Srivardhan Hebbar 05cfb0604c eina: Updated test case to test more scenario.
Summary:
The test cases which I took from wikipedia didn't have the characters
'/' and '+' in the encoded string. So added test case testing these.

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3405
2015-12-07 19:29:36 +09:00
Vincent Torri 0497b9685c efl: add binary mode to open() calls
This allows better compatibility with Windows

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-05 21:06:04 +01:00
Subhransu Mohanty 8212f2aee3 eina: add new api eina_bezier_on_interval()
I couldn't come up with a better name, if anyone has a suggestion.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-30 15:40:01 -08:00
Daniel Hirt 89ef4b70b8 Eina unicode: add eina_unicode_unicode_to_utf8_range
Required some special treatment to get words (substring) out of an
input Unicode string to a utf8 one. This saves the trouble converting
the whole string: you input an offset in the Eina_Unicode array, and
provide the required length. That's is, now you can extract words and
whatnot in utf8 form.

To save code I wrapped the original one to get the whole length.
2015-11-24 14:22:57 +02:00
Cedric BAIL 6dcd22711f eina: simplify tests logic for base64. 2015-11-23 11:57:28 -08:00
Yeshwanth Reddivari b3a917563c Eina Example: Fix memory leak of variable buf
Summary: Fix memory leak of buf in eina_test_simple_xml_parser.c as reported by static analysis tool, Cppcheck.

Reviewers: singh.amitesh, Hermet, jpeg

Reviewed By: jpeg

Subscribers: alok25, mvsovani, sachin.dev, cedric

Differential Revision: https://phab.enlightenment.org/D3371
2015-11-23 21:04:15 +09:00
Srivardhan Hebbar 11a4db1261 eina: test case for base64 encoding function.
Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-22 23:28:09 +01:00
Subhransu Mohanty 07bb5483b4 eina: added bounds_get api to Eina_Bezier
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-22 23:28:09 +01:00
Srivardhan Hebbar 252e703e2a eina: add test case for eina_strbuf_substr_get.
Summary:
Depends on D3224

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-10 15:01:17 -08:00
Vivek Ellur 46777274fe eina: add test case for binbuf append function
Summary:
Added test case for eina_binbuf_append_buffer function

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-10 14:44:17 -08:00
Vivek Ellur 873562608e eina: add test case for file statat function.
Summary:
Added test case for eina_file_statat function

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-09 16:26:23 -08:00
Vivek Ellur 7fa841236b eina: add test case for eina list search function.
Summary:
Added test case for eina_list_search_sorted function

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-09 16:22:24 -08:00
Vivek Ellur 4f6e158c13 eina: add test case for list data idx function.
Summary:
Added test case for eina_list_data_idx function

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3287
2015-11-09 16:20:23 -08:00
Vivek Ellur 6bf43179cd eina: add test cases for eina list move functions
Summary:
Added test cases for eina_list_move and eina_list_move_list functions

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-09 16:19:02 -08:00
Vivek Ellur fec6bd3fef eina: add test case for list demote function
Summary:
Added test case for eina_list_demote_list function

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-09 16:18:07 -08:00
Vivek Ellur f06eedf3c3 eina: add test case for eina list reverse iterator
Summary:
Added test case for eina_list_iterator_reversed_new function

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-09 16:17:26 -08:00
Vivek Ellur b5e672aad8 eina: added test case for matrix4 transpose function
Summary:
Added test case for eina_matrix4_transpose function

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-09 16:16:07 -08:00
se.osadchy 3d77f55f91 evas: refactor duplicated data structure with eina_matrix.
Summary: Move data structure and functionality to eina_matrix from evas_mat.

Reviewers: raster, Hermet, cedric

Subscribers: Oleksander, cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-09 15:27:26 -08:00
Shilpa Singh 0c1bb7d7b3 eina: add API eina_strftime
Summary:
Add new API eina_strftime API in eina_str

@feature

Test Plan: test case and example also updated

Reviewers: tasn, cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-09 12:42:50 -08:00
Shilpa Singh 297ea39a5c eina: add eina_tmpstr_manage_new, eina_tmpstr_manage_new_length APIs
Summary:
Add eina_tmpstr_manage_new, eina_tmpstr_manage_new_length APIs, these APIs create new tmpstr but reuse the input string memory.

@feature

Test Plan: Test case and example updated

Reviewers: tasn, cedric

Reviewed By: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-09 10:42:35 -08:00
Cedric BAIL e45b801577 eina: fix computation of sqrt near 1.
This is still not so good below 1.

@fix
2015-11-09 10:42:35 -08:00
Srivardhan Hebbar 01eaa7a9cc eina: add test case for eina_strbuf_tolower API.
Summary:
Depends on D3200
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-09 10:42:35 -08:00
Vivek Ellur 85f8daac6d eina_hash: add test cases for eina_hash_add/del by hash functions
Summary:
Added test cases for eina_hash_add_by_hash/del_by_hash functions

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-31 02:12:06 +01:00
Vivek Ellur dc391da424 eina_quaternion: add test case for rotation function
Summary:
Added test case for eina_quaternion_rotate function

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-31 02:12:06 +01:00
Vivek Ellur 6090073dee eina_quaternion: add test cases for quaternion rotation functions
Summary:
Added test cases for eina_quaternion_f16p16_rotate and
eina_quaternion_f16p16_rotation_matrix3_get functions

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-31 02:12:06 +01:00
Vivek Ellur ccd7c2b014 eina_quaternion: add test cases for interpolation functions.
Summary:
Added test cases for quaternion_lerp, quaternion_slerp and quaternion_nlerp
functions

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-22 12:24:08 -07:00
Vivek Ellur ac3358b618 eina: add test cases for f16p16 quaternion interpolation functions
Summary:
Added test cases  for f16p16 lerp, slerp and nlerp functions

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-22 12:17:20 -07:00
Vivek Ellur 2136ad5ecb eina_tiler: add test cases for eina tiler area set/get functions
Summary:
Added test cases for eina_tiler_area_size_set and get functions

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-12 14:01:23 -07:00
Stefan Schmidt b841997691 eina tests: disabling eina_test_matrix_quaternion which fails for over a week
This fails on nightly_efl_gcc_x86 (32bit) for over a week now blocking all other
nightly builds and tests. Inside the test case there is already something
disabled which meantions problems with rounding. MAybe the same problem here.

Reported as T2701 to keep track of it an enable again once fixed.

ref T2701
2015-08-31 08:58:19 +02:00
Subodh Kumar b35d2f9762 Eina rectangle: Check for valid rectangle before taking intersection
Summary:
Check for valid rectangle

If any dst or src rectangle has zero width or height,
intersection should not return true.

@fix

Test Plan: Added test cases

Reviewers: cedric, herdsman, Hermet

Reviewed By: Hermet

Subscribers: shilpasingh, cedric

Differential Revision: https://phab.enlightenment.org/D2990
2015-08-28 16:30:29 +09:00
Cedric BAIL f2e3777a09 eina: add test for decomposition and composition of matrix. 2015-08-21 16:40:31 +02:00
Cedric BAIL 0330717ab2 eina: add tests for eina_matrix4_inverse. 2015-08-21 16:40:31 +02:00
Cedric BAIL 57def1eed0 eina: test eina_matrix4_normalized. 2015-08-21 16:40:31 +02:00
Cedric BAIL c82015d062 eina: our 3x3 matrix are 2D matrix, not 3D rotation matrix. 2015-08-21 16:40:31 +02:00
Vincent Torri c0f85c947b eina: fix direct_ls_simple and ls_simple tests on Windows
See comments in the patch

@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-08-11 17:43:02 +02:00
Subhransu Mohanty 6afb497d91 eina: add test for Eina_Bezier. 2015-08-07 14:33:52 +02:00
Vivek Ellur f3768834c5 eina_quaternion: add forgotten implementation of converting eina_matrix3 to eina_quaternion
Summary:
Implemenation of eina_matrix3_quaternion_get function

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Subscribers: cedric

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

This was a function I forgot to finish implement. Thanks Vivek to take care of it.
As it comes with a test case, is self contained and fix a missing bit of code I will
push it at this point in time of our release process. Sorry everyone for that late push.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-07-28 03:05:37 +02:00
Vivek Ellur df50704764 eina_quaternion: add test cases for various eina quaternion operations
Summary:
Added test cases for scale, multiply, normalize,dot operations for quaternion
Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-07-28 03:05:37 +02:00
Vivek Ellur 309962ed8f eina_quaternion: add test cases for eina f16p16 quaternion functions
Summary:
Added test cases for various operations on eina f16p16 quaternions

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-07-28 03:05:37 +02:00
Daniel Kolesa e3d77abfe7 eina tests, ecore_con tests: fix compiler warnings 2015-07-23 10:39:44 +01:00
Vivek Ellur 68d9c3d6f0 eina: fix failure of eina_quaternion_test.
Summary:
eina_test_quaternion_norm was failing. so fixed it.

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-07-04 02:30:44 +02:00
Vivek Ellur 1155176aa5 eina: add quaternion test in eina suite and fix the test case errors
Summary:
Fixed eina_test_quaternion_conjugate and eina_test_quaternion_matrix which
were failing and also added the quaternion test in eina suite

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-06-29 14:56:23 +02:00
Vivek Ellur 70e5687f6c eina: add test cases for eina matrix map and transform functions
Summary:
Added test cases for matrix map and transform functions

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: stefan_schmidt, cedric

Reviewed By: stefan_schmidt, cedric

Subscribers: stefan_schmidt, cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-06-25 17:21:09 +02:00
Vivek Ellur f2606fe151 eina_matrix: Added test cases for fixed point matrix functions
Summary:
Added test cases for all the functions related to fixed point matrix

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2701
2015-06-16 17:47:29 +02:00
Vivek Ellur 02d825f116 eina: add test cases for various eina_matrix operations
Summary:
Added test cases for various operations of 3*3 matrix

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-06-15 09:06:35 +02:00
Vivek Ellur 81b52fb0ec eina: add test cases for eina_matrix3 APIs
Summary:
Added test cases for eina_matrix3_values_get, eina_matrix3_values_set,
eina_matrix3_equal, eina_matrix3_type_get APIs

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-06-04 10:32:18 +02:00
Cedric BAIL 0acf23857f eina: beginning of a generic quaternion API. 2015-05-29 17:20:29 +02:00
Cedric BAIL 9a83100a4a eina: add the beginning of an Eina_Matrix4 API. 2015-05-29 17:20:28 +02:00
Vivek Ellur 331068b84a eina: add test cases for various APIs in eina_quad module.
Summary:
Added test cases for all the APIs in einq_quad module

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-05-27 00:31:06 +02:00
Vivek Ellur 6c33bbfa80 eina: add tests cases for eina_rectangle and eina_str functions
Summary:
Added test cases for eina_rectangle_union and eina_streq functions

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-05-19 14:17:00 +02:00
vivek be5eb3f2de eina: add test case for eina_file_copy function.
Summary:
Added test case for eina_file_copy function to check copying of two files

Signed-off-by: vivek <vivek.ellur@samsung.com>

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-05-18 10:52:57 +02:00
Vivek Ellur c3a644acff eina: add test cases for various eina_inarray functions
Summary:
Added test cases for eina_inarray_search, eina_inarray_search_sorted,
eina_inarray_foreach_remove and other functions

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-05-14 19:36:32 +02:00
vivek edfd621d06 eina: add test case for eina_hash_crc function.
Summary:
Added test case for eina_hash_crc function which uses crc32 for hashing
algorithm

Signed-off-by: vivek <vivek.ellur@samsung.com>

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-05-07 09:53:11 +02:00
vivek 48dea34240 eina: add test case for eina_crc function in eina module.
Summary:
I added test cases using seed 0xffffffff, I was not
able to get crc value for different seeds online. Checked some of the links, but they are
using entirely different logic and value was not matching for other seed value.

Signed-off-by: vivek <vivek.ellur@samsung.com>

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-05-07 09:53:09 +02:00