Commit Graph

369 Commits

Author SHA1 Message Date
Mike Blumenkrantz ab37ca4d7b tests: increase step sizes for eina_fp_div and eina_fp_mul tests
fix T6841

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:32 +02:00
Mike Blumenkrantz 594b5f4967 tests: reduce looping in slstr_thread thread callbacks
this works out to the same number of total tests as slstr_many but
now split across all the threads

fix T6846

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:32 +02:00
Mike Blumenkrantz 88436ca89c tests: reduce looping in eina_test_spinlock
no changes to coverage

fix T6845

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:32 +02:00
Mike Blumenkrantz 7819d56da6 tests: add eina_test_hash_int64_fuzze
ref T6844

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:32 +02:00
Mike Blumenkrantz 4ac90511b9 tests: reduce looping in eina_ustringshare_putstuff
fix T6843

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:32 +02:00
Mike Blumenkrantz e8878e19b7 tests: reduce looping in eina_binshare_putstuff test
also slightly increase eina_hash coverage

fix T6843

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:31 +02:00
Mike Blumenkrantz d5583d74ea tests: improve eina_binshare_collision test
remove rand() usage and loop less

fix T6843

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:31 +02:00
Mike Blumenkrantz 7f54a431a3 tests: change eina cmdline test names to match api namespaces
Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:31 +02:00
Mike Blumenkrantz 910db08a6b tests: remove 9900 loop iterations from eina_test_file_thread
no changes in coverage

fix T6842

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:31 +02:00
Mike Blumenkrantz e6c8bf7fbf tests: rework eina hash fuzzing tests
these are supposed to be for testing the finding of values not in the
hash, not basic hash operations

fix T6839

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:31 +02:00
Mike Blumenkrantz 631f506a6f tests: fix mem leak in eina_test_hash_add_del_by_hash
Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:31 +02:00
Mike Blumenkrantz f2dc01a8dc tests: reduce malloc usage in eina_test_hash_extended
ref T6839

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:30 +02:00
Mike Blumenkrantz 947c954141 tests: reformat eina_test_hash.c
no functional changes

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:30 +02:00
Mike Blumenkrantz eabd003b00 tests: use namespacing for eina hash tests
no functional changes

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:30 +02:00
Mike Blumenkrantz 80569fd7a6 tests: use namespacing for safepointer test names
Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:30 +02:00
Mike Blumenkrantz 908ba030bf tests: reduce array size in safepointer tests
this reduces test runtime by ~1.0s while having no effect on coverage

fix T6836

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:30 +02:00
Mike Blumenkrantz 3162240921 tests: simplify eina safepointer tests to be more readable
no functional changes

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:29 +02:00
Mike Blumenkrantz 2bbc300b80 tests: use EINA_C_ARRAY_LENGTH macro in safepointer tests
no functional changes

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:29 +02:00
Mike Blumenkrantz 1f7f7297e3 tests: rework strbuf append/prepend tests
there's no point in iterating this many times; the base step size is 32
and so each loop will only increase the buffer...not at all since it takes
3 loops for the buffer to increase by the step size

verify that the buffer increases and then stop instead of spinning uselessly

fix T6835

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:29 +02:00
Mike Blumenkrantz 0f3f651f81 tests: reformat eina_test_strbuf.c
Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:29 +02:00
Mike Blumenkrantz 26103722be tests: use namespacing for eina strbuf tests
Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:29 +02:00
Mike Blumenkrantz 11d695cfcd tests: improve eina_test_list_shuffle
reduce iteratons by a hundredfold, remove verifying of rand() seed,
check whether shuffle actually shuffles

fix T6833

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:29 +02:00
Mike Blumenkrantz 8ca6102f62 tests: rename eina_list tests to use list namespace for readability
Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:28 +02:00
Mike Blumenkrantz 05edb41388 tests: remove sleep calls from eina_barrier_test_simple
the timing does not matter for these tests, so there's no point in
randomly waiting longer and delaying build completion

fix T6832

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:28 +02:00
Mike Blumenkrantz 5427cd31d1 tests: improve coverage in eina_rbtree_fuzzy test
Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:28 +02:00
Mike Blumenkrantz 0683552037 tests: simplify eina_rbtree_fuzzy test and speedup by infinity%
this test is to try and match values in a tree which have not been
inserted, so remove irrelevant insert/remove operations as well as
insane looping

fix T6830

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:28 +02:00
Mike Blumenkrantz f176c86b09 tests: greatly reduce iterations for eina_rbtree_remove test
this has no bearing on coverage, so there is not much point in uselessly
iterating here

