Commit Graph

50 Commits

Author SHA1 Message Date
Mike Blumenkrantz 53fa0c1520 tests/ecore-con: add a global timeout timer for all tests
Summary:
it's possible for many tests in this suite to hang indefinitely, so ensure
that they terminate eventually instead of holding up the build

ref T6838

Reviewers: stefan_schmidt, bu5hm4n, devilhorns, Hermet

Reviewed By: Hermet

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T6838

Differential Revision: https://phab.enlightenment.org/D6542
2018-07-10 11:06:53 +09:00
Mike Blumenkrantz 3c8bc31e75 tests/ecore-con: fix dns test to use correct ordering
Summary:
it's unclear to me why this test was implemented with the expected
event ordering of SERVER_DEL -> SERVER_ERROR; going as far back
as efl 1.7, the behavior has always been ERROR -> DEL

this fixes the test to verify the expected event ordering on a dns
resolve failure
Depends on D6481

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6482
2018-07-03 12:44:13 -04:00
Marcel Hollerbach 3846750b2d ecore_con: fix possible segfault
with -O3 i get a segfault in this test. (with gcc and clang)
It looks like the compilers are doing constant folding because we
declared the struct as constant, however, due to using the address of
the fild the keyword const is simply not true, thus we are getting a
segfault because the address returned by &desc is not correct anymore,
due to the fact the constants are rolled out.

Differential Revision: https://phab.enlightenment.org/D6309
2018-06-18 12:48:58 +02:00
Cedric BAIL ccb5642eb9 Revert "efl_add_ref - fis to use efl_add properly with a parent."
This reverts commit 2fb5cc3ad0.

Most of this change where wrong as they didn't affect the destruction
of the object. efl_add_ref allow for manual handling of the lifecycle
of the object and make sure it is still alive during destructor. efl_add
will not allow you to access an object after invalidate also efl.parent.get
will always return NULL once the object is invalidated.

Differential Revision: https://phab.enlightenment.org/D6062
2018-05-24 16:02:17 -07:00
Cedric BAIL 33fd77e9e4 ecore: move close_on_destructor to close_on_invalidate as that describe the behavior best.
Fix all use to correctly behave on invalidate.
2018-05-01 10:39:01 -07:00
Cedric BAIL ec44120e93 ecore_con: migrate efl_net_ip_address_resolve to use Eina_Future. 2018-05-01 10:39:01 -07: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 2fb5cc3ad0 efl_add_ref - fis to use efl_add properly with a parent.
fixes bc18b7e7ad and
168849e8a0
2018-03-29 13:30:55 +09:00
Cedric BAIL 4c4177ac20 efl: use efl_add_ref to create objects which have no parent
Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-20 17:20:56 -07:00
Carsten Haitzler 1c74aaa7e9 Revert "cxx: Fix manual code after efl_app change."
This reverts commit 135154303b.

Revert "efl: move signal events from efl.loop to efl.app"
This reverts commit 3dbca39f98.

Revert "efl: add test suite for efl_app"
This reverts commit 3e94be5d73.

Revert "efl: create Efl.App class, the parent of Efl.Loop"
This reverts commit 28fe00b94e.

Go back to before efl.app because I think this should be done with
superclassing here not a parent object. reasons?

1. multiple loops per single thread make no sense. so if multilpe loop
objects they wont be contained in a single app object and then deleted
like this.
2. the app object is not really sharable in this design so it cant be
accessed from other threads
3. it makes it harder to get the main loop or app object (well 2 func
calls one calling the other and more typing. it is longer to type and
more work where it is not necessary, and again it can't work from
other threads unless we go duplicating efl.app per thread and then
what is the point of splittyign out the signal events from efl.loop
then?)

