2011-09-14 12:02:07 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
2012-11-14 12:12:53 -08:00
|
|
|
#include <Evas.h>
|
2018-01-04 09:14:06 -08:00
|
|
|
#include <Ecore_Evas.h>
|
2011-09-14 12:02:07 -07:00
|
|
|
|
2012-11-14 12:12:53 -08:00
|
|
|
#include "evas_suite.h"
|
2016-02-04 06:11:52 -08:00
|
|
|
#include "../efl_check.h"
|
2011-09-14 12:02:07 -07:00
|
|
|
|
2016-02-04 06:11:52 -08:00
|
|
|
static const Efl_Test_Case etc[] = {
|
2012-11-14 12:12:53 -08:00
|
|
|
{ "Evas", evas_test_init },
|
2019-06-26 23:13:04 -07:00
|
|
|
{ "Evas Focus", evas_test_focus },
|
evas: move clearing cows to right place.
Summary:
Evas is child of main loop now, so evas is deleted when main loop is quitted.
In case of not calling evas_free() explicitly by app side, a crash occurs.
So move clearing cows to below ecore_shutdown().
Test Plan:
//Compile with:
//gcc evas_test.c -o evas_test `pkg-config --cflags --libs ecore evas`
#include <Evas.h>
#include <Ecore.h>
Eina_Bool
_timer_cb (void *data)
{
ecore_main_loop_quit();
return 0;
}
int
main(int argc, char *argv[])
{
evas_init();
Evas *evas = evas_new();
Evas_Object *obj = evas_object_box_add(evas);
Evas_Object *rect = evas_object_rectangle_add(evas);
evas_object_color_set(rect, 255, 255, 255, 255);
evas_object_resize(rect, 300, 400);
evas_object_show(rect);
evas_object_box_append(obj, rect);
evas_object_show(obj);
ecore_timer_add(2.0, _timer_cb, NULL);
ecore_main_loop_begin();
evas_shutdown();
return 0;
}
Reviewers: devilhorns, cedric, jpeg, id213sin, woohyun, zmike
Reviewed By: zmike
Subscribers: cedric, #committers, zmike
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6346
2018-06-27 04:50:30 -07:00
|
|
|
{ "Evas New", evas_test_new },
|
2013-11-26 04:26:30 -08:00
|
|
|
{ "Object", evas_test_object },
|
2012-11-14 12:12:53 -08:00
|
|
|
{ "Object Textblock", evas_test_textblock },
|
|
|
|
{ "Object Text", evas_test_text },
|
|
|
|
{ "Callbacks", evas_test_callbacks },
|
2013-01-04 09:19:43 -08:00
|
|
|
{ "Render Engines", evas_test_render_engines },
|
2014-02-17 19:35:24 -08:00
|
|
|
{ "Filters", evas_test_filters },
|
2014-03-14 00:00:57 -07:00
|
|
|
{ "Images", evas_test_image_object },
|
2018-04-17 02:55:20 -07:00
|
|
|
{ "Images", evas_test_image_object2 },
|
2015-01-05 23:58:33 -08:00
|
|
|
{ "Masking", evas_test_mask },
|
2015-10-14 01:30:25 -07:00
|
|
|
{ "Evas GL", evas_test_evasgl },
|
2015-11-19 03:37:07 -08:00
|
|
|
{ "Object Smart", evas_test_object_smart },
|
2019-07-09 05:52:07 -07:00
|
|
|
{ "Events", evas_test_events },
|
2019-11-11 01:14:42 -08:00
|
|
|
{ "Efl Canvas Animation", efl_test_canvas_animation },
|
2021-10-12 00:36:23 -07:00
|
|
|
{ "Map", evas_test_map },
|
2011-09-14 12:02:07 -07:00
|
|
|
{ NULL, NULL }
|
|
|
|
};
|
|
|
|
|
2018-03-27 10:51:13 -07:00
|
|
|
SUITE_INIT(evas)
|
|
|
|
{
|
|
|
|
ck_assert_int_eq(evas_init(), 1);
|
|
|
|
ck_assert_int_eq(ecore_evas_init(), 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
SUITE_SHUTDOWN(evas)
|
|
|
|
{
|
|
|
|
ck_assert_int_eq(ecore_evas_shutdown(), 0);
|
|
|
|
ck_assert_int_eq(evas_shutdown(), 0);
|
|
|
|
}
|
|
|
|
|
2011-09-14 12:02:07 -07:00
|
|
|
int
|
|
|
|
main(int argc, char **argv)
|
|
|
|
{
|
2016-02-04 06:11:52 -08:00
|
|
|
int failed_count;
|
2011-09-14 12:02:07 -07:00
|
|
|
|
2016-02-04 06:11:52 -08:00
|
|
|
if (!_efl_test_option_disp(argc, argv, etc))
|
|
|
|
return 0;
|
2011-09-14 12:02:07 -07: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 06:11:52 -08:00
|
|
|
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
|
2018-03-27 10:51:13 -07:00
|
|
|
"Evas", etc, SUITE_INIT_FN(evas), SUITE_SHUTDOWN_FN(evas));
|
2016-02-04 06:11:52 -08:00
|
|
|
|
2011-09-14 12:02:07 -07:00
|
|
|
return (failed_count == 0) ? 0 : 255;
|
|
|
|
}
|