ref T6830

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:28 +02:00
Mike Blumenkrantz 391ebf9cff tests: reduce malloc calls in eina rbtree tests
ref T6830

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:28 +02:00
Mike Blumenkrantz 5f55a07f8a tests: rework eina inlist tests to be infinity% faster
coverage currently at ~95%

fix T6829

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:27 +02:00
Mike Blumenkrantz 97b76bd35a tests: redo eina in-tree module loading
this performs an eina init/shutdown check and loads available modules
before running remaining tests

note that this still does not work and may never have worked because
PACKAGE_BUILD_DIR is broken

ref T6812

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:26 +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 730020c7d4 tests: remove duplicated eina mempool test
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
Marcel Hollerbach 07d54832e5 eina: this should only load modules from the eina subdir
otherwise we are loading ecore modules etc. which are pulling in ecore
et. into the eina testsuite, nothing that should happen.
2018-03-27 17:41:44 +01:00
Lauro Moura bda5a0dd4a eina: Change assert_ptr_null to asset_ptr_eq(null)
Summary:
Again, ptr_null/nonnull were added in check 0.11, while we depend on
0.9.10.

Test Plan: Run make check

Reviewers: marcelhollerbach, cedric, felipealmeida

Reviewed By: felipealmeida

Differential Revision: https://phab.enlightenment.org/D5820
2018-02-22 20:42:21 -03:00
Marcel Hollerbach 7165003bc6 introduce eina_vpath!
Its the successor of efl.vpath, the api is synchronous, and supports
addtional vpath paths, new apis cal always be added to use them.
2018-02-22 09:26:55 +01:00
Vincent Torri 4a6d32b352 eina tests: add missing semicolumn
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2018-01-31 11:07:35 -08:00
Vincent Torri 9f59009131 Eina test: delete tempory file on Windows in eina_test_file_mktemp 2018-01-30 16:52:24 +09:00
Andy Williams 9a4eedb078 Remove all ocurrences of SPANK from our user facing errors.
This has been bugging me for some time but now we are triggering new errors internally
this is appearing to end users for problems they did not cause.

Additionally I was able to improve a couple of the errors by copying the
explanation from code comments into the error message.

Shorter error logs now too :)
2017-12-22 11:18:46 +00:00
Cedric Bail 377a685619 eina: this was actually a used variable. 2017-10-13 12:58:01 -07:00
Prince Kumar Dubey 1235459ed3 efl: unused variable removed, removing local variable assignment which has no use at all.
Reviewers: raster, cedric

Reviewed By: cedric

Subscribers: rajeshps, jpeg

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-13 12:11:45 -07:00
Amitesh Singh 00ba7b1b6f tests: eina strbuf - fix compilation
refer patch 2cf24eb304
2017-10-13 16:11:00 +09:00
Amitesh Singh 2cf24eb304 eina: strbuf - Add strftime related functions
eina_strbuf_append_strftime()
eina_strbuf_insert_strftime()
eina_strbuf_prepend_strftime() - macro

We need these functions for implementing generic format function
interface especially for calander.

Ref T6204
2017-10-13 16:04:24 +09:00
Vincent Torri 0cdd501246 EFL For WIN32: Replace HAVE_EVIL define with _WIN32 2017-09-22 05:06:10 -05:00
Jean-Philippe Andre 05c051405e eina file: Ensure populate is safe to call
This makes sure that the call to madvise is safe. On Linux it's not too
much of an issue as checks are made inside madvise, and the worst that
can happen is an error is returned (EINVAL). Not great.

But if MAP_POPULATE is not present, as is the case on *BSD, then the
internal function _eina_file_map_populate() is used for the populate
rule. In that case actual data is read and we should make sure not to
trigger a segfault or bus error.

Also, this makes sure that in case of HugeTLB we actually populate all
pages, rather than one page out of 8 (we were jumping by 16Mb instead of
2Mb).

Note: Can we get the size of a HugeTLB at runtime? We're assuming 2Mb
which might very well not be the case!
See: https://wiki.debian.org/Hugepages

Tested by disabling MAP_POPULATE and observing crashes :)

@fix
2017-09-18 11:58:53 +09:00
Cedric BAIL 024c6a9fc3 efl: silent warnings shown on solaris due to missing header files. 2017-09-14 09:59:02 -07:00
Cedric Bail cacd374e41 eina: add tests for eina_value_to_binbuf. 2017-09-13 17:26:26 -07:00
Guilherme Iscaro 6cbfe100d5 Eina_Value type EINA_value. 2017-08-23 18:32:13 -03:00
Cedric BAIL f4f926f2bd eina: remove tests and benchmark for long dead mempool. 2017-08-15 13:46:38 -07:00
Cedric BAIL b94390a6aa eina: add tests for from. 2017-08-15 13:46:38 -07:00
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