etc.
2018-03-03 13:40:33 +09:00
Mike Blumenkrantz 28fe00b94e efl: create Efl.App class, the parent of Efl.Loop 2018-02-26 14:02:51 -05:00
Marcel Hollerbach b8f4dc296f ecore_con: switch from 1234 to AF_UNSPEC
there are systems where sa_family_t is a enum, so assigning 1234 will
lead to compililation errors on picky systems
2018-01-02 14:35:31 +01:00
Carsten Haitzler 9bedda14b3 efl loop - rename ecore_main_loop_get to efl_main_loop_get
ecore_main_loop_get() is really a new "eo api" but it's using our old
ecore_* namespace, so move to the new efl namespace.
2018-01-02 16:13:54 +09:00
Cedric Bail 25747d0881 ecore: rename efl_loop_Eina_FutureXXX_timeout to efl_loop_timeout. 2017-12-03 16:30:53 -08:00
Cedric Bail 7d229efda5 ecore_con: use eina_future based timeout for tests. 2017-12-01 00:38:43 -08:00
Vincent Torri 0cdd501246 EFL For WIN32: Replace HAVE_EVIL define with _WIN32 2017-09-22 05:06:10 -05:00
Carsten Haitzler e1605e6405 tests - make ecore con test suite reliable and work
basically ecore_con's test suite was broken. ipv6 checks were broken.
you now need to set an env var to get ipv6 tested. using eocre_con to
detetc it didnt init eina or ecore_con and if you do init these then
the other tests that check return values from these fail... so make it
an env var if you want to test ipv6. now it's reliable and works!
2017-07-29 14:56:57 +09:00
Ivan Furs 3d6212b8f2 removing duplicates winsock2.h
Summary:
winsock2.h included in Ecore.h
But Ecore.h ' is included in
/bin/efreet/efreet_desktop_cache_create.c
src/bin/efreet/efreet_mime_cache_create.c
src/tests/ecore_con/ecore_con_test_efl_net_ip_address.c

Reviewers: NikaWhite, cedric, raster, an.kroitor

Reviewed By: raster

Subscribers: artem.popov, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4687
2017-03-07 13:59:54 +09: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
Gustavo Sverzut Barbieri f6cac7ed9a cmake: add ecore_con. 2017-01-27 17:26:05 -02:00
Gustavo Sverzut Barbieri e2c0b7741b tests/ecore_con: skip ipv6 tests if that's disabled on the running system. 2016-12-19 15:49:16 -02:00
Gustavo Sverzut Barbieri dd5cdda64b more eo simplified to use Eina_Slice instead of pointer to.
Working directly with Eina_Slice is easier than a pointer to it,
requires no validation of the pointers and is cheap since it's just
putting together size_t + void*.

However we can't hint the user of 'const(Eina.Slice)' properties as
Eolian is incorrectly generating getters as:

   const Eina_Slice class_property_get(...)

which is makes compilers complain about ignored qualifiers:

   ../src/lib/ecore/efl_io_copier.eo.h:329:7: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]

Leave some TODO so @q66 can fix those.
2016-12-19 15:30:56 -02:00
Cedric BAIL f553c92091 ecore_con: fix incompatible type warning. 2016-12-15 09:59:41 -08:00
Cedric BAIL 59bf58829c ecore_con: fix misleading indentation warning. 2016-12-15 09:55:11 -08:00
Daniel Kolesa ca50a4de4c ecore con tests: fix missing include 2016-12-14 18:23:16 +01:00
Gustavo Sverzut Barbieri c4ab9882e1 test efl_net_ip_address: also check localhost6.
Fedora and other systems use localhost6 for ::1, then use that in
addition to localhost.
2016-12-12 12:27:45 -02:00
Gustavo Sverzut Barbieri 8415626397 test efl_net_ip_address: check if /etc/hosts has '::1 localhost'
it seems that the bot and some users do not have ::1 localhost in
/etc/hosts, check for that and print it out.

be more verbose on resolve errors, showing the results and error code.

also allow more time for resolution, otherwise the local timeout may
expire before getaddrinfo() returns with failures.
2016-12-12 11:22:16 -02:00
Gustavo Sverzut Barbieri 633ec445b8 efl_net: add Efl.Net.Ip_Address
This is a string parser, serializer and asynchronous resolver.

It's purpose is to convert to and from the strings we use in our
dialers and servers, such as "127.0.0.1:1234" or "[::1]:1234",
properties allow to check the family, port, address bytes (slice) and
even get a struct sockaddr pointer to use with bind()/connect() in
outside code.

It will also offer some utilities present in netinet/in.h in an easy
to use way, after all IN6_IS_ADDR_LOOPBACK() works one way, while
there is no IN_LOOPBACK and comparing with INADDR_LOOPBACK will lead
to errors since it's in network order.

Last but not least, it will do asynchronous resolve of host and port
names using an internal thread and getaddrinfo(). The results are
delivered using a Future with an array of objects.
2016-12-12 02:30:33 -02:00
Carsten Haitzler 8889daa7c5 ecore con eet test - dont use localhost port 8080
so thats a common local port to use for other things... 8080 - don't
use it, so use 12346 much like 12345 is for the other tests. far less
likely to clash. fix up tests to work better.
2016-08-05 17:09:34 +09:00
Stefan Schmidt aad5b8b83e tests: ecore_con: make sure info is initialized
One test does init info before passing it to _url_compl_cb while two others
are not. Also test if inof is NULL in callback here to avoid crashes.

