Commit Graph

369 Commits

Author SHA1 Message Date
Mike Blumenkrantz 20b592cef7 fix various trivial null derefs
Summary:
CIDs 1401081, 1401044, 1400983, 1400960, 1400927, 1400799, 1396946, 1396944,
     1383851, 1383847, 1382211, 1379921, 1379921

Reviewers: cedric

Reviewed By: cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10452
2019-10-18 13:30:10 -04:00
Mike Blumenkrantz 8cef6a9724 tests: fix minor string leaks
Summary: CIDs 1404754, 1401022, 1400965

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10405
2019-10-18 13:29:13 -04:00
Mike Blumenkrantz 7e7465379f tests/eina: fix assign when compare was intended
Summary: CID 1400858

Reviewers: lauromoura

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10396
2019-10-15 11:21:42 -03:00
Mike Blumenkrantz 88da46d3f6 tests/eina: outdent code
Summary:
this is a very important coverity issue.

CID 1400838
Depends on D10205

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10206
2019-09-26 17:59:34 -04:00
Mike Blumenkrantz 2584adae08 tests/strbuf: call va_end for varargs
Summary: CID 1400792

Reviewers: brunobelo

Reviewed By: brunobelo

Subscribers: brunobelo, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10204
2019-09-26 17:59:24 -04:00
Cedric Bail 9382bfc0bc eina: add eina_mempool_iterator_new to slowly iterate every allocated pointer in a mempool.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9941
2019-09-19 14:37:41 -07:00
Cedric Bail 93a382085b eina: turn on Eina_Mempool tests for OneBig too.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9940
2019-09-17 10:24:07 -07:00
Ali Alzyod 080f75e8c9 eina_test: resolve build warning
Differential Revision: https://phab.enlightenment.org/D9781
2019-08-29 14:43:48 +02:00
sub.mohanty@samsung.com 5bd95c9850 eina/array: added eina_array_find() api to eina_array.
Summary: updated test suite for testing the api.

Reviewers: zmike, Hermet, cedric, segfaultxavi

Reviewed By: zmike, segfaultxavi

Subscribers: segfaultxavi, ProhtMeyhet, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9734
2019-08-26 08:31:08 -04:00
Vincent Torri a6ade14c5e Evil: remove pwd code in Evil and fix compilation failures after the removal
Summary: remove pwd code in Evil

Test Plan: compilation

Reviewers: zmike, cedric, raster

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9420
2019-07-28 09:27:27 +01:00
Marcel Hollerbach 223a433be8 eina: add accessors for c arrays
This adds a new API which can be used to get access to a carray via the eina_accessor API.
2019-07-03 07:41:05 +02:00
Vincent Torri 3ddbda1266 remove last bits of Evil.h in tests and use evil_private.h instead
Test Plan: compilation

Reviewers: zmike, raster, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9154
2019-06-24 09:01:25 -04:00
Vincent Torri ba22016c4c tests: fix warnings and undef ref on Windows (using meson :-) )
Summary: we need to include evil_private.h so that some symbols are declared

Test Plan: compilation

Reviewers: raster, zmike, cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9129
2019-06-20 12:50:35 +01:00
Cedric BAIL 075d655a19 eina: add test for eina_slstr_copy_new_length.
Summary: Depends on D8800

Reviewers: zmike

Reviewed By: zmike

Subscribers: zmike, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7832

Differential Revision: https://phab.enlightenment.org/D9016
2019-05-29 13:49:36 -04:00
Mike Blumenkrantz 7c7998b3dc meson: enforce 61s timeout for tests, remove explicit timeouts from build files
unit tests automatically abort with info after 60s, and tests should be run with
an appropriate timeout to avoid conflict with the test runner's default 30s timeout

set explicit timeout in eio test for now because there's still frequent bugs here

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8894
2019-05-15 18:49:51 +02:00
Marcel Hollerbach f417fb26e8 Revert "remove vpath test for user dir the test was broken and fixing is insane"
Summary:
This reverts commit 954a534bc0.

