2012-12-03 10:29:51 -08:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "ecore_suite.h"
|
2016-02-04 05:05:17 -08:00
|
|
|
#include "../efl_check.h"
|
2018-03-27 10:51:13 -07:00
|
|
|
#include <Ecore.h>
|
2012-12-03 10:29:51 -08:00
|
|
|
|
2016-02-04 05:05:17 -08:00
|
|
|
static const Efl_Test_Case etc[] = {
|
2012-12-03 10:29:51 -08:00
|
|
|
{ "Ecore", ecore_test_ecore },
|
2018-04-09 04:37:02 -07:00
|
|
|
{ "idle", ecore_test_ecore_idle },
|
2018-04-09 04:37:02 -07:00
|
|
|
{ "poller", ecore_test_ecore_idle },
|
2015-01-30 01:49:50 -08:00
|
|
|
#if HAVE_ECORE_X
|
2012-12-03 10:29:51 -08:00
|
|
|
{ "Ecore_X", ecore_test_ecore_x },
|
2015-01-30 01:49:50 -08:00
|
|
|
#endif
|
2013-01-04 09:19:43 -08:00
|
|
|
{ "Ecore_Imf", ecore_test_ecore_imf },
|
2012-12-14 15:38:40 -08:00
|
|
|
#if HAVE_ECORE_AUDIO
|
|
|
|
{ "Ecore Audio", ecore_test_ecore_audio},
|
|
|
|
#endif
|
2013-04-11 18:35:45 -07:00
|
|
|
{ "Ecore_Timers", ecore_test_timer },
|
2013-04-11 18:45:05 -07:00
|
|
|
{ "Ecore_Evas", ecore_test_ecore_evas },
|
2013-05-16 10:07:56 -07:00
|
|
|
{ "Ecore_Animators", ecore_test_animator },
|
2016-11-07 14:05:55 -08:00
|
|
|
{ "Eina_Thread_Queue", ecore_test_ecore_thread_eina_thread_queue },
|
2018-04-09 04:37:12 -07:00
|
|
|
{ "Eina_Thread_Queue", ecore_test_ecore_thread_eina_thread_queue2 },
|
2014-10-29 05:14:26 -07:00
|
|
|
#if HAVE_ECORE_FB
|
|
|
|
{ "Ecore_Fb", ecore_test_ecore_fb },
|
2014-09-29 06:20:04 -07:00
|
|
|
#endif
|
2014-10-29 05:39:56 -07:00
|
|
|
{ "Ecore_Input", ecore_test_ecore_input },
|
2014-11-18 01:26:43 -08:00
|
|
|
{ "Ecore_File", ecore_test_ecore_file },
|
2016-05-02 18:14:44 -07:00
|
|
|
{ "Ecore_Job", ecore_test_ecore_job },
|
2016-05-31 01:16:14 -07:00
|
|
|
{ "Ecore_Args", ecore_test_ecore_args },
|
ecore_pipe: remove null check condition and fix segfualt on Windows
Summary:
This reverts commit 4917910b4911905236fa099bbc16b833b056ca07.
4917910b break backward compatibility.
Reproduction:
void pipe_handler(...);
pipe = ecore_pipe_add(pipe_handler, NULL);
ecore_pipe_write(pipe, NULL, 0);
Because of the null check condition, pipe_handler isn't called after 4917910b.
Some apps behavior which is written to expected to call pipe_handler was broken.
also, this patch fixed segfault during build on Windows
Test Plan: make on Windows
Reviewers: raster, zmike, vtorri
Reviewed By: zmike, vtorri
Subscribers: woohyun, cedric, #reviewers, #committers, zmike, vtorri
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6824
2018-08-17 09:42:35 -07:00
|
|
|
{ "Ecore_Pipe", ecore_test_ecore_pipe },
|
2020-01-05 06:05:36 -08:00
|
|
|
{ "Ecore_Evas_Selection", ecore_test_ecore_evas_selection },
|
2012-12-03 10:29:51 -08:00
|
|
|
{ NULL, NULL }
|
|
|
|
};
|
|
|
|
|
2018-06-12 07:52:12 -07:00
|
|
|
static Ecore_Timer *timeout;
|
|
|
|
int timeout_reached = 0;
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
timeout_cb()
|
|
|
|
{
|
2018-06-12 10:57:01 -07:00
|
|
|
#if CHECK_MINOR_VERSION >= 11
|
2018-06-12 07:52:12 -07:00
|
|
|
const char *tcname = tcase_name();
|
|
|
|
|
|
|
|
timeout_reached = 1;
|
|
|
|
|
|
|
|
if (tcname && strstr(tcname, "download"))
|
|
|
|
{
|
|
|
|
fprintf(stderr, "test timeout reached: download failed, probably network issue. skipping\n");
|
|
|
|
ecore_main_loop_quit();
|
|
|
|
}
|
|
|
|
else
|
2018-06-12 10:57:01 -07:00
|
|
|
#endif
|
2018-06-12 07:52:12 -07:00
|
|
|
ck_abort_msg("test timeout reached!");
|
|
|
|
timeout = NULL;
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2018-03-27 10:51:13 -07:00
|
|
|
SUITE_INIT(ecore)
|
|
|
|
{
|
2018-06-12 07:52:12 -07:00
|
|
|
timeout_reached = 0;
|
2018-03-27 10:51:13 -07:00
|
|
|
ck_assert_int_eq(ecore_init(), 1);
|
2019-10-28 12:03:28 -07:00
|
|
|
#ifdef HAVE_FORK
|
|
|
|
if (eina_streq(getenv("CK_FORK"), "no")) return;
|
|
|
|
#endif
|
2018-06-12 07:52:12 -07:00
|
|
|
timeout = ecore_timer_add(5.0, timeout_cb, NULL);
|
|
|
|
ck_assert_msg(!!timeout, "timeout timer creation failed!");
|
2018-03-27 10:51:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
SUITE_SHUTDOWN(ecore)
|
|
|
|
{
|
2018-06-12 07:52:12 -07:00
|
|
|
ecore_timer_del(timeout);
|
|
|
|
timeout = NULL;
|
2018-03-27 10:51:13 -07:00
|
|
|
ck_assert_int_eq(ecore_shutdown(), 0);
|
|
|
|
}
|
|
|
|
|
2012-12-03 10:29:51 -08:00
|
|
|
int
|
|
|
|
main(int argc, char **argv)
|
|
|
|
{
|
2016-02-04 05:05:17 -08:00
|
|
|
int failed_count;
|
2012-12-03 10:29:51 -08:00
|
|
|
|
2016-02-04 05:05:17 -08:00
|
|
|
if (!_efl_test_option_disp(argc, argv, etc))
|
|
|
|
return 0;
|
2012-12-03 10:29:51 -08:00
|
|
|
|
2017-02-03 05:49:38 -08:00
|
|
|
#ifdef NEED_RUN_IN_TREE
|
2013-01-04 09:19:43 -08:00
|
|
|
putenv("EFL_RUN_IN_TREE=1");
|
2017-02-03 05:49:38 -08:00
|
|
|
#endif
|
2013-01-04 09:19:43 -08:00
|
|
|
|
2016-02-04 05:05:17 -08:00
|
|
|
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
|
2018-03-27 10:51:13 -07:00
|
|
|
"Ecore", etc, SUITE_INIT_FN(ecore), SUITE_SHUTDOWN_FN(ecore));
|
2012-12-03 10:29:51 -08:00
|
|
|
|
|
|
|
return (failed_count == 0) ? 0 : 255;
|
|
|
|
}
|