tests/ecore_con/ecore_con_test_ecore_con_url.c:194:4: warning: 'info' may be used uninitialized in this function [-Wmaybe-uninitialized]
    ecore_event_handler_add(ECORE_CON_EVENT_URL_COMPLETE,
2016-08-02 09:31:10 +02:00
Carsten Haitzler b8b41e6683 ecore-con tests - remove WRONG connect check
sothe ecore-con tests were calling ecore_con_server_connected_get()
every time a server was created on a NUL server object. WTF? this is
pointless. testing if an api returns tre on being connected on an
invalid object? all it does is create lots of eo noise. remove so we
can see the real errors in the output.

@fix
2016-05-24 09:20:49 +09:00
Vincent Torri b772a46437 Test rework #2: Ecore_Con 2016-02-16 12:41:06 +00:00
Srivardhan Hebbar c99d50e00b ecore_con: adding test case for ecore_con_url_status_code_get.
Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-09 16:21:44 -08:00
Stefan Schmidt c74e03fda4 tests/ecore_con: check saved env variables before setting them again.
We see segfaults on Jenkins with these two test cases. Better check
before setting them as we had similar problems before on this setup
as XDG_RUNTIME_DIR might never be set.
2015-11-03 12:50:50 +01:00
Cedric BAIL ae5e2c8284 emile/ecore_con: drop SSLv3 support due to security issue.
SSLv3 has been compromised a year ago by what is known as POODLE
(https://en.wikipedia.org/wiki/POODLE). Every major browser have now
dropped support for SSLv3 and distribution are starting to do so also.
It is a good timing for us to do so, especially as it breaks build on
some distribution.
2015-11-02 14:22:42 -08:00
Cedric BAIL ec909b4d6a ecore_con: be more defensive while using environment variable provided by the system.
This fix a crash during make check for system where one of those string where not defined.
2015-10-12 14:01:23 -07:00
Cedric BAIL 7aea193a97 ecore_con: fix test to properly send the right amount of data (including the '\0'). 2015-08-21 17:54:13 +02:00
Srivardhan Hebbar b3ce48e2f9 ecore_con: remove unwanted delete calls from ecore_con_eet test cases.
Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-08-07 17:08:43 +02:00
Srivardhan Hebbar 715e0a2508 ecore_con: Correcting ece_svr to ece_cl in test case.
Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

Subscribers: stefan_schmidt, cedric

Differential Revision: https://phab.enlightenment.org/D2903
2015-08-03 12:17:22 +02:00
Cedric BAIL 1d27699bc6 ecore_con: fix test to actually send a NULL terminated string. 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
Tom Hacohen 10f599bd59 Ecore con eet test: Fix const discard issue. 2015-07-07 13:25:58 +01:00
Cedric BAIL 68343123c1 ecore_con: remove warning when not testing ftp/http push. 2015-05-07 09:53:08 +02:00
Stefan Schmidt bd97a187ba tests/ecore_con: Avoid warining about _parse_url being unused
It is only used inside two ifdef conditions. Better check them for
_parse_url as well.
2015-04-28 16:28:46 +02:00
Srivardhan Hebbar f4453bc00b ecore_con: add another test case to cover remaining functions in ecore_con_eet.
Summary:
When I checked the Jenkins report, I saw few of the functions were left off. So added another case and modified the existing case to cover all the functions or ecore_con_eet.

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

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-04-22 15:10:20 +02:00
Srivardhan Hebbar 48db81cfb5 ecore_con: add test cases to cover more ecore con functions.
Summary:
The dns lookup test would result in a crash unless https://phab.enlightenment.org/D2398 fix.
Also added more functions to existing case to cover ecore_con.c

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

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-04-22 15:10:19 +02:00
Srivardhan Hebbar 3d697254b0 ecore_con: add test cases for ecore_con_eet.
Summary:
Added test case for ecore_con_eet.

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

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-04-15 14:50:06 +02:00
Srivardhan Hebbar 2f4dee02e4 ecore_con: add test cases related to cookies.
Summary:
Added test cases related to ecore_con_url cookies.

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

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-04-15 14:29:37 +02:00
Srivardhan Hebbar 4b0e879591 ecore_con: Split ecore_con test suite from ecore.
Summary:
Have created ecore_con test suite.

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

Reviewers: cedric, Sergeant_Whitespace, stefan_schmidt

Subscribers: stefan_schmidt, Sergeant_Whitespace, cedric

Maniphest Tasks: T2235

Differential Revision: https://phab.enlightenment.org/D2269
2015-04-06 16:37:53 +02:00