It appears that the concerns from this commit are invalid. The case of
~asdf/ does not have any fallback case, if there is no getpwent on this
system, then there will be simply an error, same for the case of a
missing user. In such a case nothing will be written in the buffer /
returned by eina_vpath. The windows build problem can be
fixed by a simple #ifdef'ing the test code.

Reviewers: raster, zmike, cedric, vtorri

Reviewed By: vtorri

Subscribers: vtorri, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8671
2019-05-15 09:49:48 -04:00
Carsten Haitzler a8d1c7d8ad eina - value - test - cats warnings on 32bit to get some silence
longs will be truncated on 32bit in these tests so be explicit to not
have warinings.

note - eina value tests are broken on 32bit anyway already - the
conversions to/from long types are broken and fail. this doesn't fix
that.
2019-05-13 14:27:00 +01:00
Cedric BAIL c75415ae36 eina: add tests for the new Vpath syntax.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8884
2019-05-11 08:52:09 -07:00
Christopher Michael 2336decbe0 eina_test_strbuf: Fix resource leak
Summary:
Coverity reports that we leak storage that 'buf' points to because we
are reassigning the variable, so lets free the previous strbuf so we
don't leak.

Fixes CID1400952

@fix

Depends on D8769

Reviewers: raster, cedric, zmike, bu5hm4n, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8770
2019-05-02 14:11:27 +02:00
Christopher Michael ea56b2aa33 eina_test_tiler: Fix resource leak
Summary:
Coverity reports that reassigning 't' here leaks the storage that t
points to, so free the previous eina_tiler before reassigning the
variable.

Fixes CID1401068

@fix

Reviewers: raster, cedric, zmike, bu5hm4n, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8762
2019-05-02 14:11:12 +02:00
Christopher Michael c380c496dc eina_test_ustr: Fix resource leak
Summary:
Coverity reports that we leak 'buf' here so add a call to free

Fixes CID1400784

@fix
Depends on D8781

Reviewers: raster, cedric, zmike, bu5hm4n, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8782
2019-05-02 13:48:27 +02:00
Christopher Michael f537164024 eina_test_file: Fix resource leak
Summary:
Coverity reports that we leak 'path' here, so free the returned string

Fixes CID1400926

@fix
Depends on D8771

Reviewers: raster, cedric, zmike, bu5hm4n, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8772
2019-05-02 13:47:28 +02:00
Christopher Michael ae61295e9a eina_test_binbuf: Fix memory leak
Summary:
Coverity reports that we leak 'test_buf' here so add eina_binbuf_free
to plug the leak

Fixes CID1401004

@fix
Depends on D8764

Reviewers: raster, cedric, zmike, bu5hm4n, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8765
2019-05-02 13:44:22 +02:00
Christopher Michael a2e8747ec8 eina_test_file: Fix memory leak
Summary:
Coverity reports that we leak big_buffer here, so lets free it.

Fixes CID1401072

@fix

Reviewers: raster, cedric, zmike, bu5hm4n, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8759
2019-05-02 13:40:43 +02:00
Carsten Haitzler 2178258105 tests - remove one of the eina strtod tests as libc is failing
see the comments above the test explaining why it's removed (libc
fails, not eina and having our tests fail because eina is a bit more
robust than libc is not a sane thing to have). but here is the comment
for git history spelunking:

this test isn't viable because libc actually fails the conversion (testing
glibc 2.28 on arch linux). either libc doesn't like the space at the start
thus doesn't skip it but assumes END of numbver string thus not converting
and returning NULL, or it doesn't like InFiNiTyfoo in some way, but either
way this test shows eina to be more robust and do some kind of conversion
and libc to fail and return NULL from strtod into the string pointer. it
also doesnt return an infinite fp thus hitting the default: case and thus
failing etc. ... so all in all remove the test as all it does it cause
failures and if anything shows libc to be failing more than eina.

@fix
2019-04-07 14:47:35 +01:00
Carsten Haitzler 954a534bc0 remove vpath test for user dir the test was broken and fixing is insane
so this test fails on windows as getuid isn't there... so this fixes
the windows bild: fix T7728 ... but it also would have failed if $HOME
didn't match what was in the passwd file, and other fallback cases if
they were triggered.

but ... to make this test stay it would have to also change the logic
- check $HOME env first, then pwent entry, if that fails /tmp/UID and
if that fails use /tmp ... the test would effectively be a copy &
paste of the vpath code at which point this is really pointless where
testing is copying the exact (or almost exat) same code into the test.
this is ignoring the #ifdef fun of martching ifdefs that vary on
windows.

the problem is this kind of api is defined very much by the system it
runs on and the environment and situation, so the test has to be as
complex. realistically, instead of copying & pasting the code across
and now having 2 bits of code to possibly mantain (change the lib src
then the test needs changes too as it's a copy & paste), it's just
saner not to have a test for this kind of siutation and accept the
reality of the situation.

@fix
2019-04-07 13:18:25 +01:00
Vincent Torri 8a7cb97e02 Eina: implement strtod in C locale and remove linkl against msvcr100.
Summary:
This fixes compilation on Windows

More precisely edje_cc could not compile emotion edc files, so it was a runtime problem
because of msvcr100 link.

Add more tests than before

Test Plan: compilation

Reviewers: raster

Subscribers: zmike, stefan_schmidt, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7926
2019-02-28 14:36:42 +01:00
Cedric BAIL e863a3d28a eina: add tests for the new Eina_Value convert functions.
Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D7651
2019-01-23 10:54:07 -08:00
Cedric BAIL d4ab211968 eina: add tests for Eina_Value utility function eina_value_*_get.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7649
2019-01-23 10:54:03 -08:00
Marcel Hollerbach e43f090265 cmake: remove!
This build was never complete and also was not maintained probebly.

It is also dropped in favour of meson which is cool, merged, works & is fast.

Differential Revision: https://phab.enlightenment.org/D7010
2018-12-20 20:07:26 +01:00
Marcel Hollerbach 6c8cebf403 Revert "Revert "eina: add locale-independent eina_convert_strtod_c function""
This reverts commit ddd2638758.
2018-12-05 11:17:53 +01:00
Carsten Haitzler ee7a97d898 eina iterator tests - use same unisnged ints to store - warn
use unsigned ints to we have no more wantings about signed compares
2018-12-04 08:24:02 +00:00
Stefan Schmidt ddd2638758 Revert "eina: add locale-independent eina_convert_strtod_c function"
This reverts commit bef1c5cc43.

The commit breaks the build on macos. I gave it soem time to get fixed
up quickly, but its late Friday night in Korea now and this is unlikely
to get fixed until Monday. Revert here until fixed.

./src/lib/eina/eina_private.h:158:1: error: unknown type name 'locale_t'

https://travis-ci.org/Enlightenment/efl/jobs/461790674
2018-11-30 15:30:01 +01:00
Youngbok Shin bef1c5cc43 eina: add locale-independent eina_convert_strtod_c function
strtod's behavior is changed by system locale.
http://man7.org/linux/man-pages/man3/strtod.3.html
https://en.wikipedia.org/wiki/Decimal_separator

Because of this, strtod(0.5) returns 0.0 in some locales.
When a given value string is locale-independent, strtod has to be
replaced to eina_convert_strtod_c function.
Internally, it calls strtod_l function with "C" locale.

@feature

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Reviewed-by: Vincent Torri <vincent.torri@gmail.com>
Differential Revision: https://phab.enlightenment.org/D6644
2018-11-29 16:15:59 -08:00
Cedric BAIL aac7d099a1 eina: add tests for eina_multiple_iterator_new.
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D7287
2018-11-23 10:13:56 -08:00
Cedric BAIL a8f520188a eina: add test for Eina_Iterator over pure C array.
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D7285
2018-11-23 10:13:52 -08:00
Carsten Haitzler 96228d3c22 eina test - fix build with magic debug disabled 2018-11-12 17:05:46 +00:00
Carsten Haitzler dd677aa2f6 eina file test - warn - silence wanring wirth a bit of hand str trunc
truncation is intended. the way i can find to silence the warning is
use memcpy with a manually computed size...
2018-11-09 12:18:59 +00:00
Carsten Haitzler f447bc1316 eina iterator test - warn - fix prototype of cb func to have right params
fix warning. wrong func prototype for cb... ad void *data param at end.
2018-11-09 11:43:59 +00:00
Carsten Haitzler ba372625a9 eina magic debug test - fix xarnings about double-defining
only domagic debug test if magic debug is enabled, otherwise have no
test. fixes warning
2018-11-09 11:43:59 +00:00
Carsten Haitzler b4f9021e55 eina strbuf tests - fix tests to properly check fail unless conditions
the contiions were wrong - warnings picked it up. fix.
2018-11-09 11:43:59 +00:00
Marcel Hollerbach 46d464e5bf here comes meson
a new shiny buildtool that currently completes in the total of ~ 4 min..
1 min. conf time
2:30 min. build time
Where autotools takes:
1:50 min. conf time
3:40 min. build time.

meson was taken because it went quite good for enlightenment, and is a traction gaining system that is also used by other mayor projects. Additionally, the DSL that is defined my meson makes the configuration of the builds a lot easier to read.

Further informations can be gathered from the README.meson

Right now, bindings & windows support are missing.

It is highly recommented to use meson 0.48 due to optimizations in meson
that reduced the time the meson call would need.

Co-authored-by: Mike Blumenkrantz <zmike@samsung.com>

Differential Revision: https://phab.enlightenment.org/D7012
Depends on D7011
2018-10-02 17:22:50 +02:00
Marcel Hollerbach e31ce7b287 eina_vpath: introduce eina_vpath in style of snprintf
Summary:
this can be usefull for later regactor usages.

Depends on D6742

Reviewers: zmike, stefan_schmidt, #committers

Reviewed By: zmike, #committers

Subscribers: #reviewers, segfaultxavi, cedric, #committers, zmike

Tags: PHID-PROJ-55rnlag4d454jfmlmuhu

Differential Revision: https://phab.enlightenment.org/D6743
2018-08-20 12:56:51 -04:00
Mike Blumenkrantz 1c029b8fd9 tests/eina: suppress deprecated api warnings for eina abi test
Reviewers: devilhorns, ManMower

Reviewed By: ManMower

Subscribers: cedric, #reviewers, #committers

Tags: #efl_build

Differential Revision: https://phab.enlightenment.org/D6810
2018-08-14 17:26:08 -04:00
Mike Blumenkrantz b14ef34ab8 tests/eina: make inclusion for define explicit and more compatible
Summary:
signal.h is not included with all build options somehow, making this
a bit unreliable. also check for define existence for random platforms
which don't define this symbol

Reviewers: devilhorns, ManMower

Reviewed By: ManMower

Subscribers: ManMower, cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6535
2018-07-09 13:31:45 -04:00
Mike Blumenkrantz dca39ebec1 tests/eina: disable eina debug signal handling test in non-fork mode
Summary: signal tests can only be used in fork mode or else they just fail

Reviewers: devilhorns

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6477
2018-07-03 12:46:49 -04:00
Mike Blumenkrantz 32cebe903d tests: split a large failure case for eina_file tests to provide more info
Summary:
each failure case should always be separate in order to provide the highest
degree of detail available if a test fails

Reviewers: devilhorns, ManMower

Reviewed By: ManMower

Subscribers: ManMower, cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6373
2018-06-25 15:20:37 -04:00
Mike Blumenkrantz 00bc3af4dd tests: add test for eina_debug signal handling
Summary:
currently this crashes, so add a simple test to ensure that it works
eventually

ref T7028

Reviewers: ManMower, devilhorns

Reviewed By: ManMower

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T7028

Differential Revision: https://phab.enlightenment.org/D6311
2018-06-19 14:04:40 -04:00
Mike Blumenkrantz 81d97eb45a tests: ck_assert_ptr_null -> ck_assert_ptr_eq 2018-04-05 14:04:21 -04:00
Mike Blumenkrantz 681cfc9177 tests: ck_assert_ptr_null -> ck_assert_ptr_ne 2018-04-05 13:43:54 -04:00